BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
ParticleIDBase Class Referenceabstract

#include <ParticleIDBase.h>

+ Inheritance diagram for ParticleIDBase:

Public Member Functions

 ParticleIDBase ()
 
virtual ~ParticleIDBase ()
 
virtual void init ()=0
 
virtual void calculate ()=0
 
virtual bool IsPidInfoValid () const =0
 
virtual double chi (int n) const =0
 
virtual double prob (int n) const =0
 
virtual int ndof () const =0
 
EvtRecTrackPidTrk () const
 
void setRecTrack (EvtRecTrack *trk)
 
double chiMinCut () const
 
void setChiMinCut (const double chi=4)
 
double pdfMinSigmaCut () const
 
void setPdfMinSigmaCut (const double pdf=4)
 
double getRunNo () const
 
void setRunNo (const double runh=8093)
 
double p ()
 
double pt ()
 
double charge ()
 
double xmass (int n)
 
double velc ()
 
double probCalculate (double chi2, int n)
 
double pdfCalculate (double offset, double sigma)
 
double interpolation (double *x, double *y, double x1)
 
double pol2 (double x, double *par)
 
double pol3 (double x, double *par)
 
double pol4 (double x, double *par)
 
int useDedx () const
 
int useTof () const
 
int useTof1 () const
 
int useTof2 () const
 
int useTofE () const
 
int useTofQ () const
 
int useTofC () const
 
int useTofCorr () const
 
int useEmc () const
 
int useMuc () const
 
int onlyPionKaon () const
 
int onlyPionKaonProton () const
 
int onlyPionKaonElectron () const
 
int all () const
 
int onlyElectron () const
 
int onlyMuon () const
 
int onlyPion () const
 
int onlyKaon () const
 
int onlyProton () const
 
int methodLikelihood () const
 
int methodProbability () const
 
int methodNeuronNetwork () const
 
int dedxValid () const
 
int tofValid () const
 
int tofeValid () const
 
int tofqValid () const
 
int tofcValid () const
 
int tofcorrValid () const
 
int emcValid () const
 
int mucValid () const
 
void set_path (const char *s_path=0)
 

Protected Member Functions

virtual int particleIDCalculation ()=0
 
virtual int LikelihoodCalculation ()=0
 

Static Protected Attributes

static std::string path = ""
 

Detailed Description

Definition at line 21 of file ParticleIDBase.h.

Constructor & Destructor Documentation

◆ ParticleIDBase()

ParticleIDBase::ParticleIDBase ( )

Definition at line 43 of file ParticleIDBase.cxx.

44{
45 m_trk = 0;
46 m_chimin_cut = 4;
47 m_pdfsigmamin_cut=99;
48
49#ifndef BEAN
50 if( path.empty() ) set_path(0);
51#endif
52}
static std::string path
void set_path(const char *s_path=0)

◆ ~ParticleIDBase()

virtual ParticleIDBase::~ParticleIDBase ( )
inlinevirtual

Definition at line 26 of file ParticleIDBase.h.

26{;}

Member Function Documentation

◆ all()

int ParticleIDBase::all ( ) const
inline

Definition at line 78 of file ParticleIDBase.h.

78{return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}

◆ calculate()

virtual void ParticleIDBase::calculate ( )
pure virtual

◆ charge()

double ParticleIDBase::charge ( )

Definition at line 115 of file ParticleIDBase.cxx.

115 {
116 double val = 999;
117 if(!m_trk) return val;
118 if(!m_trk->isMdcTrackValid()) return val;
119 RecMdcTrack *mdcTrk = m_trk->mdcTrack();
120 val = mdcTrk->charge() + 0.0;
121 return val;
122}
const int charge() const
Definition: DstMdcTrack.h:53
bool isMdcTrackValid()
Definition: EvtRecTrack.h:43
RecMdcTrack * mdcTrack()
Definition: EvtRecTrack.h:53

Referenced by DedxPID::CorrDedx(), TofCorrPID::offsetTof(), TofEPID::offsetTofE(), DedxPID::particleIDCalculation(), Tof1PID::particleIDCalculation(), Tof2PID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), TofCorrPID::sigmaTof(), and TofEPID::sigmaTofE().

◆ chi()

virtual double ParticleIDBase::chi ( int  n) const
pure virtual

◆ chiMinCut()

double ParticleIDBase::chiMinCut ( ) const
inline

◆ dedxValid()

int ParticleIDBase::dedxValid ( ) const
inline

Definition at line 90 of file ParticleIDBase.h.

90{return DEDX_VALID;}

◆ emcValid()

int ParticleIDBase::emcValid ( ) const
inline

Definition at line 96 of file ParticleIDBase.h.

96{return EMC_VALID;}

◆ getRunNo()

double ParticleIDBase::getRunNo ( ) const
inline

Definition at line 42 of file ParticleIDBase.h.

42{return m_runno;}

Referenced by TofCPID::calculate(), DedxPID::CorrDedx(), TofCorrPID::init(), TofCPID::offsetTofC(), and TofCPID::sigmaTofC().

◆ init()

virtual void ParticleIDBase::init ( )
pure virtual

◆ interpolation()

double ParticleIDBase::interpolation ( double *  x,
double *  y,
double  x1 
)

Definition at line 124 of file ParticleIDBase.cxx.

124 {
125 double c1 = (y[0]-y[1])*(x[1]-x[2])-(x[0]-x[1])*(y[1]-y[2]);
126 double c2 = (x[0]*x[0]-x[1]*x[1])*(x[1]-x[2])-(x[1]*x[1]-x[2]*x[2])*(x[0]-x[1]);
127 double c = c1/c2;
128 double b1 = (y[0]-y[1])*(x[1]*x[1]-x[2]*x[2])-(x[0]*x[0]-x[1]*x[1])*(y[1]-y[2]);
129 double b2 = (x[0]-x[1])*(x[1]*x[1]-x[2]*x[2])-(x[1]-x[2])*(x[0]*x[0]-x[1]*x[1]);
130 double b = b1/b2;
131 double a = y[0] - b*x[0]-c*x[0]*x[0];
132 double y1 = a + b*x1 +c*x1*x1;
133 return y1;
134}
Double_t x[10]
TCanvas * c1
Definition: tau_mode.c:75

◆ IsPidInfoValid()

virtual bool ParticleIDBase::IsPidInfoValid ( ) const
pure virtual

◆ LikelihoodCalculation()

virtual int ParticleIDBase::LikelihoodCalculation ( )
protectedpure virtual

◆ methodLikelihood()

int ParticleIDBase::methodLikelihood ( ) const
inline

Definition at line 86 of file ParticleIDBase.h.

86{return LIKELIHOOD_PID;}

◆ methodNeuronNetwork()

int ParticleIDBase::methodNeuronNetwork ( ) const
inline

Definition at line 88 of file ParticleIDBase.h.

88{return NEURONNETWORK_PID;}

◆ methodProbability()

◆ mucValid()

int ParticleIDBase::mucValid ( ) const
inline

Definition at line 97 of file ParticleIDBase.h.

97{return MUC_VALID;}

◆ ndof()

virtual int ParticleIDBase::ndof ( ) const
pure virtual

◆ onlyElectron()

int ParticleIDBase::onlyElectron ( ) const
inline

◆ onlyKaon()

int ParticleIDBase::onlyKaon ( ) const
inline

◆ onlyMuon()

int ParticleIDBase::onlyMuon ( ) const
inline

◆ onlyPion()

◆ onlyPionKaon()

int ParticleIDBase::onlyPionKaon ( ) const
inline

Definition at line 75 of file ParticleIDBase.h.

75{return (IDENTIFY_PION | IDENTIFY_KAON);}

◆ onlyPionKaonElectron()

int ParticleIDBase::onlyPionKaonElectron ( ) const
inline

Definition at line 77 of file ParticleIDBase.h.

77{return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}

◆ onlyPionKaonProton()

int ParticleIDBase::onlyPionKaonProton ( ) const
inline

Definition at line 76 of file ParticleIDBase.h.

76{return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}

Referenced by DQAJpsi2PPbarAlg::execute(), and DQAKsKpi::execute().

◆ onlyProton()

int ParticleIDBase::onlyProton ( ) const
inline

Definition at line 83 of file ParticleIDBase.h.

83{return IDENTIFY_PROTON;}

Referenced by Gam4pikp::execute(), incllambda::execute(), BeamParams::execute(), and ParticleID::LikelihoodCalculation().

◆ p()

double ParticleIDBase::p ( )

Definition at line 99 of file ParticleIDBase.cxx.

99 {
100 double val = 999;
101 if(!m_trk) return val;
102 if(!m_trk->isMdcTrackValid()) return val;
103 RecMdcTrack *mdcTrk = m_trk->mdcTrack();
104 val = mdcTrk->p();
105 return val;
106}
const double p() const
Definition: DstMdcTrack.h:58

Referenced by DedxPID::cal_par(), DedxPID::iterate(), TofCorrPID::particleIDCalculation(), and probCalculate().

◆ particleIDCalculation()

virtual int ParticleIDBase::particleIDCalculation ( )
protectedpure virtual

◆ pdfCalculate()

double ParticleIDBase::pdfCalculate ( double  offset,
double  sigma 
)

Definition at line 90 of file ParticleIDBase.cxx.

90 {
91 // const double pi = 3.141592653589793238;
92 const double pi = M_PI;
93 const double twoPi = 2*pi;
94 double chi2 = -0.5*offset*offset/(sigma*sigma);
95 double pdf = exp(chi2)/(sigma*sqrt(twoPi));
96 return pdf;
97}
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
const double twoPi
Definition: MdcSeg.cxx:33
#define M_PI
Definition: TConstant.h:4
const float pi
Definition: vector3.h:133

Referenced by TofCorrPID::correlationCheck(), ParticleID::LikelihoodCalculation(), DedxPID::particleIDCalculation(), Tof1PID::particleIDCalculation(), Tof2PID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofEPID::particleIDCalculation(), and TofPID::particleIDCalculation().

◆ pdfMinSigmaCut()

◆ PidTrk()

◆ pol2()

double ParticleIDBase::pol2 ( double  x,
double *  par 
)

Definition at line 136 of file ParticleIDBase.cxx.

136 {
137 double y=x;
138 // return par[0] + (par[1] * y) +(par[2] * y * y);
139 return par[0] + y*(par[1] + y*(par[2]));
140}

◆ pol3()

double ParticleIDBase::pol3 ( double  x,
double *  par 
)

Definition at line 142 of file ParticleIDBase.cxx.

142 {
143 double y=x;
144 // return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y);
145 return par[0] + y*(par[1] + y*(par[2] + y*(par[3])));
146}

◆ pol4()

double ParticleIDBase::pol4 ( double  x,
double *  par 
)

Definition at line 148 of file ParticleIDBase.cxx.

148 {
149 double y=x;
150 // return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y) + (par[4] * y * y*y*y);
151 return par[0] + y*(par[1] + y*(par[2] + y*(par[3] + y*(par[4]))));
152}

◆ prob()

virtual double ParticleIDBase::prob ( int  n) const
pure virtual

◆ probCalculate()

double ParticleIDBase::probCalculate ( double  chi2,
int  n 
)

◆ pt()

double ParticleIDBase::pt ( )

Definition at line 107 of file ParticleIDBase.cxx.

107 {
108 double val = 999;
109 if(!m_trk) return val;
110 if(!m_trk->isMdcTrackValid()) return val;
111 RecMdcTrack *mdcTrk = m_trk->mdcTrack();
112 val = mdcTrk->pxy();
113 return val;
114}
const double pxy() const
Definition: DstMdcTrack.h:54

◆ set_path()

void ParticleIDBase::set_path ( const char *  s_path = 0)

Definition at line 54 of file ParticleIDBase.cxx.

55{
56 if ( s_path ) {
57 path = string(s_path);
58 } else {
59 char* env_path = getenv("PARTICLEIDROOT");
60 if ( !env_path ) {
61 cout << " ParticleIDBase::set_path ERROR:"
62 " the environment PARTICLEIDROOT not defined " << endl;
63 exit(1);
64 }
65 path = string(env_path);
66 }
67}

Referenced by ParticleIDBase().

◆ setChiMinCut()

◆ setPdfMinSigmaCut()

void ParticleIDBase::setPdfMinSigmaCut ( const double  pdf = 4)
inline

Definition at line 41 of file ParticleIDBase.h.

41{m_pdfsigmamin_cut= pdf;}

Referenced by TofPID::particleIDCalculation().

◆ setRecTrack()

◆ setRunNo()

void ParticleIDBase::setRunNo ( const double  runh = 8093)
inline

Definition at line 43 of file ParticleIDBase.h.

43{m_runno = runh;}

◆ tofcorrValid()

int ParticleIDBase::tofcorrValid ( ) const
inline

Definition at line 95 of file ParticleIDBase.h.

95{return TOFCorr_VALID;}

◆ tofcValid()

int ParticleIDBase::tofcValid ( ) const
inline

Definition at line 94 of file ParticleIDBase.h.

94{return TOFC_VALID;}

◆ tofeValid()

int ParticleIDBase::tofeValid ( ) const
inline

Definition at line 92 of file ParticleIDBase.h.

92{return TOFE_VALID;}

◆ tofqValid()

int ParticleIDBase::tofqValid ( ) const
inline

Definition at line 93 of file ParticleIDBase.h.

93{return TOFQ_VALID;}

◆ tofValid()

int ParticleIDBase::tofValid ( ) const
inline

Definition at line 91 of file ParticleIDBase.h.

91{return TOF_VALID;}

◆ useDedx()

◆ useEmc()

int ParticleIDBase::useEmc ( ) const
inline

Definition at line 71 of file ParticleIDBase.h.

71{return USE_EMC;}

Referenced by BeamParams::execute().

◆ useMuc()

int ParticleIDBase::useMuc ( ) const
inline

Definition at line 72 of file ParticleIDBase.h.

72{return USE_MUC;}

Referenced by BeamParams::execute().

◆ useTof()

int ParticleIDBase::useTof ( ) const
inline

Definition at line 64 of file ParticleIDBase.h.

64{return USE_TOF;}

◆ useTof1()

◆ useTof2()

◆ useTofC()

int ParticleIDBase::useTofC ( ) const
inline

Definition at line 69 of file ParticleIDBase.h.

69{return USE_TOFC;}

◆ useTofCorr()

int ParticleIDBase::useTofCorr ( ) const
inline

Definition at line 70 of file ParticleIDBase.h.

70{return USE_TOFCorr;}

◆ useTofE()

int ParticleIDBase::useTofE ( ) const
inline

Definition at line 67 of file ParticleIDBase.h.

67{return USE_TOFE;}

Referenced by Rhopi::execute(), and BeamParams::execute().

◆ useTofQ()

int ParticleIDBase::useTofQ ( ) const
inline

Definition at line 68 of file ParticleIDBase.h.

68{return USE_TOFQ;}

Referenced by BeamParams::execute().

◆ velc()

double ParticleIDBase::velc ( )

Definition at line 76 of file ParticleIDBase.cxx.

76 {
77 // double vel = 29.9792458; // tof_path unit in cm.
78 double vel = 299.792458; // tof path unit in mm
79 return vel;
80}

Referenced by Tof1PID::particleIDCalculation(), Tof2PID::particleIDCalculation(), TofCPID::particleIDCalculation(), and TofEPID::particleIDCalculation().

◆ xmass()

double ParticleIDBase::xmass ( int  n)

Definition at line 70 of file ParticleIDBase.cxx.

70 {
71 double mass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
72 if(n < 0 || n >=5) return 0.0;
73 return mass[n];
74}
double mass
const Int_t n

Member Data Documentation

◆ path


The documentation for this class was generated from the following files: