#include <ParticleID.h>
Inheritance diagram for ParticleID:
Public Member Functions | |
int | all () const |
int | all () const |
void | calculate () |
void | calculate () |
double | charge () |
double | charge () |
double | chi (int n) const |
double | chi (int n) const |
double | chiDedx (int n) const |
double | chiDedx (int n) const |
double | chiEmc (int n) const |
double | chiEmc (int n) const |
double | chiMinCut () const |
double | chiMinCut () const |
double | chiMuc (int n) const |
double | chiMuc (int n) const |
double | chiTof (int n) const |
double | chiTof (int n) const |
double | chiTof1 (int n) const |
double | chiTof1 (int n) const |
double | chiTof2 (int n) const |
double | chiTof2 (int n) const |
double | chiTofC (int n) const |
double | chiTofC (int n) const |
double | chiTofE (int n) const |
double | chiTofE (int n) const |
double | chiTofQ (int n) const |
double | chiTofQ (int n) const |
int | dedxValid () const |
int | dedxValid () const |
int | discard () const |
int | discard () const |
int | emcValid () const |
int | emcValid () const |
int | getNhitCut () const |
int | getNhitCut () const |
double | getRunNo () const |
double | getRunNo () const |
void | identify (const int pidcase) |
void | identify (const int pidcase) |
void | init () |
void | init () |
double | interpolation (double *x, double *y, double x1) |
double | interpolation (double *x, double *y, double x1) |
bool | IsDedxInfoValid () const |
bool | IsDedxInfoValid () const |
bool | IsEmcInfoValid () const |
bool | IsEmcInfoValid () const |
bool | IsMucInfoValid () const |
bool | IsMucInfoValid () const |
bool | IsPidInfoValid () const |
bool | IsPidInfoValid () const |
bool | IsTofCInfoValid () const |
bool | IsTofCInfoValid () const |
bool | IsTofEInfoValid () const |
bool | IsTofEInfoValid () const |
bool | IsTofInfoValid () const |
bool | IsTofInfoValid () const |
bool | IsTofQInfoValid () const |
bool | IsTofQInfoValid () const |
double | lhf (int n) const |
double | lhf (int n) const |
int | methodLikelihood () const |
int | methodLikelihood () const |
int | methodNeuronNetwork () const |
int | methodNeuronNetwork () const |
int | methodProbability () const |
int | methodProbability () const |
int | mucValid () const |
int | mucValid () const |
int | ndof () const |
int | ndof () const |
int | neuronStat () const |
int | neuronStat () const |
double | neuronVal () const |
double | neuronVal () const |
int | onlyElectron () const |
int | onlyElectron () const |
int | onlyKaon () const |
int | onlyKaon () const |
int | onlyMuon () const |
int | onlyMuon () const |
int | onlyPion () const |
int | onlyPion () const |
int | onlyPionKaon () const |
int | onlyPionKaon () const |
int | onlyPionKaonElectron () const |
int | onlyPionKaonElectron () const |
int | onlyPionKaonProton () const |
int | onlyPionKaonProton () const |
int | onlyProton () const |
int | onlyProton () const |
double | p () |
double | p () |
double | pdf (int n) const |
double | pdf (int n) const |
double | pdfCalculate (double offset, double sigma) |
double | pdfCalculate (double offset, double sigma) |
double | pdfDedx (int n) |
double | pdfDedx (int n) |
double | pdfElectron () const |
double | pdfElectron () const |
double | pdfEmc (int n) |
double | pdfEmc (int n) |
double | pdfKaon () const |
double | pdfKaon () const |
double | pdfMinSigmaCut () const |
double | pdfMinSigmaCut () const |
double | pdfMuc (int n) |
double | pdfMuc (int n) |
double | pdfMuon () const |
double | pdfMuon () const |
double | pdfPion () const |
double | pdfPion () const |
double | pdfProton () const |
double | pdfProton () const |
double | pdfTof (int n) |
double | pdfTof (int n) |
double | pdfTofC (int n) |
double | pdfTofC (int n) |
double | pdfTofE (int n) |
double | pdfTofE (int n) |
double | pdfTofQ (int n) |
double | pdfTofQ (int n) |
EvtRecTrack * | PidTrk () const |
EvtRecTrack * | PidTrk () const |
double | pol2 (double x, double *par) |
double | pol2 (double x, double *par) |
double | pol3 (double x, double *par) |
double | pol3 (double x, double *par) |
double | pol4 (double x, double *par) |
double | pol4 (double x, double *par) |
double | prob (int n) const |
double | prob (int n) const |
double | probCalculate (double chi2, int n) |
double | probCalculate (double chi2, int n) |
double | probDedx (int n) const |
double | probDedx (int n) const |
double | probElectron () const |
double | probElectron () const |
double | probEmc (int n) const |
double | probEmc (int n) const |
double | probKaon () const |
double | probKaon () const |
double | probMuc (int n) const |
double | probMuc (int n) const |
double | probMuon () const |
double | probMuon () const |
double | probPion () const |
double | probPion () const |
double | probProton () const |
double | probProton () const |
double | probTof (int n) const |
double | probTof (int n) const |
double | probTofC (int n) const |
double | probTofC (int n) const |
double | probTofE (int n) const |
double | probTofE (int n) const |
double | probTofQ (int n) const |
double | probTofQ (int n) const |
double | pt () |
double | pt () |
void | setChiMinCut (const double chi=4) |
void | setChiMinCut (const double chi=4) |
void | setMethod (const int method) |
void | setMethod (const int method) |
void | setNhitCut (const int nhitcuth=5) |
void | setNhitCut (const int nhitcuth=5) |
void | setPdfMinSigmaCut (const double pdf=4) |
void | setPdfMinSigmaCut (const double pdf=4) |
void | setRecTrack (EvtRecTrack *trk) |
void | setRecTrack (EvtRecTrack *trk) |
void | setRunNo (const double runh=8093) |
void | setRunNo (const double runh=8093) |
int | tofcValid () const |
int | tofcValid () const |
int | tofeValid () const |
int | tofeValid () const |
int | tofqValid () const |
int | tofqValid () const |
int | tofValid () const |
int | tofValid () const |
int | useDedx () const |
int | useDedx () const |
int | useEmc () const |
int | useEmc () const |
int | useMuc () const |
int | useMuc () const |
void | usePidSys (const int pidsys) |
void | usePidSys (const int pidsys) |
int | useTof () const |
int | useTof () const |
int | useTof1 () const |
int | useTof1 () const |
int | useTof2 () const |
int | useTof2 () const |
int | useTofC () const |
int | useTofC () const |
int | useTofE () const |
int | useTofE () const |
int | useTofQ () const |
int | useTofQ () const |
double | velc () |
double | velc () |
double | xmass (int n) |
double | xmass (int n) |
~ParticleID () | |
~ParticleID () | |
Static Public Member Functions | |
ParticleID * | instance () |
ParticleID * | instance () |
Protected Member Functions | |
int | LikelihoodCalculation () |
int | LikelihoodCalculation () |
int | neuronPIDCalculation () |
int | neuronPIDCalculation () |
int | particleIDCalculation () |
int | particleIDCalculation () |
Private Member Functions | |
bool | IsDedxInfoUsed () const |
bool | IsDedxInfoUsed () const |
bool | IsEmcInfoUsed () const |
bool | IsEmcInfoUsed () const |
bool | IsMucInfoUsed () const |
bool | IsMucInfoUsed () const |
bool | IsTof1InfoUsed () const |
bool | IsTof1InfoUsed () const |
bool | IsTof2InfoUsed () const |
bool | IsTof2InfoUsed () const |
bool | IsTofCInfoUsed () const |
bool | IsTofCInfoUsed () const |
bool | IsTofEInfoUsed () const |
bool | IsTofEInfoUsed () const |
bool | IsTofInfoUsed () const |
bool | IsTofInfoUsed () const |
bool | IsTofQInfoUsed () const |
bool | IsTofQInfoUsed () const |
ParticleID () | |
ParticleID () | |
Private Attributes | |
double | m_chicut |
double | m_chisq [5] |
DedxPID * | m_dedxpid |
DedxPID * | m_dedxpid |
int | m_discard |
EmcPID * | m_emcpid |
EmcPID * | m_emcpid |
double | m_likelihoodfraction [5] |
int | m_method |
MucPID * | m_mucpid |
MucPID * | m_mucpid |
int | m_ndof |
int | m_nhitcut |
double | m_pdf [5] |
int | m_pidcase |
int | m_pidsys |
double | m_prob [5] |
TofCPID * | m_tofcpid |
TofCPID * | m_tofcpid |
TofEPID * | m_tofepid |
TofEPID * | m_tofepid |
TofPID * | m_tofpid |
TofPID * | m_tofpid |
TofQPID * | m_tofqpid |
TofQPID * | m_tofqpid |
double | m_TotalLikelihood |
Static Private Attributes | |
ParticleID * | m_pointer |
ParticleID * | m_pointer = 0 |
|
00072 { 00073 // if(m_dedxpid) delete m_dedxpid; 00074 // if(m_tof1pid) delete m_tof1pid; 00075 // if(m_tof2pid) delete m_tof2pid; 00076 // if(m_tofepid) delete m_tofepid; 00077 // if(m_tofqpid) delete m_tofqpid; 00078 // if(m_emcpid) delete m_emcpid; 00079 }
|
|
00058 : ParticleIDBase(){ 00059 m_dedxpid = 0; 00060 m_tofpid = 0; 00061 m_tofepid = 0; 00062 m_tofqpid = 0; 00063 m_tofcpid = 0; 00064 m_emcpid = 0; 00065 m_mucpid = 0; 00066 00067 00068 00069 }
|
|
|
|
|
|
00091 {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
00091 {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. 00081 { 00082 int nhitcutpid=getNhitCut(); 00083 IDataProviderSvc* m_eventSvc; 00084 Gaudi::svcLocator()->service("EventDataSvc", m_eventSvc, true); 00085 00086 SmartDataPtr<Event::EventHeader> eventHeaderpid(m_eventSvc,"/Event/EventHeader"); 00087 int runpid=eventHeaderpid->runNumber(); 00088 int eventpid=eventHeaderpid->eventNumber(); 00089 // cout<<"runpid="<<runpid<<endl; 00090 // cout<<"eventpid="<<eventpid<<endl; 00091 00092 EvtRecTrack* recTrk = PidTrk(); 00093 // int runnum=getRunNo(); 00094 // cout<<"runnum="<<runnum<<endl; 00095 // if user did not specify sub sys, sepcify the default value 00096 if(m_pidsys == 0) { 00097 m_pidsys = useDedx() | useTof() | useTofE() | useEmc() | useMuc() | useTofQ() | useTofC(); 00098 } 00099 // if user did not set the seperate case, set the default value 00100 00101 if(m_pidcase == 0 ) { 00102 m_pidcase = all(); 00103 } 00104 //dedx sys 00105 if(IsDedxInfoUsed()){ 00106 if(!m_dedxpid) m_dedxpid = DedxPID::instance(); 00107 m_dedxpid->init(); 00108 m_dedxpid->setRunNo(runpid); 00109 m_dedxpid->setNhitCutDx(nhitcutpid); 00110 m_dedxpid->setRecTrack(recTrk); 00111 m_dedxpid->setChiMinCut(chiMinCut()); 00112 m_dedxpid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00113 m_dedxpid->calculate(); 00114 } 00115 00116 // tof1 and tof2 sys 00117 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed()) 00118 { 00119 if(IsTofCInfoUsed()) 00120 { 00121 if(!m_tofcpid) m_tofcpid = TofCPID::instance(); 00122 m_tofcpid->init(); 00123 m_tofcpid->setRunNo(runpid); 00124 m_tofcpid->setRecTrack(recTrk); 00125 m_tofcpid->setChiMinCut(chiMinCut()); 00126 m_tofcpid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00127 m_tofcpid->calculate(); 00128 } 00129 else 00130 { 00131 if(!m_tofpid) m_tofpid = TofPID::instance(); 00132 m_tofpid->init(); 00133 m_tofpid->setRecTrack(recTrk); 00134 m_tofpid->setChiMinCut(chiMinCut()); 00135 m_tofpid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00136 m_tofpid->calculate(); 00137 } 00138 00139 } 00140 /* 00141 // tof1 sys 00142 if(IsTof1InfoUsed()){ 00143 if(!m_tof1pid) m_tof1pid = Tof1PID::instance(); 00144 m_tof1pid->init(); 00145 m_tof1pid->setRecTrack(recTrk); 00146 m_tof1pid->setChiMinCut(4); 00147 m_tof1pid->setPdfMinSigmaCut(4); 00148 m_tof1pid->calculate(); 00149 } 00150 00151 // tof2 sys 00152 if(IsTof2InfoUsed()){ 00153 if(!m_tof2pid) m_tof2pid = Tof2PID::instance(); 00154 m_tof2pid->init(); 00155 m_tof2pid->setRecTrack(recTrk); 00156 m_tof2pid->setChiMinCut(4); 00157 m_tof2pid->setPdfMinSigmaCut(4); 00158 m_tof2pid->calculate(); 00159 } 00160 00161 */ 00162 // tofq sys 00163 if(IsTofQInfoUsed()){ 00164 if(!m_tofqpid) m_tofqpid = TofQPID::instance(); 00165 m_tofqpid->init(); 00166 m_tofqpid->setRecTrack(recTrk); 00167 m_tofqpid->setChiMinCut(chiMinCut()); 00168 m_tofqpid->calculate(); 00169 } 00170 00171 // endcap tof sys 00172 if(IsTofEInfoUsed()){ 00173 if(!m_tofepid) m_tofepid = TofEPID::instance(); 00174 m_tofepid->init(); 00175 m_tofepid->setRecTrack(recTrk); 00176 m_tofepid->setChiMinCut(chiMinCut()); 00177 m_tofepid->setPdfMinSigmaCut(pdfMinSigmaCut()); 00178 m_tofepid->calculate(); 00179 } 00180 // emc sys 00181 if(IsEmcInfoUsed()){ 00182 if(!m_emcpid) m_emcpid = EmcPID::instance(); 00183 m_emcpid->init(); 00184 m_emcpid->setRecTrack(recTrk); 00185 m_emcpid->setChiMinCut(chiMinCut()); 00186 m_emcpid->calculate(); 00187 } 00188 00189 // muc sys 00190 if(IsMucInfoUsed()){ 00191 if(!m_mucpid) m_mucpid = MucPID::instance(); 00192 m_mucpid->init(); 00193 m_mucpid->setRecTrack(recTrk); 00194 m_mucpid->setChiMinCut(chiMinCut()); 00195 m_mucpid->calculate(); 00196 } 00197 // probability method 00198 if(m_method & methodProbability() == methodProbability()) 00199 if(particleIDCalculation() < 0) m_ndof = 0; 00200 // std::cout<<"m_ndof="<<m_ndof<<std::endl; 00201 00202 //likelihood method 00203 if((m_method & methodLikelihood()) == methodLikelihood()) 00204 if(LikelihoodCalculation() < 0) m_discard =0; 00205 // neuron network 00206 if((m_method & methodNeuronNetwork()) == methodNeuronNetwork()) 00207 // m_neuronPid = neuronPIDCalculation(); 00208 if(LikelihoodCalculation() < 0) m_discard =0; 00209 00210 }
|
|
|
|
00077 { 00078 double val = 999; 00079 if(!m_trk) return val; 00080 if(!m_trk->isMdcTrackValid()) return val; 00081 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00082 val = mdcTrk->charge() + 0.0; 00083 }
|
|
Implements ParticleIDBase. 00106 {return m_chisq[n];}
|
|
Implements ParticleIDBase. 00106 {return m_chisq[n];}
|
|
|
|
|
|
|
|
|
|
00052 {return m_chimin_cut;}
|
|
00052 {return m_chimin_cut;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00103 {return DEDX_VALID;}
|
|
00103 {return DEDX_VALID;}
|
|
00119 {return m_discard;}
|
|
00119 {return m_discard;}
|
|
00108 {return EMC_VALID;}
|
|
00108 {return EMC_VALID;}
|
|
00084 {return m_nhitcut;}
|
|
00084 {return m_nhitcut;}
|
|
00056 {return m_runno;}
|
|
00056 {return m_runno;}
|
|
|
|
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. 00020 { 00021 00022 if(IsDedxInfoUsed()){ 00023 if(!m_dedxpid) m_dedxpid = DedxPID::instance(); 00024 m_dedxpid->init(); 00025 } 00026 00027 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()){ 00028 if(!m_tofpid) m_tofpid = TofPID::instance(); 00029 m_tofpid->init(); 00030 } 00031 00032 if(IsEmcInfoUsed()){ 00033 if(!m_emcpid) m_emcpid = EmcPID::instance(); 00034 m_emcpid->init(); 00035 } 00036 00037 if(IsMucInfoUsed()){ 00038 if(!m_mucpid) m_mucpid = MucPID::instance(); 00039 m_mucpid->init(); 00040 } 00041 00042 // global info. 00043 m_pidsys = 0; 00044 m_pidcase = 0; 00045 m_method = 0; 00046 m_TotalLikelihood =0; 00047 m_discard =1; 00048 // probability 00049 m_ndof = 0; 00050 m_nhitcut=5; 00051 for(int i = 0; i < 4; i++) { 00052 m_chisq[i] = 9999.; 00053 m_prob[i] = -1.0; 00054 } 00055 }
|
|
|
|
00015 { 00016 if(!m_pointer) m_pointer = new ParticleID(); 00017 return m_pointer; 00018 }
|
|
|
|
00085 { 00086 double c1 = (y[0]-y[1])*(x[1]-x[2])-(x[0]-x[1])*(y[1]-y[2]); 00087 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]); 00088 double c = c1/c2; 00089 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]); 00090 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]); 00091 double b = b1/b2; 00092 double a = y[0] - b*x[0]-c*x[0]*x[0]; 00093 double y1 = a + b*x1 +c*x1*x1; 00094 return y1; 00095 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00112 {return m_likelihoodfraction[n];}
|
|
00112 {return m_likelihoodfraction[n];}
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. 00371 { 00372 int irc = -1; 00373 00374 bool valid = IsDedxInfoValid() || IsTofInfoValid() || IsTofEInfoValid() || IsTofQInfoValid() || IsTofCInfoValid() || IsEmcInfoValid()||IsMucInfoValid(); 00375 if(!valid) return irc; 00376 double pdf[5]; 00377 bool pidcase[5]; 00378 for(int i = 0; i < 5; i++) { 00379 pdf[i] = 1; 00380 pidcase[i] = false; 00381 } 00382 00383 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] = true; 00384 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] = true; 00385 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] = true; 00386 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] = true; 00387 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] = true; 00388 00389 for(int i = 0; i < 5; i++) { 00390 if(pidcase[i]==0) 00391 pdf[i]=0; 00392 } 00393 00394 // 00395 // dEdx PID 00396 // 00397 if(IsDedxInfoUsed()){ 00398 if(IsDedxInfoValid()) { 00399 bool okpid = false; 00400 for(int i = 0; i < 5; i++) { 00401 if(pidcase[i] && pdfCalculate(chiDedx(i),1) > pdfCalculate(m_dedxpid->pdfMinSigmaCut(),1.5)) 00402 if(!okpid) okpid = true; 00403 } 00404 if(okpid) { 00405 m_ndof++; 00406 for(int i = 0; i < 5; i++){ pdf[i] *= pdfDedx(i); 00407 } 00408 } 00409 } // dE/dx 00410 } 00411 00412 00413 // 00414 // Barrel TOF 00415 // 00416 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed()) 00417 {if(IsTofCInfoUsed()) 00418 { 00419 00420 if(IsTofCInfoValid()) { 00421 bool okpid = false; 00422 for(int i = 0; i < 5; i++) { 00423 if(pidcase[i] && pdfCalculate(chiTof(i),1) > pdfCalculate(m_tofcpid->pdfMinSigmaCut(),1.5)) 00424 if(!okpid) okpid = true; 00425 } 00426 if(okpid) { 00427 m_ndof++; 00428 for(int i = 0; i < 5; i++){ 00429 pdf[i] *= pdfTofC(i); 00430 } 00431 } 00432 } // TOF 00433 } 00434 00435 else{ 00436 if(IsTofInfoValid()) { 00437 bool okpid = false; 00438 for(int i = 0; i < 5; i++) { 00439 if(pidcase[i] && pdfCalculate(chiTof(i),1) > pdfCalculate(m_tofpid->pdfMinSigmaCut(),1.5)) 00440 if(!okpid) okpid = true; 00441 } 00442 if(okpid) { m_ndof++; 00443 for(int i = 0; i < 5; i++){ 00444 pdf[i] *= pdfTof(i); 00445 } 00446 } 00447 } // TOF 00448 00449 00450 00451 // 00452 // EndCap Tof 00453 // 00454 00455 if(IsTofEInfoUsed()){ 00456 if(IsTofEInfoValid()) { 00457 bool okpid = false; 00458 for(int i = 0; i < 5; i++) { 00459 if(pidcase[i]&& pdfCalculate(chiTofE(i),1) > pdfCalculate(m_tofepid->pdfMinSigmaCut(),1.5)) 00460 if(!okpid) okpid = true; 00461 } 00462 if(okpid) { 00463 // m_ndof++; 00464 // for(int i = 0; i < 5; i++) pdf[i] *= pdfTofE(i); 00465 } 00466 } // EndCap TOF 00467 } 00468 } 00469 00470 } 00471 00472 // 00473 // Barrel TOF Q 00474 // 00475 00476 if(IsTofQInfoValid()) { 00477 bool okpid = false; 00478 for(int i = 0; i < 5; i++) { 00479 if(pidcase[i]) 00480 if(!okpid) okpid = true; 00481 } 00482 if(okpid) { 00483 // m_ndof++; 00484 for(int i = 0; i < 5; i++) pdf[i] *= pdfTofQ(i); 00485 } 00486 } // TofQ 00487 00488 // 00489 // Emc PID 00490 // 00491 if(IsEmcInfoUsed()){ 00492 if(IsEmcInfoValid()) { 00493 bool okpid = false; 00494 for(int i = 0; i < 5; i++) { 00495 if(pidcase[i]&&pdfEmc(i)>0) 00496 if(!okpid) okpid = true; 00497 } 00498 if(okpid) { 00499 m_ndof++; 00500 for(int i = 0; i < 5; i++) { 00501 pdf[i] *= pdfEmc(i); 00502 } 00503 } // Emc Pid 00504 } 00505 } 00506 if(IsMucInfoUsed()){ 00507 if(IsMucInfoValid()) { 00508 bool okpid = false; 00509 for(int i = 0; i < 5; i++) { 00510 if(pidcase[i]&&pdfMuc(i)>0) 00511 if(!okpid) okpid = true; 00512 } 00513 if(okpid) { 00514 m_ndof++; 00515 for(int i = 0; i < 5; i++) { 00516 pdf[i] *= pdfMuc(i); 00517 } 00518 } 00519 } // Emc Pid 00520 } 00521 00522 00523 00524 if(m_ndof <= 0) return irc; 00525 for(int i = 0; i < 5; i++) { 00526 m_pdf[i] = pdf[i]; 00527 m_TotalLikelihood += pdf[i]; 00528 } 00529 for(int i = 0; i < 5; i++) { 00530 m_likelihoodfraction[i] = pdf[i]/m_TotalLikelihood; 00531 } 00532 00533 00534 irc = 0; 00535 return irc; 00536 }
|
|
00099 {return LIKELIHOOD_PID;}
|
|
00099 {return LIKELIHOOD_PID;}
|
|
00101 {return NEURONNETWORK_PID;}
|
|
00101 {return NEURONNETWORK_PID;}
|
|
00100 {return PROBABILITY_PID;}
|
|
00100 {return PROBABILITY_PID;}
|
|
00109 {return MUC_VALID;}
|
|
00109 {return MUC_VALID;}
|
|
Implements ParticleIDBase. 00108 {return m_ndof;}
|
|
Implements ParticleIDBase. 00108 {return m_ndof;}
|
|
|
|
|
|
00137 {return IsPidInfoValid();}
|
|
00137 {return IsPidInfoValid();}
|
|
00138 { 00139 if(lhf(0)>0.02) return 1.0; 00140 if(lhf(1)>0.02) return 8.5; 00141 if(lhf(2)>0.02) return 2.0; 00142 if(lhf(3)>0.02) return 4.0; 00143 if(lhf(4)>0.02) return 5.0; 00144 }
|
|
00138 { 00139 if(lhf(0)>0.02) return 1.0; 00140 if(lhf(1)>0.02) return 8.5; 00141 if(lhf(2)>0.02) return 2.0; 00142 if(lhf(3)>0.02) return 4.0; 00143 if(lhf(4)>0.02) return 5.0; 00144 }
|
|
00092 {return IDENTIFY_ELECTRON;}
|
|
00092 {return IDENTIFY_ELECTRON;}
|
|
00095 {return IDENTIFY_KAON;}
|
|
00095 {return IDENTIFY_KAON;}
|
|
00093 {return IDENTIFY_MUON;}
|
|
00093 {return IDENTIFY_MUON;}
|
|
00094 {return IDENTIFY_PION;}
|
|
00094 {return IDENTIFY_PION;}
|
|
00088 {return (IDENTIFY_PION | IDENTIFY_KAON);}
|
|
00088 {return (IDENTIFY_PION | IDENTIFY_KAON);}
|
|
00090 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}
|
|
00090 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}
|
|
00089 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
00089 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
00096 {return IDENTIFY_PROTON;}
|
|
00096 {return IDENTIFY_PROTON;}
|
|
|
|
00063 { 00064 double val = 999; 00065 if(!m_trk) return val; 00066 if(!m_trk->isMdcTrackValid()) return val; 00067 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00068 val = mdcTrk->p(); 00069 }
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. 00212 { 00213 int irc = -1; 00214 bool valid = IsDedxInfoValid() || IsTofInfoValid()||IsTofEInfoValid() 00215 || IsTofQInfoValid() || IsEmcInfoValid() || IsMucInfoValid() || IsTofCInfoValid(); 00216 00217 if(!valid) return irc; 00218 00219 double chisq[5]; 00220 bool pidcase[5]; 00221 for(int i = 0; i < 5; i++) { 00222 chisq[i] = 0; 00223 pidcase[i] = false; 00224 } 00225 00226 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] = true; 00227 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] = true; 00228 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] = true; 00229 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] = true; 00230 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] = true; 00231 00232 // 00233 // dEdx PID 00234 // 00235 if(IsDedxInfoUsed()){ 00236 if(IsDedxInfoValid()) { 00237 bool okpid = false; 00238 for(int i = 0; i < 5; i++) { 00239 if(pidcase[i] && (fabs(chiDedx(i)) < m_dedxpid->chiMinCut())) 00240 if(!okpid) okpid = true; 00241 } 00242 if(okpid) { 00243 m_ndof++; 00244 for(int i = 0; i < 5; i++) chisq[i] += chiDedx(i)*chiDedx(i); 00245 00246 00247 } 00248 } // dE/dx 00249 } 00250 // 00251 // Barrel TOF 00252 // 00253 00254 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed() | IsTofCInfoUsed()) 00255 {if(IsTofCInfoUsed()) 00256 { 00257 if(IsTofCInfoValid()) { 00258 bool okpid = false; 00259 for(int i = 0; i < 5; i++) { 00260 if(pidcase[i] && (fabs(chiTofC(i)) < m_tofcpid->chiMinCut())) 00261 if(!okpid) okpid = true; 00262 } 00263 if(okpid) { 00264 m_ndof++; 00265 for(int i = 0; i < 5; i++) chisq[i] += chiTofC(i)*chiTofC(i); 00266 } 00267 } // TOF1 00268 } 00269 else{ 00270 if(IsTofInfoValid()) { 00271 bool okpid = false; 00272 for(int i = 0; i < 5; i++) { 00273 if(pidcase[i] && (fabs(chiTof(i)) < m_tofpid->chiMinCut())) 00274 if(!okpid) okpid = true; 00275 } 00276 if(okpid) { 00277 m_ndof++; 00278 for(int i = 0; i < 5; i++) chisq[i] += chiTof(i)*chiTof(i); 00279 } 00280 } // TOF1 00281 00282 00283 // 00284 // EndCap Tof 00285 // 00286 00287 if(IsTofEInfoUsed()){ 00288 if(IsTofEInfoValid()) { 00289 bool okpid = false; 00290 for(int i = 0; i < 5; i++) { 00291 if(pidcase[i] && (fabs(chiTofE(i)) < m_tofepid->chiMinCut())) 00292 if(!okpid) okpid = true; 00293 } 00294 if(okpid) { 00295 m_ndof++; 00296 for(int i = 0; i < 5; i++) chisq[i] += chiTofE(i)*chiTofE(i); 00297 } 00298 } // EndCap TOF 00299 } 00300 00301 } 00302 } 00303 00304 // 00305 // Barrel TOF Q 00306 // 00307 00308 if(IsTofQInfoUsed()){ 00309 if(IsTofQInfoValid()) { 00310 bool okpid = false; 00311 for(int i = 0; i < 5; i++) { 00312 if(pidcase[i] && (fabs(chiTofQ(i)) < m_tofqpid->chiMinCut())) 00313 if(!okpid) okpid = true; 00314 } 00315 if(okpid) { 00316 m_ndof++; 00317 for(int i = 0; i < 5; i++) chisq[i] += chiTofQ(i)*chiTofQ(i); 00318 } 00319 } // TofQ 00320 } 00321 00322 // Muc Pid 00323 if(IsMucInfoUsed()){ 00324 if(IsMucInfoValid()) { 00325 bool okpid = false; 00326 for(int i = 0; i < 5; i++) { 00327 if(pidcase[i] && (fabs(chiMuc(i)) < m_mucpid->chiMinCut())) 00328 if(!okpid) okpid = true; 00329 } 00330 if(okpid) { 00331 m_ndof++; 00332 for(int i = 0; i < 5; i++) chisq[i] += chiMuc(i)*chiMuc(i); 00333 } 00334 } // Muc Pid 00335 } 00336 00337 00338 // Emc PID 00339 if(IsEmcInfoUsed()){ 00340 if(IsEmcInfoValid()) { 00341 bool okpid = false; 00342 for(int i = 0; i < 5; i++) { 00343 if(pidcase[i] && (fabs(chiEmc(i)) < m_emcpid->chiMinCut())) 00344 if(!okpid) okpid = true; 00345 } 00346 if(okpid) { 00347 m_ndof++; 00348 for(int i = 0; i < 5; i++) chisq[i] += chiEmc(i)*chiEmc(i); 00349 } 00350 } // Emc Pid 00351 } 00352 00353 00354 if(m_ndof <= 0) return irc; 00355 00356 00357 for(int i = 0; i < 5; i++) { 00358 m_chisq[i] = chisq[i]; 00359 m_prob[i] = probCalculate(chisq[i], m_ndof); 00360 } 00361 00362 00363 irc = 0; 00364 return irc; 00365 }
|
|
00111 { return m_pdf[n];}
|
|
00111 { return m_pdf[n];}
|
|
|
|
00055 { 00056 const double pi = 3.141592653589793238; 00057 const double twoPi = 2*pi; 00058 double chi2 = -0.5*offset*offset/(sigma*sigma); 00059 double pdf = exp(chi2)/(sigma*sqrt(twoPi)); 00060 return pdf; 00061 }
|
|
|
|
|
|
00122 {return m_pdf[0];}
|
|
00122 {return m_pdf[0];}
|
|
|
|
|
|
00125 {return m_pdf[3];}
|
|
00125 {return m_pdf[3];}
|
|
00054 {return m_pdfsigmamin_cut;}
|
|
00054 {return m_pdfsigmamin_cut;}
|
|
|
|
|
|
00123 {return m_pdf[1];}
|
|
00123 {return m_pdf[1];}
|
|
00124 {return m_pdf[2];}
|
|
00124 {return m_pdf[2];}
|
|
00126 {return m_pdf[4];}
|
|
00126 {return m_pdf[4];}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00050 {return m_trk;}
|
|
00050 {return m_trk;}
|
|
|
|
00097 { 00098 double y=x; 00099 return par[0] + (par[1] * y) +(par[2] * y * y); 00100 }
|
|
|
|
00102 { 00103 double y=x; 00104 return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y); 00105 }
|
|
|
|
00107 { 00108 double y=x; 00109 return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y) + (par[4] * y * y*y*y); 00110 }
|
|
Implements ParticleIDBase. 00107 { return m_prob[n];}
|
|
Implements ParticleIDBase. 00107 { return m_prob[n];}
|
|
|
|
00047 { 00048 double p = -1.0; 00049 if(chi2 < 0) return p; 00050 p = TMath::Prob(chi2, ndof); 00051 return p; 00052 }
|
|
|
|
|
|
00114 {return m_prob[0];}
|
|
00114 {return m_prob[0];}
|
|
|
|
|
|
00117 {return m_prob[3];}
|
|
00117 {return m_prob[3];}
|
|
|
|
|
|
00115 {return m_prob[1];}
|
|
00115 {return m_prob[1];}
|
|
00116 {return m_prob[2];}
|
|
00116 {return m_prob[2];}
|
|
00118 {return m_prob[4];}
|
|
00118 {return m_prob[4];}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
00070 { 00071 double val = 999; 00072 if(!m_trk) return val; 00073 if(!m_trk->isMdcTrackValid()) return val; 00074 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00075 val = mdcTrk->pxy(); 00076 }
|
|
00053 {m_chimin_cut = chi;}
|
|
00053 {m_chimin_cut = chi;}
|
|
|
|
|
|
00085 {m_nhitcut = nhitcuth;}
|
|
00085 {m_nhitcut = nhitcuth;}
|
|
00055 {m_pdfsigmamin_cut= pdf;}
|
|
00055 {m_pdfsigmamin_cut= pdf;}
|
|
00051 {m_trk = trk;}
|
|
00051 {m_trk = trk;}
|
|
00057 {m_runno = runh;}
|
|
00057 {m_runno = runh;}
|
|
00107 {return TOFC_VALID;}
|
|
00107 {return TOFC_VALID;}
|
|
00105 {return TOFE_VALID;}
|
|
00105 {return TOFE_VALID;}
|
|
00106 {return TOFQ_VALID;}
|
|
00106 {return TOFQ_VALID;}
|
|
00104 {return TOF_VALID;}
|
|
00104 {return TOF_VALID;}
|
|
00077 {return USE_DEDX;}
|
|
00077 {return USE_DEDX;}
|
|
00084 {return USE_EMC;}
|
|
00084 {return USE_EMC;}
|
|
00085 {return USE_MUC;}
|
|
00085 {return USE_MUC;}
|
|
|
|
|
|
00078 {return USE_TOF;}
|
|
00078 {return USE_TOF;}
|
|
00079 {return USE_TOF1;}
|
|
00079 {return USE_TOF1;}
|
|
00080 {return USE_TOF2;}
|
|
00080 {return USE_TOF2;}
|
|
00083 {return USE_TOFC;}
|
|
00083 {return USE_TOFC;}
|
|
00081 {return USE_TOFE;}
|
|
00081 {return USE_TOFE;}
|
|
00082 {return USE_TOFQ;}
|
|
00082 {return USE_TOFQ;}
|
|
|
|
00041 { 00042 // double vel = 29.9792458; // tof_path unit in cm. 00043 double vel = 299.792458; // tof path unit in mm 00044 return vel; 00045 }
|
|
|
|
00035 { 00036 double mass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272}; 00037 if(n < 0 || n >=5) return 0.0; 00038 return mass[n]; 00039 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|