#include <ParticleID.h>
Inheritance diagram for ParticleID:
Public Member Functions | |
~ParticleID () | |
void | init () |
bool | IsDedxInfoValid () const |
bool | IsTofInfoValid () const |
bool | IsTofEInfoValid () const |
bool | IsTofQInfoValid () const |
bool | IsTofCInfoValid () const |
bool | IsTofCorrInfoValid () const |
bool | IsEmcInfoValid () const |
bool | IsMucInfoValid () const |
double | chiDedx (int n) const |
double | chiTof (int n) const |
double | chiTof1 (int n) const |
double | chiTof2 (int n) const |
double | chiTofE (int n) const |
double | chiTofQ (int n) const |
double | chiTofC (int n) const |
double | chiTofCorr (int n) const |
double | chiEmc (int n) const |
double | chiMuc (int n) const |
double | probDedx (int n) const |
double | probTof (int n) const |
double | probTofE (int n) const |
double | probTofQ (int n) const |
double | probTofC (int n) const |
double | probTofCorr (int n) const |
double | probEmc (int n) const |
double | probMuc (int n) const |
double | pdfDedx (int n) |
double | pdfTof (int n) |
double | pdfTofE (int n) |
double | pdfTofQ (int n) |
double | pdfTofC (int n) |
double | pdfTofCorr (int n) |
double | pdfEmc (int n) |
double | pdfMuc (int n) |
int | getNhitCut () const |
void | setNhitCut (const int nhitcuth=5) |
void | setMethod (const int method) |
void | usePidSys (const int pidsys) |
void | identify (const int pidcase) |
void | calculate () |
bool | IsPidInfoValid () const |
double | chi (int n) const |
double | prob (int n) const |
int | ndof () const |
double | pdf (int n) const |
double | lhf (int n) const |
double | probElectron () const |
double | probMuon () const |
double | probPion () const |
double | probKaon () const |
double | probProton () const |
int | discard () const |
double | pdfElectron () const |
double | pdfMuon () const |
double | pdfPion () const |
double | pdfKaon () const |
double | pdfProton () const |
int | neuronStat () const |
double | neuronVal () const |
int | ipmt () |
double | dt (int ipar, int ipmt) |
double | dtCorr (int ipar, int ipmt) |
double | sigCorr (int ipar, int ipmt) |
double | chiCorr (int ipar, int ipmt) |
double | offset (int ipar) |
double | sigma (int ipar) |
EvtRecTrack * | PidTrk () const |
void | setRecTrack (EvtRecTrack *trk) |
double | chiMinCut () const |
void | setChiMinCut (const double chi=4) |
double | chiMaxCut () const |
void | setChiMaxCut (const double chi=6) |
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) |
void | set_path (std::string s_path) |
Static Public Member Functions | |
static ParticleID * | instance () |
Protected Member Functions | |
int | particleIDCalculation () |
int | LikelihoodCalculation () |
int | neuronPIDCalculation () |
Static Protected Attributes | |
static std::string | path = "" |
Private Member Functions | |
bool | IsDedxInfoUsed () const |
bool | IsTofInfoUsed () const |
bool | IsTof1InfoUsed () const |
bool | IsTof2InfoUsed () const |
bool | IsTofEInfoUsed () const |
bool | IsTofQInfoUsed () const |
bool | IsTofCInfoUsed () const |
bool | IsTofCorrInfoUsed () const |
bool | IsEmcInfoUsed () const |
bool | IsMucInfoUsed () const |
ParticleID () | |
Private Attributes | |
DedxPID * | m_dedxpid |
TofEPID * | m_tofepid |
TofPID * | m_tofpid |
TofQPID * | m_tofqpid |
TofCPID * | m_tofcpid |
TofCorrPID * | m_tofcorrpid |
EmcPID * | m_emcpid |
MucPID * | m_mucpid |
double | m_chisq [5] |
double | m_prob [5] |
double | m_pdf [5] |
double | m_likelihoodfraction [5] |
double | m_TotalLikelihood |
int | m_nhitcut |
double | m_chicut |
int | m_ndof |
int | m_pidsys |
int | m_pidcase |
int | m_method |
int | m_discard |
Static Private Attributes | |
static ParticleID * | m_pointer = 0 |
Definition at line 36 of file ParticleID.h.
ParticleID::~ParticleID | ( | ) |
Definition at line 88 of file ParticleID.cxx.
00088 { 00089 // if(m_dedxpid) delete m_dedxpid; 00090 // if(m_tof1pid) delete m_tof1pid; 00091 // if(m_tof2pid) delete m_tof2pid; 00092 // if(m_tofepid) delete m_tofepid; 00093 // if(m_tofqpid) delete m_tofqpid; 00094 // if(m_emcpid) delete m_emcpid; 00095 }
ParticleID::ParticleID | ( | ) | [private] |
Definition at line 73 of file ParticleID.cxx.
References m_dedxpid, m_emcpid, m_mucpid, m_tofcorrpid, m_tofcpid, m_tofepid, m_tofpid, and m_tofqpid.
Referenced by instance().
00073 : ParticleIDBase() { 00074 m_dedxpid = 0; 00075 m_tofpid = 0; 00076 m_tofepid = 0; 00077 m_tofqpid = 0; 00078 m_tofcpid = 0; 00079 m_tofcorrpid = 0; 00080 m_emcpid = 0; 00081 m_mucpid = 0; 00082 00083 00084 00085 }
int ParticleIDBase::all | ( | ) | const [inline, inherited] |
Definition at line 79 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_ELECTRON, ParticleIDBase::IDENTIFY_KAON, ParticleIDBase::IDENTIFY_PION, and ParticleIDBase::IDENTIFY_PROTON.
00079 {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
void ParticleID::calculate | ( | ) | [virtual] |
Implements ParticleIDBase.
Definition at line 97 of file ParticleID.cxx.
00097 { 00098 #ifdef BEAN 00099 cout << " please use ParticleID::calculate(run) ! " << endl; 00100 exit(1); 00101 } 00102 00103 00104 void ParticleID::calculate(int run) 00105 { 00106 #endif 00107 int nhitcutpid=getNhitCut(); 00108 00109 #ifndef BEAN 00110 IDataProviderSvc* m_eventSvc; 00111 Gaudi::svcLocator()->service("EventDataSvc", m_eventSvc, true); 00112 00113 SmartDataPtr<Event::EventHeader> eventHeaderpid(m_eventSvc,"/Event/EventHeader"); 00114 int runpid=eventHeaderpid->runNumber(); 00115 int eventpid=eventHeaderpid->eventNumber(); 00116 // cout<<"runpid="<<runpid<<endl; 00117 // cout<<"eventpid="<<eventpid<<endl; 00118 #else 00119 int runpid=run; 00120 #endif 00121 00122 EvtRecTrack* recTrk = PidTrk(); 00123 // int runnum=getRunNo(); 00124 // cout<<"runnum="<<runnum<<endl; 00125 // if user did not specify sub sys, sepcify the default value 00126 if(m_pidsys == 0) { 00127 m_pidsys = useDedx() | useTof() | useTofE() | useEmc() | useMuc() | useTofQ() | useTofC() | useTofCorr(); 00128 } 00129 // if user did not set the seperate case, set the default value 00130 00131 if(m_pidcase == 0 ) { 00132 m_pidcase = all(); 00133 } 00134 //dedx sys 00135 if(IsDedxInfoUsed()) { 00136 if(!m_dedxpid) m_dedxpid = DedxPID::instance(); 00137 m_dedxpid->init(); 00138 m_dedxpid->setRunNo(runpid); 00139 m_dedxpid->setNhitCutDx(nhitcutpid); 00140 m_dedxpid->setRecTrack(recTrk); 00141 m_dedxpid->setChiMinCut(chiMinCut()); 00142 m_dedxpid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00143 m_dedxpid->calculate(); 00144 } 00145 00146 // tof1 and tof2 sys 00147 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed()) 00148 { 00149 if(IsTofCInfoUsed()) 00150 { 00151 if(!m_tofcpid) m_tofcpid = TofCPID::instance(); 00152 m_tofcpid->init(); 00153 m_tofcpid->setRunNo(runpid); 00154 m_tofcpid->setRecTrack(recTrk); 00155 m_tofcpid->setChiMinCut(chiMinCut()); 00156 m_tofcpid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00157 m_tofcpid->calculate(); 00158 } 00159 else 00160 { 00161 if(!m_tofpid) m_tofpid = TofPID::instance(); 00162 m_tofpid->init(); 00163 m_tofpid->setRecTrack(recTrk); 00164 m_tofpid->setChiMinCut(chiMinCut()); 00165 m_tofpid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00166 m_tofpid->calculate(); 00167 } 00168 00169 } 00170 00171 00172 // tof secondary correction sys 00173 if(IsTofCorrInfoUsed()) { 00174 if(!m_tofcorrpid) m_tofcorrpid = TofCorrPID::instance(); 00175 m_tofcorrpid->setRunNo(runpid); 00176 m_tofcorrpid->init(); 00177 m_tofcorrpid->setRecTrack(recTrk); 00178 m_tofcorrpid->setChiMinCut(chiMinCut()); 00179 m_tofcorrpid->setChiMaxCut(chiMaxCut()); 00180 m_tofcorrpid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00181 m_tofcorrpid->calculate(); 00182 } 00183 00184 /* 00185 // tof1 sys 00186 if(IsTof1InfoUsed()){ 00187 if(!m_tof1pid) m_tof1pid = Tof1PID::instance(); 00188 m_tof1pid->init(); 00189 m_tof1pid->setRecTrack(recTrk); 00190 m_tof1pid->setChiMinCut(4); 00191 m_tof1pid->setPdfMinSigmaCut(4); 00192 m_tof1pid->calculate(); 00193 } 00194 00195 // tof2 sys 00196 if(IsTof2InfoUsed()){ 00197 if(!m_tof2pid) m_tof2pid = Tof2PID::instance(); 00198 m_tof2pid->init(); 00199 m_tof2pid->setRecTrack(recTrk); 00200 m_tof2pid->setChiMinCut(4); 00201 m_tof2pid->setPdfMinSigmaCut(4); 00202 m_tof2pid->calculate(); 00203 } 00204 00205 */ 00206 // tofq sys 00207 if(IsTofQInfoUsed()) { 00208 if(!m_tofqpid) m_tofqpid = TofQPID::instance(); 00209 m_tofqpid->init(); 00210 m_tofqpid->setRecTrack(recTrk); 00211 m_tofqpid->setChiMinCut(chiMinCut()); 00212 m_tofqpid->calculate(); 00213 } 00214 00215 // endcap tof sys 00216 if(IsTofEInfoUsed()&&(!IsTofCorrInfoUsed())) { 00217 if(!m_tofepid) m_tofepid = TofEPID::instance(); 00218 m_tofepid->init(); 00219 m_tofepid->setRecTrack(recTrk); 00220 m_tofepid->setChiMinCut(chiMinCut()); 00221 m_tofepid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00222 m_tofepid->calculate(); 00223 } 00224 // emc sys 00225 if(IsEmcInfoUsed()) { 00226 if(!m_emcpid) m_emcpid = EmcPID::instance(); 00227 m_emcpid->init(); 00228 m_emcpid->setRecTrack(recTrk); 00229 m_emcpid->setChiMinCut(chiMinCut()); 00230 m_emcpid->calculate(); 00231 } 00232 00233 // muc sys 00234 if(IsMucInfoUsed()) { 00235 if(!m_mucpid) m_mucpid = MucPID::instance(); 00236 m_mucpid->init(); 00237 m_mucpid->setRecTrack(recTrk); 00238 m_mucpid->setChiMinCut(chiMinCut()); 00239 m_mucpid->calculate(); 00240 } 00241 // probability method 00242 if((m_method & methodProbability()) == methodProbability()) 00243 if(particleIDCalculation() < 0) m_ndof = 0; 00244 // std::cout<<"m_ndof="<<m_ndof<<std::endl; 00245 00246 //likelihood method 00247 if((m_method & methodLikelihood()) == methodLikelihood()) 00248 if(LikelihoodCalculation() < 0) m_discard =0; 00249 // neuron network 00250 if((m_method & methodNeuronNetwork()) == methodNeuronNetwork()) 00251 // m_neuronPid = neuronPIDCalculation(); 00252 if(LikelihoodCalculation() < 0) m_discard =0; 00253 00254 }
double ParticleIDBase::charge | ( | ) | [inherited] |
Definition at line 116 of file ParticleIDBase.cxx.
References DstMdcTrack::charge(), EvtRecTrack::isMdcTrackValid(), ParticleIDBase::m_trk, and EvtRecTrack::mdcTrack().
Referenced by TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and DedxPID::particleIDCalculation().
00116 { 00117 double val = 999; 00118 if(!m_trk) return val; 00119 if(!m_trk->isMdcTrackValid()) return val; 00120 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00121 val = mdcTrk->charge() + 0.0; 00122 return val; 00123 }
double ParticleID::chi | ( | int | n | ) | const [inline, virtual] |
Implements ParticleIDBase.
Definition at line 113 of file ParticleID.h.
References m_chisq.
00113 {return m_chisq[n];}
double ParticleID::chiCorr | ( | int | ipar, | |
int | ipmt | |||
) | [inline] |
Definition at line 165 of file ParticleID.h.
References TofCorrPID::chiCorr(), and m_tofcorrpid.
00165 { 00166 return m_tofcorrpid->chiCorr(ipar, ipmt); 00167 }
double ParticleID::chiDedx | ( | int | n | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
double ParticleID::chiEmc | ( | int | n | ) | const [inline] |
Referenced by particleIDCalculation().
double ParticleIDBase::chiMaxCut | ( | ) | const [inline, inherited] |
Definition at line 40 of file ParticleIDBase.h.
References ParticleIDBase::m_chimax_cut.
Referenced by TofCorrPID::correlationCheck(), TofCorrPID::particleIDCalculation(), and particleIDCalculation().
00040 {return m_chimax_cut;}
double ParticleIDBase::chiMinCut | ( | ) | const [inline, inherited] |
Definition at line 38 of file ParticleIDBase.h.
References ParticleIDBase::m_chimin_cut.
Referenced by TofCorrPID::correlationCheck(), TofPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), particleIDCalculation(), and DedxPID::particleIDCalculation().
00038 {return m_chimin_cut;}
double ParticleID::chiMuc | ( | int | n | ) | const [inline] |
Referenced by particleIDCalculation().
double ParticleID::chiTof | ( | int | n | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
double ParticleID::chiTof1 | ( | int | n | ) | const [inline] |
double ParticleID::chiTof2 | ( | int | n | ) | const [inline] |
double ParticleID::chiTofC | ( | int | n | ) | const [inline] |
Referenced by particleIDCalculation().
double ParticleID::chiTofCorr | ( | int | n | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
double ParticleID::chiTofE | ( | int | n | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
double ParticleID::chiTofQ | ( | int | n | ) | const [inline] |
Referenced by particleIDCalculation().
int ParticleIDBase::dedxValid | ( | ) | const [inline, inherited] |
Definition at line 91 of file ParticleIDBase.h.
References ParticleIDBase::DEDX_VALID.
00091 {return DEDX_VALID;}
int ParticleID::discard | ( | ) | const [inline] |
double ParticleID::dt | ( | int | ipar, | |
int | ipmt | |||
) | [inline] |
Definition at line 156 of file ParticleID.h.
References TofCorrPID::dt(), and m_tofcorrpid.
00156 { 00157 return m_tofcorrpid->dt(ipar, ipmt); 00158 }
double ParticleID::dtCorr | ( | int | ipar, | |
int | ipmt | |||
) | [inline] |
Definition at line 159 of file ParticleID.h.
References TofCorrPID::dtCorr(), and m_tofcorrpid.
00159 { 00160 return m_tofcorrpid->dtCorr(ipar, ipmt); 00161 }
int ParticleIDBase::emcValid | ( | ) | const [inline, inherited] |
Definition at line 97 of file ParticleIDBase.h.
References ParticleIDBase::EMC_VALID.
00097 {return EMC_VALID;}
int ParticleID::getNhitCut | ( | ) | const [inline] |
double ParticleIDBase::getRunNo | ( | ) | const [inline, inherited] |
Definition at line 44 of file ParticleIDBase.h.
References ParticleIDBase::m_runno.
Referenced by TofCPID::calculate(), DedxPID::CorrDedx(), TofCorrPID::init(), TofCPID::offsetTofC(), TofCorrPID::sigmaTof(), and TofCPID::sigmaTofC().
00044 {return m_runno;}
void ParticleID::identify | ( | const int | pidcase | ) | [inline] |
void ParticleID::init | ( | ) | [virtual] |
Implements ParticleIDBase.
Definition at line 27 of file ParticleID.cxx.
References genRecEmupikp::i, MucPID::init(), EmcPID::init(), TofPID::init(), DedxPID::init(), MucPID::instance(), EmcPID::instance(), TofCorrPID::instance(), TofPID::instance(), DedxPID::instance(), IsDedxInfoUsed(), IsEmcInfoUsed(), IsMucInfoUsed(), IsTof1InfoUsed(), IsTof2InfoUsed(), IsTofCorrInfoUsed(), IsTofInfoUsed(), m_chisq, m_dedxpid, m_discard, m_emcpid, m_method, m_mucpid, m_ndof, m_nhitcut, m_pidcase, m_pidsys, m_prob, m_tofcorrpid, m_tofpid, m_TotalLikelihood, ParticleIDBase::setChiMaxCut(), and ParticleIDBase::setChiMinCut().
00027 { 00028 00029 if(IsDedxInfoUsed()) { 00030 if(!m_dedxpid) m_dedxpid = DedxPID::instance(); 00031 m_dedxpid->init(); 00032 } 00033 00034 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()) { 00035 if(!m_tofpid) m_tofpid = TofPID::instance(); 00036 m_tofpid->init(); 00037 } 00038 00039 if(IsTofCorrInfoUsed()) { 00040 if(!m_tofcorrpid) m_tofcorrpid = TofCorrPID::instance(); 00041 // m_tofcorrpid->init(); 00042 } 00043 00044 if(IsEmcInfoUsed()) { 00045 if(!m_emcpid) m_emcpid = EmcPID::instance(); 00046 m_emcpid->init(); 00047 } 00048 00049 if(IsMucInfoUsed()) { 00050 if(!m_mucpid) m_mucpid = MucPID::instance(); 00051 m_mucpid->init(); 00052 } 00053 00054 // global info. 00055 m_pidsys = 0; 00056 m_pidcase = 0; 00057 m_method = 0; 00058 m_TotalLikelihood =0; 00059 m_discard =1; 00060 // probability 00061 m_ndof = 0; 00062 m_nhitcut=5; 00063 // chi cut 00064 setChiMinCut( 4.0 ); 00065 setChiMaxCut( 6.0 ); 00066 for(int i = 0; i < 4; i++) { 00067 m_chisq[i] = 9999.; 00068 m_prob[i] = -1.0; 00069 } 00070 }
ParticleID * ParticleID::instance | ( | ) | [static] |
Definition at line 22 of file ParticleID.cxx.
References m_pointer, and ParticleID().
Referenced by BeamParams::execute(), DQASelHadron::execute(), DQASelDimu::execute(), DQASelBhabha::execute(), DQARhopi::execute(), DQAKsKpi::execute(), DQAJpsi2PPbarAlg::execute(), inclphi::execute(), incllambda::execute(), inclkstar::execute(), inclks::execute(), Rhopi::execute(), Gam4pikp::execute(), LocalPionSelector::operator()(), and LocalKaonSelector::operator()().
00022 { 00023 if(!m_pointer) m_pointer = new ParticleID(); 00024 return m_pointer; 00025 }
double ParticleIDBase::interpolation | ( | double * | x, | |
double * | y, | |||
double | x1 | |||
) | [inherited] |
Definition at line 125 of file ParticleIDBase.cxx.
00125 { 00126 double c1 = (y[0]-y[1])*(x[1]-x[2])-(x[0]-x[1])*(y[1]-y[2]); 00127 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]); 00128 double c = c1/c2; 00129 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]); 00130 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]); 00131 double b = b1/b2; 00132 double a = y[0] - b*x[0]-c*x[0]*x[0]; 00133 double y1 = a + b*x1 +c*x1*x1; 00134 return y1; 00135 }
int ParticleID::ipmt | ( | ) | [inline] |
Definition at line 153 of file ParticleID.h.
References TofCorrPID::ipmt(), and m_tofcorrpid.
00153 { 00154 return m_tofcorrpid->ipmt(); 00155 }
bool ParticleID::IsDedxInfoUsed | ( | ) | const [inline, private] |
Definition at line 183 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useDedx().
Referenced by init(), LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsDedxInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsEmcInfoUsed | ( | ) | const [inline, private] |
Definition at line 191 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useEmc().
Referenced by init(), LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsEmcInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsMucInfoUsed | ( | ) | const [inline, private] |
Definition at line 192 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useMuc().
Referenced by init(), LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsMucInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsPidInfoValid | ( | ) | const [inline, virtual] |
bool ParticleID::IsTof1InfoUsed | ( | ) | const [inline, private] |
Definition at line 185 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useTof1().
Referenced by init(), LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTof2InfoUsed | ( | ) | const [inline, private] |
Definition at line 186 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useTof2().
Referenced by init(), LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofCInfoUsed | ( | ) | const [inline, private] |
Definition at line 189 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useTofC().
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofCInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofCorrInfoUsed | ( | ) | const [inline, private] |
Definition at line 190 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useTofCorr().
Referenced by init(), LikelihoodCalculation(), and particleIDCalculation().
00190 {return ((m_pidsys & useTofCorr()) == useTofCorr());}
bool ParticleID::IsTofCorrInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofEInfoUsed | ( | ) | const [inline, private] |
Definition at line 187 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useTofE().
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofEInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofInfoUsed | ( | ) | const [inline, private] |
Definition at line 184 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useTof().
Referenced by init(), LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
bool ParticleID::IsTofQInfoUsed | ( | ) | const [inline, private] |
Definition at line 188 of file ParticleID.h.
References m_pidsys, and ParticleIDBase::useTofQ().
Referenced by particleIDCalculation().
bool ParticleID::IsTofQInfoValid | ( | ) | const [inline] |
Referenced by LikelihoodCalculation(), and particleIDCalculation().
double ParticleID::lhf | ( | int | n | ) | const [inline] |
Definition at line 119 of file ParticleID.h.
References m_likelihoodfraction.
Referenced by neuronVal().
00119 {return m_likelihoodfraction[n];}
int ParticleID::LikelihoodCalculation | ( | ) | [protected, virtual] |
Implements ParticleIDBase.
Definition at line 432 of file ParticleID.cxx.
References chiDedx(), chiTof(), chiTofCorr(), chiTofE(), genRecEmupikp::i, IsDedxInfoUsed(), IsDedxInfoValid(), IsEmcInfoUsed(), IsEmcInfoValid(), IsMucInfoUsed(), IsMucInfoValid(), IsTof1InfoUsed(), IsTof2InfoUsed(), IsTofCInfoUsed(), IsTofCInfoValid(), IsTofCorrInfoUsed(), IsTofCorrInfoValid(), IsTofEInfoUsed(), IsTofEInfoValid(), IsTofInfoUsed(), IsTofInfoValid(), IsTofQInfoValid(), m_dedxpid, m_likelihoodfraction, m_ndof, m_pdf, m_pidcase, m_tofcorrpid, m_tofcpid, m_tofepid, m_tofpid, m_TotalLikelihood, ParticleIDBase::onlyElectron(), ParticleIDBase::onlyKaon(), ParticleIDBase::onlyMuon(), ParticleIDBase::onlyPion(), ParticleIDBase::onlyProton(), pdf(), ParticleIDBase::pdfCalculate(), pdfDedx(), pdfEmc(), ParticleIDBase::pdfMinSigmaCut(), pdfMuc(), pdfTof(), pdfTofC(), pdfTofCorr(), and pdfTofQ().
00432 { 00433 int irc = -1; 00434 00435 bool valid = IsDedxInfoValid() || IsTofInfoValid() || IsTofEInfoValid() || IsTofQInfoValid() || IsTofCInfoValid() || IsTofCorrInfoValid() || IsEmcInfoValid()||IsMucInfoValid(); 00436 if(!valid) return irc; 00437 double pdf[5]; 00438 bool pidcase[5]; 00439 for(int i = 0; i < 5; i++) { 00440 pdf[i] = 1; 00441 pidcase[i] = false; 00442 } 00443 00444 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] = true; 00445 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] = true; 00446 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] = true; 00447 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] = true; 00448 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] = true; 00449 00450 for(int i = 0; i < 5; i++) { 00451 if(pidcase[i]==0) 00452 pdf[i]=0; 00453 } 00454 00455 // 00456 // dEdx PID 00457 // 00458 if(IsDedxInfoUsed()) { 00459 if(IsDedxInfoValid()) { 00460 bool okpid = false; 00461 for(int i = 0; i < 5; i++) { 00462 if(pidcase[i] && pdfCalculate(chiDedx(i),1) > pdfCalculate(m_dedxpid->pdfMinSigmaCut(),1.5)) 00463 if(!okpid) okpid = true; 00464 } 00465 if(okpid) { 00466 m_ndof++; 00467 for(int i = 0; i < 5; i++) { 00468 pdf[i] *= pdfDedx(i); 00469 } 00470 } 00471 } // dE/dx 00472 } 00473 00474 00475 // 00476 // Barrel TOF 00477 // 00478 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed()) 00479 { if(IsTofCInfoUsed()) 00480 { 00481 00482 if(IsTofCInfoValid()) { 00483 bool okpid = false; 00484 for(int i = 0; i < 5; i++) { 00485 if(pidcase[i] && pdfCalculate(chiTof(i),1) > pdfCalculate(m_tofcpid->pdfMinSigmaCut(),1.5)) 00486 if(!okpid) okpid = true; 00487 } 00488 if(okpid) { 00489 m_ndof++; 00490 for(int i = 0; i < 5; i++) { 00491 pdf[i] *= pdfTofC(i); 00492 } 00493 } 00494 } // TOF 00495 } 00496 00497 else { 00498 if(IsTofInfoValid()) { 00499 bool okpid = false; 00500 for(int i = 0; i < 5; i++) { 00501 if(pidcase[i] && pdfCalculate(chiTof(i),1) > pdfCalculate(m_tofpid->pdfMinSigmaCut(),1.5)) 00502 if(!okpid) okpid = true; 00503 } 00504 if(okpid) { 00505 m_ndof++; 00506 for(int i = 0; i < 5; i++) { 00507 pdf[i] *= pdfTof(i); 00508 } 00509 } 00510 } // TOF 00511 00512 00513 00514 // 00515 // EndCap Tof 00516 // 00517 00518 if(IsTofEInfoUsed()) { 00519 if(IsTofEInfoValid()) { 00520 bool okpid = false; 00521 for(int i = 0; i < 5; i++) { 00522 if(pidcase[i]&& pdfCalculate(chiTofE(i),1) > pdfCalculate(m_tofepid->pdfMinSigmaCut(),1.5)) 00523 if(!okpid) okpid = true; 00524 } 00525 if(okpid) { 00526 // m_ndof++; 00527 // for(int i = 0; i < 5; i++) pdf[i] *= pdfTofE(i); 00528 } 00529 } // EndCap TOF 00530 } 00531 } 00532 00533 } 00534 00535 // Secondary TOF correction 00536 if(IsTofCorrInfoUsed()) { 00537 if(IsTofCorrInfoValid()) { 00538 bool okpid = false; 00539 for(int i = 0; i < 5; i++) { 00540 if(pidcase[i] && pdfCalculate(chiTofCorr(i),1) > pdfCalculate(m_tofcorrpid->pdfMinSigmaCut(),1.5)) 00541 if(!okpid) okpid = true; 00542 } 00543 if(okpid) { 00544 m_ndof++; 00545 for(int i = 0; i < 5; i++) { 00546 pdf[i] *= pdfTofCorr(i); 00547 } 00548 } 00549 } 00550 } 00551 00552 00553 // 00554 // Barrel TOF Q 00555 // 00556 00557 if(IsTofQInfoValid()) { 00558 bool okpid = false; 00559 for(int i = 0; i < 5; i++) { 00560 if(pidcase[i]) 00561 if(!okpid) okpid = true; 00562 } 00563 if(okpid) { 00564 // m_ndof++; 00565 for(int i = 0; i < 5; i++) pdf[i] *= pdfTofQ(i); 00566 } 00567 } // TofQ 00568 00569 // 00570 // Emc PID 00571 // 00572 if(IsEmcInfoUsed()) { 00573 if(IsEmcInfoValid()) { 00574 bool okpid = false; 00575 for(int i = 0; i < 5; i++) { 00576 if(pidcase[i]&&pdfEmc(i)>0) 00577 if(!okpid) okpid = true; 00578 } 00579 if(okpid) { 00580 m_ndof++; 00581 for(int i = 0; i < 5; i++) { 00582 pdf[i] *= pdfEmc(i); 00583 } 00584 } // Emc Pid 00585 } 00586 } 00587 if(IsMucInfoUsed()) { 00588 if(IsMucInfoValid()) { 00589 bool okpid = false; 00590 for(int i = 0; i < 5; i++) { 00591 if(pidcase[i]&&pdfMuc(i)>0) 00592 if(!okpid) okpid = true; 00593 } 00594 if(okpid) { 00595 m_ndof++; 00596 for(int i = 0; i < 5; i++) { 00597 pdf[i] *= pdfMuc(i); 00598 } 00599 } 00600 } // Emc Pid 00601 } 00602 00603 00604 00605 if(m_ndof <= 0) return irc; 00606 for(int i = 0; i < 5; i++) { 00607 m_pdf[i] = pdf[i]; 00608 m_TotalLikelihood += pdf[i]; 00609 } 00610 for(int i = 0; i < 5; i++) { 00611 m_likelihoodfraction[i] = pdf[i]/m_TotalLikelihood; 00612 } 00613 00614 00615 irc = 0; 00616 return irc; 00617 }
int ParticleIDBase::methodLikelihood | ( | ) | const [inline, inherited] |
Definition at line 87 of file ParticleIDBase.h.
References ParticleIDBase::LIKELIHOOD_PID.
00087 {return LIKELIHOOD_PID;}
int ParticleIDBase::methodNeuronNetwork | ( | ) | const [inline, inherited] |
Definition at line 89 of file ParticleIDBase.h.
References ParticleIDBase::NEURONNETWORK_PID.
00089 {return NEURONNETWORK_PID;}
int ParticleIDBase::methodProbability | ( | ) | const [inline, inherited] |
Definition at line 88 of file ParticleIDBase.h.
References ParticleIDBase::PROBABILITY_PID.
00088 {return PROBABILITY_PID;}
int ParticleIDBase::mucValid | ( | ) | const [inline, inherited] |
Definition at line 98 of file ParticleIDBase.h.
References ParticleIDBase::MUC_VALID.
00098 {return MUC_VALID;}
int ParticleID::ndof | ( | ) | const [inline, virtual] |
Implements ParticleIDBase.
Definition at line 115 of file ParticleID.h.
References m_ndof.
00115 {return m_ndof;}
int ParticleID::neuronPIDCalculation | ( | ) | [protected] |
int ParticleID::neuronStat | ( | ) | const [inline] |
Definition at line 144 of file ParticleID.h.
References IsPidInfoValid().
00144 {return IsPidInfoValid();}
double ParticleID::neuronVal | ( | ) | const [inline] |
double ParticleID::offset | ( | int | ipar | ) | [inline] |
Definition at line 168 of file ParticleID.h.
References m_tofcorrpid, and TofCorrPID::offset().
00168 { 00169 return m_tofcorrpid->offset(ipar); 00170 }
int ParticleIDBase::onlyElectron | ( | ) | const [inline, inherited] |
Definition at line 80 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_ELECTRON.
Referenced by LikelihoodCalculation(), and particleIDCalculation().
00080 {return IDENTIFY_ELECTRON;}
int ParticleIDBase::onlyKaon | ( | ) | const [inline, inherited] |
Definition at line 83 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_KAON.
Referenced by LikelihoodCalculation(), and particleIDCalculation().
00083 {return IDENTIFY_KAON;}
int ParticleIDBase::onlyMuon | ( | ) | const [inline, inherited] |
Definition at line 81 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_MUON.
Referenced by LikelihoodCalculation(), and particleIDCalculation().
00081 {return IDENTIFY_MUON;}
int ParticleIDBase::onlyPion | ( | ) | const [inline, inherited] |
Definition at line 82 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_PION.
Referenced by LikelihoodCalculation(), and particleIDCalculation().
00082 {return IDENTIFY_PION;}
int ParticleIDBase::onlyPionKaon | ( | ) | const [inline, inherited] |
Definition at line 76 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_KAON, and ParticleIDBase::IDENTIFY_PION.
00076 {return (IDENTIFY_PION | IDENTIFY_KAON);}
int ParticleIDBase::onlyPionKaonElectron | ( | ) | const [inline, inherited] |
Definition at line 78 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_ELECTRON, ParticleIDBase::IDENTIFY_KAON, and ParticleIDBase::IDENTIFY_PION.
00078 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}
int ParticleIDBase::onlyPionKaonProton | ( | ) | const [inline, inherited] |
Definition at line 77 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_KAON, ParticleIDBase::IDENTIFY_PION, and ParticleIDBase::IDENTIFY_PROTON.
00077 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
int ParticleIDBase::onlyProton | ( | ) | const [inline, inherited] |
Definition at line 84 of file ParticleIDBase.h.
References ParticleIDBase::IDENTIFY_PROTON.
Referenced by LikelihoodCalculation(), and particleIDCalculation().
00084 {return IDENTIFY_PROTON;}
double ParticleIDBase::p | ( | ) | [inherited] |
Definition at line 100 of file ParticleIDBase.cxx.
References EvtRecTrack::isMdcTrackValid(), ParticleIDBase::m_trk, EvtRecTrack::mdcTrack(), and DstMdcTrack::p().
Referenced by DedxPID::cal_par(), TofCorrPID::particleIDCalculation(), and ParticleIDBase::probCalculate().
00100 { 00101 double val = 999; 00102 if(!m_trk) return val; 00103 if(!m_trk->isMdcTrackValid()) return val; 00104 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00105 val = mdcTrk->p(); 00106 return val; 00107 }
int ParticleID::particleIDCalculation | ( | ) | [protected, virtual] |
Implements ParticleIDBase.
Definition at line 256 of file ParticleID.cxx.
References chiDedx(), chiEmc(), ParticleIDBase::chiMaxCut(), ParticleIDBase::chiMinCut(), chiMuc(), chiTof(), chiTofC(), chiTofCorr(), chiTofE(), chiTofQ(), genRecEmupikp::i, IsDedxInfoUsed(), IsDedxInfoValid(), IsEmcInfoUsed(), IsEmcInfoValid(), IsMucInfoUsed(), IsMucInfoValid(), IsTof1InfoUsed(), IsTof2InfoUsed(), IsTofCInfoUsed(), IsTofCInfoValid(), IsTofCorrInfoUsed(), IsTofCorrInfoValid(), IsTofEInfoUsed(), IsTofEInfoValid(), IsTofInfoUsed(), IsTofInfoValid(), IsTofQInfoUsed(), IsTofQInfoValid(), m_chisq, m_dedxpid, m_emcpid, m_mucpid, m_ndof, m_pidcase, m_prob, m_tofcorrpid, m_tofcpid, m_tofepid, m_tofpid, m_tofqpid, ParticleIDBase::onlyElectron(), ParticleIDBase::onlyKaon(), ParticleIDBase::onlyMuon(), ParticleIDBase::onlyPion(), ParticleIDBase::onlyProton(), and ParticleIDBase::probCalculate().
00256 { 00257 int irc = -1; 00258 bool valid = IsDedxInfoValid() || IsTofInfoValid()||IsTofEInfoValid() 00259 || IsTofQInfoValid() || IsEmcInfoValid() || IsMucInfoValid() 00260 || IsTofCInfoValid() || IsTofCorrInfoValid(); 00261 00262 if(!valid) return irc; 00263 00264 double chisq[5]; 00265 bool pidcase[5]; 00266 for(int i = 0; i < 5; i++) { 00267 chisq[i] = 0; 00268 pidcase[i] = false; 00269 } 00270 00271 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] = true; 00272 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] = true; 00273 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] = true; 00274 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] = true; 00275 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] = true; 00276 00277 // 00278 // dEdx PID 00279 // 00280 if(IsDedxInfoUsed()) { 00281 if(IsDedxInfoValid()) { 00282 bool okpid = false; 00283 for(int i = 0; i < 5; i++) { 00284 if(pidcase[i] && (fabs(chiDedx(i)) < m_dedxpid->chiMinCut())) 00285 if(!okpid) okpid = true; 00286 } 00287 if(okpid) { 00288 m_ndof++; 00289 for(int i = 0; i < 5; i++) chisq[i] += chiDedx(i)*chiDedx(i); 00290 00291 00292 } 00293 } // dE/dx 00294 } 00295 // 00296 // Barrel TOF 00297 // 00298 00299 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed() | IsTofCInfoUsed()) 00300 { if(IsTofCInfoUsed()) 00301 { 00302 if(IsTofCInfoValid()) { 00303 bool okpid = false; 00304 for(int i = 0; i < 5; i++) { 00305 if(pidcase[i] && (fabs(chiTofC(i)) < m_tofcpid->chiMinCut())) 00306 if(!okpid) okpid = true; 00307 } 00308 if(okpid) { 00309 m_ndof++; 00310 for(int i = 0; i < 5; i++) chisq[i] += chiTofC(i)*chiTofC(i); 00311 } 00312 } // TOF1 00313 } 00314 else { 00315 if(IsTofInfoValid()) { 00316 bool okpid = false; 00317 for(int i = 0; i < 5; i++) { 00318 if(pidcase[i] && (fabs(chiTof(i)) < m_tofpid->chiMinCut())) 00319 if(!okpid) okpid = true; 00320 } 00321 if(okpid) { 00322 m_ndof++; 00323 for(int i = 0; i < 5; i++) chisq[i] += chiTof(i)*chiTof(i); 00324 } 00325 } // TOF1 00326 00327 00328 // 00329 // EndCap Tof 00330 // 00331 00332 if(IsTofEInfoUsed()) { 00333 if(IsTofEInfoValid()) { 00334 bool okpid = false; 00335 for(int i = 0; i < 5; i++) { 00336 if(pidcase[i] && (fabs(chiTofE(i)) < m_tofepid->chiMinCut())) 00337 if(!okpid) okpid = true; 00338 } 00339 if(okpid) { 00340 m_ndof++; 00341 for(int i = 0; i < 5; i++) chisq[i] += chiTofE(i)*chiTofE(i); 00342 } 00343 } // EndCap TOF 00344 } 00345 00346 } 00347 } 00348 00349 // Secondary TOF correction 00350 if(IsTofCorrInfoUsed()) { 00351 if(IsTofCorrInfoValid()) { 00352 bool okpid = false; 00353 for(int i = 0; i < 5; i++) { 00354 if(pidcase[i] && ( chiTofCorr(i) < m_tofcorrpid->chiMaxCut() ) && ( chiTofCorr(i) > ( 0.0 - m_tofcorrpid->chiMinCut() ) ) ) 00355 // if(pidcase[i] && ( chiTofCorr(i) < 6.0 && chiTofCorr(i) > -4.0 ) ) 00356 if(!okpid) okpid = true; 00357 } 00358 if(okpid) { 00359 m_ndof++; 00360 for(int i = 0; i < 5; i++) chisq[i] += chiTofCorr(i)*chiTofCorr(i); 00361 } 00362 } 00363 } 00364 00365 // 00366 // Barrel TOF Q 00367 // 00368 00369 if(IsTofQInfoUsed()) { 00370 if(IsTofQInfoValid()) { 00371 bool okpid = false; 00372 for(int i = 0; i < 5; i++) { 00373 if(pidcase[i] && (fabs(chiTofQ(i)) < m_tofqpid->chiMinCut())) 00374 if(!okpid) okpid = true; 00375 } 00376 if(okpid) { 00377 m_ndof++; 00378 for(int i = 0; i < 5; i++) chisq[i] += chiTofQ(i)*chiTofQ(i); 00379 } 00380 } // TofQ 00381 } 00382 00383 // Muc Pid 00384 if(IsMucInfoUsed()) { 00385 if(IsMucInfoValid()) { 00386 bool okpid = false; 00387 for(int i = 0; i < 5; i++) { 00388 if(pidcase[i] && (fabs(chiMuc(i)) < m_mucpid->chiMinCut())) 00389 if(!okpid) okpid = true; 00390 } 00391 if(okpid) { 00392 m_ndof++; 00393 for(int i = 0; i < 5; i++) chisq[i] += chiMuc(i)*chiMuc(i); 00394 } 00395 } // Muc Pid 00396 } 00397 00398 00399 // Emc PID 00400 if(IsEmcInfoUsed()) { 00401 if(IsEmcInfoValid()) { 00402 bool okpid = false; 00403 for(int i = 0; i < 5; i++) { 00404 if(pidcase[i] && (fabs(chiEmc(i)) < m_emcpid->chiMinCut())) 00405 if(!okpid) okpid = true; 00406 } 00407 if(okpid) { 00408 m_ndof++; 00409 for(int i = 0; i < 5; i++) chisq[i] += chiEmc(i)*chiEmc(i); 00410 } 00411 } // Emc Pid 00412 } 00413 00414 00415 if(m_ndof <= 0) return irc; 00416 00417 00418 for(int i = 0; i < 5; i++) { 00419 m_chisq[i] = chisq[i]; 00420 m_prob[i] = probCalculate(chisq[i], m_ndof); 00421 } 00422 00423 00424 irc = 0; 00425 return irc; 00426 }
double ParticleID::pdf | ( | int | n | ) | const [inline] |
Definition at line 118 of file ParticleID.h.
References m_pdf.
Referenced by LikelihoodCalculation().
00118 { return m_pdf[n];}
double ParticleIDBase::pdfCalculate | ( | double | offset, | |
double | sigma | |||
) | [inherited] |
Definition at line 91 of file ParticleIDBase.cxx.
References exp(), M_PI, pi, and twoPi.
Referenced by TofCorrPID::correlationCheck(), LikelihoodCalculation(), TofPID::particleIDCalculation(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and DedxPID::particleIDCalculation().
00091 { 00092 // const double pi = 3.141592653589793238; 00093 const double pi = M_PI; 00094 const double twoPi = 2*pi; 00095 double chi2 = -0.5*offset*offset/(sigma*sigma); 00096 double pdf = exp(chi2)/(sigma*sqrt(twoPi)); 00097 return pdf; 00098 }
double ParticleID::pdfDedx | ( | int | n | ) | [inline] |
Referenced by LikelihoodCalculation().
double ParticleID::pdfElectron | ( | ) | const [inline] |
double ParticleID::pdfEmc | ( | int | n | ) | [inline] |
Referenced by LikelihoodCalculation().
double ParticleID::pdfKaon | ( | ) | const [inline] |
double ParticleIDBase::pdfMinSigmaCut | ( | ) | const [inline, inherited] |
Definition at line 42 of file ParticleIDBase.h.
References ParticleIDBase::m_pdfsigmamin_cut.
Referenced by TofCorrPID::correlationCheck(), LikelihoodCalculation(), TofPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and DedxPID::particleIDCalculation().
00042 {return m_pdfsigmamin_cut;}
double ParticleID::pdfMuc | ( | int | n | ) | [inline] |
Referenced by LikelihoodCalculation().
double ParticleID::pdfMuon | ( | ) | const [inline] |
double ParticleID::pdfPion | ( | ) | const [inline] |
double ParticleID::pdfProton | ( | ) | const [inline] |
double ParticleID::pdfTof | ( | int | n | ) | [inline] |
Referenced by LikelihoodCalculation().
double ParticleID::pdfTofC | ( | int | n | ) | [inline] |
Referenced by LikelihoodCalculation().
double ParticleID::pdfTofCorr | ( | int | n | ) | [inline] |
Referenced by LikelihoodCalculation().
double ParticleID::pdfTofE | ( | int | n | ) | [inline] |
double ParticleID::pdfTofQ | ( | int | n | ) | [inline] |
Referenced by LikelihoodCalculation().
EvtRecTrack* ParticleIDBase::PidTrk | ( | ) | const [inline, inherited] |
Definition at line 36 of file ParticleIDBase.h.
References ParticleIDBase::m_trk.
Referenced by TofQPID::particleIDCalculation(), TofPID::particleIDCalculation(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), MucPID::particleIDCalculation(), EmcPID::particleIDCalculation(), and DedxPID::particleIDCalculation().
00036 {return m_trk;}
double ParticleIDBase::pol2 | ( | double | x, | |
double * | par | |||
) | [inherited] |
Definition at line 137 of file ParticleIDBase.cxx.
00137 { 00138 double y=x; 00139 // return par[0] + (par[1] * y) +(par[2] * y * y); 00140 return par[0] + y*(par[1] + y*(par[2])); 00141 }
double ParticleIDBase::pol3 | ( | double | x, | |
double * | par | |||
) | [inherited] |
Definition at line 143 of file ParticleIDBase.cxx.
00143 { 00144 double y=x; 00145 // return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y); 00146 return par[0] + y*(par[1] + y*(par[2] + y*(par[3]))); 00147 }
double ParticleIDBase::pol4 | ( | double | x, | |
double * | par | |||
) | [inherited] |
Definition at line 149 of file ParticleIDBase.cxx.
00149 { 00150 double y=x; 00151 // return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y) + (par[4] * y * y*y*y); 00152 return par[0] + y*(par[1] + y*(par[2] + y*(par[3] + y*(par[4])))); 00153 }
double ParticleID::prob | ( | int | n | ) | const [inline, virtual] |
Implements ParticleIDBase.
Definition at line 114 of file ParticleID.h.
References m_prob.
00114 { return m_prob[n];}
double ParticleIDBase::probCalculate | ( | double | chi2, | |
int | n | |||
) | [inherited] |
Definition at line 83 of file ParticleIDBase.cxx.
References ParticleIDBase::p().
Referenced by TofPID::particleIDCalculation(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), TofCorrPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), particleIDCalculation(), and DedxPID::particleIDCalculation().
00083 { 00084 double p = -1.0; 00085 if(chi2 < 0) return p; 00086 p = TMath::Prob(chi2, ndof); 00087 return p; 00088 }
double ParticleID::probDedx | ( | int | n | ) | const [inline] |
double ParticleID::probElectron | ( | ) | const [inline] |
double ParticleID::probEmc | ( | int | n | ) | const [inline] |
double ParticleID::probKaon | ( | ) | const [inline] |
double ParticleID::probMuc | ( | int | n | ) | const [inline] |
double ParticleID::probMuon | ( | ) | const [inline] |
double ParticleID::probPion | ( | ) | const [inline] |
double ParticleID::probProton | ( | ) | const [inline] |
double ParticleID::probTof | ( | int | n | ) | const [inline] |
double ParticleID::probTofC | ( | int | n | ) | const [inline] |
double ParticleID::probTofCorr | ( | int | n | ) | const [inline] |
double ParticleID::probTofE | ( | int | n | ) | const [inline] |
double ParticleID::probTofQ | ( | int | n | ) | const [inline] |
double ParticleIDBase::pt | ( | ) | [inherited] |
Definition at line 108 of file ParticleIDBase.cxx.
References EvtRecTrack::isMdcTrackValid(), ParticleIDBase::m_trk, EvtRecTrack::mdcTrack(), and DstMdcTrack::pxy().
00108 { 00109 double val = 999; 00110 if(!m_trk) return val; 00111 if(!m_trk->isMdcTrackValid()) return val; 00112 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00113 val = mdcTrk->pxy(); 00114 return val; 00115 }
void ParticleIDBase::set_path | ( | std::string | s_path | ) | [inline, inherited] |
Definition at line 105 of file ParticleIDBase.h.
References ParticleIDBase::path.
00105 {path = s_path;}
void ParticleIDBase::set_path | ( | const char * | s_path = 0 |
) | [inherited] |
Definition at line 55 of file ParticleIDBase.cxx.
References ParticleIDBase::path, and deljobs::string.
Referenced by ParticleIDBase::ParticleIDBase().
00056 { 00057 if ( s_path ) { 00058 path = string(s_path); 00059 } else { 00060 char* env_path = getenv("PARTICLEIDROOT"); 00061 if ( !env_path ) { 00062 cout << " ParticleIDBase::set_path ERROR:" 00063 " the environment PARTICLEIDROOT not defined " << endl; 00064 exit(1); 00065 } 00066 path = string(env_path); 00067 } 00068 }
void ParticleIDBase::setChiMaxCut | ( | const double | chi = 6 |
) | [inline, inherited] |
Definition at line 41 of file ParticleIDBase.h.
References ParticleIDBase::chi(), and ParticleIDBase::m_chimax_cut.
Referenced by init().
00041 {m_chimax_cut = chi;}
void ParticleIDBase::setChiMinCut | ( | const double | chi = 4 |
) | [inline, inherited] |
Definition at line 39 of file ParticleIDBase.h.
References ParticleIDBase::chi(), and ParticleIDBase::m_chimin_cut.
Referenced by init(), and TofPID::particleIDCalculation().
00039 {m_chimin_cut = chi;}
void ParticleID::setMethod | ( | const int | method | ) | [inline] |
void ParticleID::setNhitCut | ( | const int | nhitcuth = 5 |
) | [inline] |
void ParticleIDBase::setPdfMinSigmaCut | ( | const double | pdf = 4 |
) | [inline, inherited] |
Definition at line 43 of file ParticleIDBase.h.
References ParticleIDBase::m_pdfsigmamin_cut.
Referenced by TofPID::particleIDCalculation().
00043 {m_pdfsigmamin_cut= pdf;}
void ParticleIDBase::setRecTrack | ( | EvtRecTrack * | trk | ) | [inline, inherited] |
Definition at line 37 of file ParticleIDBase.h.
References ParticleIDBase::m_trk.
Referenced by TofPID::particleIDCalculation().
00037 {m_trk = trk;}
void ParticleIDBase::setRunNo | ( | const double | runh = 8093 |
) | [inline, inherited] |
Definition at line 45 of file ParticleIDBase.h.
References ParticleIDBase::m_runno.
00045 {m_runno = runh;}
double ParticleID::sigCorr | ( | int | ipar, | |
int | ipmt | |||
) | [inline] |
Definition at line 162 of file ParticleID.h.
References m_tofcorrpid, and TofCorrPID::sigCorr().
00162 { 00163 return m_tofcorrpid->sigCorr(ipar, ipmt); 00164 }
double ParticleID::sigma | ( | int | ipar | ) | [inline] |
Definition at line 171 of file ParticleID.h.
References m_tofcorrpid, and TofCorrPID::sigma().
00171 { 00172 return m_tofcorrpid->sigma(ipar); 00173 }
int ParticleIDBase::tofcorrValid | ( | ) | const [inline, inherited] |
Definition at line 96 of file ParticleIDBase.h.
References ParticleIDBase::TOFCorr_VALID.
00096 {return TOFCorr_VALID;}
int ParticleIDBase::tofcValid | ( | ) | const [inline, inherited] |
Definition at line 95 of file ParticleIDBase.h.
References ParticleIDBase::TOFC_VALID.
00095 {return TOFC_VALID;}
int ParticleIDBase::tofeValid | ( | ) | const [inline, inherited] |
Definition at line 93 of file ParticleIDBase.h.
References ParticleIDBase::TOFE_VALID.
00093 {return TOFE_VALID;}
int ParticleIDBase::tofqValid | ( | ) | const [inline, inherited] |
Definition at line 94 of file ParticleIDBase.h.
References ParticleIDBase::TOFQ_VALID.
00094 {return TOFQ_VALID;}
int ParticleIDBase::tofValid | ( | ) | const [inline, inherited] |
Definition at line 92 of file ParticleIDBase.h.
References ParticleIDBase::TOF_VALID.
00092 {return TOF_VALID;}
int ParticleIDBase::useDedx | ( | ) | const [inline, inherited] |
Definition at line 64 of file ParticleIDBase.h.
References ParticleIDBase::USE_DEDX.
Referenced by IsDedxInfoUsed().
00064 {return USE_DEDX;}
int ParticleIDBase::useEmc | ( | ) | const [inline, inherited] |
Definition at line 72 of file ParticleIDBase.h.
References ParticleIDBase::USE_EMC.
Referenced by IsEmcInfoUsed().
00072 {return USE_EMC;}
int ParticleIDBase::useMuc | ( | ) | const [inline, inherited] |
Definition at line 73 of file ParticleIDBase.h.
References ParticleIDBase::USE_MUC.
Referenced by IsMucInfoUsed().
00073 {return USE_MUC;}
void ParticleID::usePidSys | ( | const int | pidsys | ) | [inline] |
int ParticleIDBase::useTof | ( | ) | const [inline, inherited] |
Definition at line 65 of file ParticleIDBase.h.
References ParticleIDBase::USE_TOF.
Referenced by IsTofInfoUsed().
00065 {return USE_TOF;}
int ParticleIDBase::useTof1 | ( | ) | const [inline, inherited] |
Definition at line 66 of file ParticleIDBase.h.
References ParticleIDBase::USE_TOF1.
Referenced by IsTof1InfoUsed().
00066 {return USE_TOF1;}
int ParticleIDBase::useTof2 | ( | ) | const [inline, inherited] |
Definition at line 67 of file ParticleIDBase.h.
References ParticleIDBase::USE_TOF2.
Referenced by IsTof2InfoUsed().
00067 {return USE_TOF2;}
int ParticleIDBase::useTofC | ( | ) | const [inline, inherited] |
Definition at line 70 of file ParticleIDBase.h.
References ParticleIDBase::USE_TOFC.
Referenced by IsTofCInfoUsed().
00070 {return USE_TOFC;}
int ParticleIDBase::useTofCorr | ( | ) | const [inline, inherited] |
Definition at line 71 of file ParticleIDBase.h.
References ParticleIDBase::USE_TOFCorr.
Referenced by IsTofCorrInfoUsed().
00071 {return USE_TOFCorr;}
int ParticleIDBase::useTofE | ( | ) | const [inline, inherited] |
Definition at line 68 of file ParticleIDBase.h.
References ParticleIDBase::USE_TOFE.
Referenced by IsTofEInfoUsed().
00068 {return USE_TOFE;}
int ParticleIDBase::useTofQ | ( | ) | const [inline, inherited] |
Definition at line 69 of file ParticleIDBase.h.
References ParticleIDBase::USE_TOFQ.
Referenced by IsTofQInfoUsed().
00069 {return USE_TOFQ;}
double ParticleIDBase::velc | ( | ) | [inherited] |
Definition at line 77 of file ParticleIDBase.cxx.
Referenced by TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), and Tof1PID::particleIDCalculation().
00077 { 00078 // double vel = 29.9792458; // tof_path unit in cm. 00079 double vel = 299.792458; // tof path unit in mm 00080 return vel; 00081 }
double ParticleIDBase::xmass | ( | int | n | ) | [inherited] |
Definition at line 71 of file ParticleIDBase.cxx.
References mass.
Referenced by TofCorrPID::offsetTof(), TofCorrPID::particleIDCalculation(), and TofCorrPID::sigmaTof().
00071 { 00072 double mass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272}; 00073 if(n < 0 || n >=5) return 0.0; 00074 return mass[n]; 00075 }
double ParticleID::m_chicut [private] |
Definition at line 212 of file ParticleID.h.
double ParticleID::m_chisq[5] [private] |
Definition at line 204 of file ParticleID.h.
Referenced by chi(), init(), and particleIDCalculation().
DedxPID* ParticleID::m_dedxpid [private] |
Definition at line 196 of file ParticleID.h.
Referenced by init(), LikelihoodCalculation(), ParticleID(), and particleIDCalculation().
int ParticleID::m_discard [private] |
EmcPID* ParticleID::m_emcpid [private] |
Definition at line 202 of file ParticleID.h.
Referenced by init(), ParticleID(), and particleIDCalculation().
double ParticleID::m_likelihoodfraction[5] [private] |
int ParticleID::m_method [private] |
MucPID* ParticleID::m_mucpid [private] |
Definition at line 203 of file ParticleID.h.
Referenced by init(), ParticleID(), and particleIDCalculation().
int ParticleID::m_ndof [private] |
Definition at line 213 of file ParticleID.h.
Referenced by init(), LikelihoodCalculation(), ndof(), and particleIDCalculation().
int ParticleID::m_nhitcut [private] |
double ParticleID::m_pdf[5] [private] |
Definition at line 207 of file ParticleID.h.
Referenced by LikelihoodCalculation(), pdf(), pdfElectron(), pdfKaon(), pdfMuon(), pdfPion(), and pdfProton().
int ParticleID::m_pidcase [private] |
Definition at line 215 of file ParticleID.h.
Referenced by identify(), init(), LikelihoodCalculation(), and particleIDCalculation().
int ParticleID::m_pidsys [private] |
Definition at line 214 of file ParticleID.h.
Referenced by init(), IsDedxInfoUsed(), IsEmcInfoUsed(), IsMucInfoUsed(), IsTof1InfoUsed(), IsTof2InfoUsed(), IsTofCInfoUsed(), IsTofCorrInfoUsed(), IsTofEInfoUsed(), IsTofInfoUsed(), IsTofQInfoUsed(), and usePidSys().
ParticleID * ParticleID::m_pointer = 0 [static, private] |
double ParticleID::m_prob[5] [private] |
Definition at line 205 of file ParticleID.h.
Referenced by init(), particleIDCalculation(), prob(), probElectron(), probKaon(), probMuon(), probPion(), and probProton().
TofCorrPID* ParticleID::m_tofcorrpid [private] |
Definition at line 201 of file ParticleID.h.
Referenced by chiCorr(), dt(), dtCorr(), init(), ipmt(), LikelihoodCalculation(), offset(), ParticleID(), particleIDCalculation(), sigCorr(), and sigma().
TofCPID* ParticleID::m_tofcpid [private] |
Definition at line 200 of file ParticleID.h.
Referenced by LikelihoodCalculation(), ParticleID(), and particleIDCalculation().
TofEPID* ParticleID::m_tofepid [private] |
Definition at line 197 of file ParticleID.h.
Referenced by LikelihoodCalculation(), ParticleID(), and particleIDCalculation().
TofPID* ParticleID::m_tofpid [private] |
Definition at line 198 of file ParticleID.h.
Referenced by init(), LikelihoodCalculation(), ParticleID(), and particleIDCalculation().
TofQPID* ParticleID::m_tofqpid [private] |
Definition at line 199 of file ParticleID.h.
Referenced by ParticleID(), and particleIDCalculation().
double ParticleID::m_TotalLikelihood [private] |
std::string ParticleIDBase::path = "" [static, protected, inherited] |
Definition at line 102 of file ParticleIDBase.h.
Referenced by TofCPID::calculate(), EmcPID::EmcPID(), MucPID::init(), DedxPID::inputpar(), TofCorrPID::inputParameter(), MucPID::MucPID(), ParticleIDBase::ParticleIDBase(), TofEPID::particleIDCalculation(), TofCPID::particleIDCalculation(), Tof2PID::particleIDCalculation(), Tof1PID::particleIDCalculation(), and ParticleIDBase::set_path().