BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
ParticleID Class Reference

#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
 
double offset (int i)
 
double sigma (int i)
 
- Public Member Functions inherited from ParticleIDBase
 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)
 

Static Public Member Functions

static ParticleIDinstance ()
 

Protected Member Functions

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

Additional Inherited Members

- Static Protected Attributes inherited from ParticleIDBase
static std::string path = ""
 

Detailed Description

Definition at line 36 of file ParticleID.h.

Constructor & Destructor Documentation

◆ ~ParticleID()

ParticleID::~ParticleID ( )

Definition at line 85 of file ParticleID.cxx.

85 {
86 // if(m_dedxpid) delete m_dedxpid;
87 // if(m_tof1pid) delete m_tof1pid;
88 // if(m_tof2pid) delete m_tof2pid;
89 // if(m_tofepid) delete m_tofepid;
90 // if(m_tofqpid) delete m_tofqpid;
91 // if(m_emcpid) delete m_emcpid;
92}

Member Function Documentation

◆ calculate()

void ParticleID::calculate ( )
virtual

Implements ParticleIDBase.

Definition at line 94 of file ParticleID.cxx.

94 {
95#ifdef BEAN
96 cout << " please use ParticleID::calculate(run) ! " << endl;
97 exit(1);
98}
99
100
101void ParticleID::calculate(int run)
102{
103#endif
104 int nhitcutpid=getNhitCut();
105
106#ifndef BEAN
107 IDataProviderSvc* m_eventSvc;
108 Gaudi::svcLocator()->service("EventDataSvc", m_eventSvc, true);
109
110 SmartDataPtr<Event::EventHeader> eventHeaderpid(m_eventSvc,"/Event/EventHeader");
111 int runpid=eventHeaderpid->runNumber();
112 int eventpid=eventHeaderpid->eventNumber();
113 // cout<<"runpid="<<runpid<<endl;
114 // cout<<"eventpid="<<eventpid<<endl;
115#else
116 int runpid=run;
117#endif
118
119 EvtRecTrack* recTrk = PidTrk();
120 // int runnum=getRunNo();
121 // cout<<"runnum="<<runnum<<endl;
122 // if user did not specify sub sys, sepcify the default value
123 if(m_pidsys == 0) {
124 m_pidsys = useDedx() | useTof() | useTofE() | useEmc() | useMuc() | useTofQ() | useTofC() | useTofCorr();
125 }
126 // if user did not set the seperate case, set the default value
127
128 if(m_pidcase == 0 ) {
129 m_pidcase = all();
130 }
131 //dedx sys
132 if(IsDedxInfoUsed()) {
133 if(!m_dedxpid) m_dedxpid = DedxPID::instance();
134 m_dedxpid->init();
135 m_dedxpid->setRunNo(runpid);
136 m_dedxpid->setNhitCutDx(nhitcutpid);
137 m_dedxpid->setRecTrack(recTrk);
138 m_dedxpid->setChiMinCut(chiMinCut());
139 m_dedxpid->setPdfMinSigmaCut(pdfMinSigmaCut());
140 m_dedxpid->calculate();
141 }
142
143 // tof1 and tof2 sys
144 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed())
145 {
146 if(IsTofCInfoUsed())
147 {
148 if(!m_tofcpid) m_tofcpid = TofCPID::instance();
149 m_tofcpid->init();
150 m_tofcpid->setRunNo(runpid);
151 m_tofcpid->setRecTrack(recTrk);
152 m_tofcpid->setChiMinCut(chiMinCut());
153 m_tofcpid->setPdfMinSigmaCut(pdfMinSigmaCut());
154 m_tofcpid->calculate();
155 }
156 else
157 {
158 if(!m_tofpid) m_tofpid = TofPID::instance();
159 m_tofpid->init();
160 m_tofpid->setRecTrack(recTrk);
161 m_tofpid->setChiMinCut(chiMinCut());
163 m_tofpid->calculate();
164 }
165
166 }
167 // tof secondary correction sys
168 if(IsTofCorrInfoUsed()) {
169 if(!m_tofcorrpid) m_tofcorrpid = TofCorrPID::instance();
170 m_tofcorrpid->setRunNo(runpid);
171 m_tofcorrpid->init();
172 m_tofcorrpid->setRecTrack(recTrk);
173 m_tofcorrpid->setChiMinCut(chiMinCut());
174 m_tofcorrpid->setPdfMinSigmaCut(pdfMinSigmaCut());
175 m_tofcorrpid->calculate();
176 }
177
178 /*
179 // tof1 sys
180 if(IsTof1InfoUsed()){
181 if(!m_tof1pid) m_tof1pid = Tof1PID::instance();
182 m_tof1pid->init();
183 m_tof1pid->setRecTrack(recTrk);
184 m_tof1pid->setChiMinCut(4);
185 m_tof1pid->setPdfMinSigmaCut(4);
186 m_tof1pid->calculate();
187 }
188
189 // tof2 sys
190 if(IsTof2InfoUsed()){
191 if(!m_tof2pid) m_tof2pid = Tof2PID::instance();
192 m_tof2pid->init();
193 m_tof2pid->setRecTrack(recTrk);
194 m_tof2pid->setChiMinCut(4);
195 m_tof2pid->setPdfMinSigmaCut(4);
196 m_tof2pid->calculate();
197 }
198
199 */
200 // tofq sys
201 if(IsTofQInfoUsed()) {
202 if(!m_tofqpid) m_tofqpid = TofQPID::instance();
203 m_tofqpid->init();
204 m_tofqpid->setRecTrack(recTrk);
205 m_tofqpid->setChiMinCut(chiMinCut());
206 m_tofqpid->calculate();
207 }
208
209 // endcap tof sys
210 if(IsTofEInfoUsed()&&(!IsTofCorrInfoUsed())) {
211 if(!m_tofepid) m_tofepid = TofEPID::instance();
212 m_tofepid->init();
213 m_tofepid->setRecTrack(recTrk);
214 m_tofepid->setChiMinCut(chiMinCut());
215 m_tofepid->setPdfMinSigmaCut(pdfMinSigmaCut());
216 m_tofepid->calculate();
217 }
218 // emc sys
219 if(IsEmcInfoUsed()) {
220 if(!m_emcpid) m_emcpid = EmcPID::instance();
221 m_emcpid->init();
222 m_emcpid->setRecTrack(recTrk);
223 m_emcpid->setChiMinCut(chiMinCut());
224 m_emcpid->calculate();
225 }
226
227 // muc sys
228 if(IsMucInfoUsed()) {
229 if(!m_mucpid) m_mucpid = MucPID::instance();
230 m_mucpid->init();
231 m_mucpid->setRecTrack(recTrk);
232 m_mucpid->setChiMinCut(chiMinCut());
233 m_mucpid->calculate();
234 }
235 // probability method
236 if((m_method & methodProbability()) == methodProbability())
237 if(particleIDCalculation() < 0) m_ndof = 0;
238 // std::cout<<"m_ndof="<<m_ndof<<std::endl;
239
240 //likelihood method
241 if((m_method & methodLikelihood()) == methodLikelihood())
242 if(LikelihoodCalculation() < 0) m_discard =0;
243 // neuron network
244 if((m_method & methodNeuronNetwork()) == methodNeuronNetwork())
245 // m_neuronPid = neuronPIDCalculation();
246 if(LikelihoodCalculation() < 0) m_discard =0;
247
248}
void init()
Definition: DedxPID.cxx:25
void setNhitCutDx(const int nhitcuthdx=5)
Definition: DedxPID.h:35
void calculate()
Definition: DedxPID.cxx:41
static DedxPID * instance()
Definition: DedxPID.cxx:16
void calculate()
Definition: EmcPID.cxx:153
void init()
Definition: EmcPID.cxx:95
static EmcPID * instance()
Definition: EmcPID.cxx:23
void init()
Definition: MucPID.cxx:67
static MucPID * instance()
Definition: MucPID.cxx:22
void calculate()
Definition: MucPID.cxx:101
double chiMinCut() const
int useTofCorr() const
void setPdfMinSigmaCut(const double pdf=4)
EvtRecTrack * PidTrk() const
int useTofE() const
int useTof() const
int useTofQ() const
int methodProbability() const
int useDedx() const
int useTofC() const
void setRunNo(const double runh=8093)
double pdfMinSigmaCut() const
int methodNeuronNetwork() const
int useEmc() const
void setChiMinCut(const double chi=4)
int all() const
int useMuc() const
int methodLikelihood() const
void setRecTrack(EvtRecTrack *trk)
int getNhitCut() const
Definition: ParticleID.h:88
int LikelihoodCalculation()
Definition: ParticleID.cxx:426
int particleIDCalculation()
Definition: ParticleID.cxx:250
void calculate()
Definition: ParticleID.cxx:94
void calculate()
Definition: TofCPID.cxx:55
void init()
Definition: TofCPID.cxx:43
static TofCPID * instance()
Definition: TofCPID.cxx:19
void init()
Definition: TofCorrPID.cxx:29
void calculate()
Definition: TofCorrPID.cxx:56
static TofCorrPID * instance()
Definition: TofCorrPID.cxx:19
void init()
Definition: TofEPID.cxx:25
void calculate()
Definition: TofEPID.cxx:39
static TofEPID * instance()
Definition: TofEPID.cxx:16
void init()
Definition: TofPID.cxx:24
void calculate()
Definition: TofPID.cxx:48
static TofPID * instance()
Definition: TofPID.cxx:15
void init()
Definition: TofQPID.cxx:22
void calculate()
Definition: TofQPID.cxx:34
static TofQPID * instance()
Definition: TofQPID.cxx:13

Referenced by Gam4pikp::execute(), Rhopi::execute(), inclks::execute(), inclkstar::execute(), incllambda::execute(), inclphi::execute(), DQAJpsi2PPbarAlg::execute(), DQAKsKpi::execute(), DQARhopi::execute(), DQASelBhabha::execute(), DQASelDimu::execute(), DQASelHadron::execute(), and BeamParams::execute().

◆ chi()

double ParticleID::chi ( int  n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 113 of file ParticleID.h.

113{return m_chisq[n];}
const Int_t n

◆ chiDedx()

◆ chiEmc()

double ParticleID::chiEmc ( int  n) const
inline

◆ chiMuc()

double ParticleID::chiMuc ( int  n) const
inline

◆ chiTof()

double ParticleID::chiTof ( int  n) const
inline

Referenced by LikelihoodCalculation().

◆ chiTof1()

◆ chiTof2()

◆ chiTofC()

double ParticleID::chiTofC ( int  n) const
inline

◆ chiTofCorr()

double ParticleID::chiTofCorr ( int  n) const
inline

Referenced by LikelihoodCalculation().

◆ chiTofE()

double ParticleID::chiTofE ( int  n) const
inline

Referenced by LikelihoodCalculation().

◆ chiTofQ()

double ParticleID::chiTofQ ( int  n) const
inline

◆ discard()

int ParticleID::discard ( ) const
inline

Definition at line 126 of file ParticleID.h.

126{return m_discard;}

◆ getNhitCut()

int ParticleID::getNhitCut ( ) const
inline

Definition at line 88 of file ParticleID.h.

88{return m_nhitcut;}

◆ identify()

◆ init()

void ParticleID::init ( )
virtual

Implements ParticleIDBase.

Definition at line 27 of file ParticleID.cxx.

27 {
28
29 if(IsDedxInfoUsed()) {
30 if(!m_dedxpid) m_dedxpid = DedxPID::instance();
31 m_dedxpid->init();
32 }
33
34 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()) {
35 if(!m_tofpid) m_tofpid = TofPID::instance();
36 m_tofpid->init();
37 }
38
39 if(IsTofCorrInfoUsed()) {
40 if(!m_tofcorrpid) m_tofcorrpid = TofCorrPID::instance();
41 // m_tofcorrpid->init();
42 }
43
44 if(IsEmcInfoUsed()) {
45 if(!m_emcpid) m_emcpid = EmcPID::instance();
46 m_emcpid->init();
47 }
48
49 if(IsMucInfoUsed()) {
50 if(!m_mucpid) m_mucpid = MucPID::instance();
51 m_mucpid->init();
52 }
53
54 // global info.
55 m_pidsys = 0;
56 m_pidcase = 0;
57 m_method = 0;
58 m_TotalLikelihood =0;
59 m_discard =1;
60 // probability
61 m_ndof = 0;
62 m_nhitcut=5;
63 for(int i = 0; i < 4; i++) {
64 m_chisq[i] = 9999.;
65 m_prob[i] = -1.0;
66 }
67}

Referenced by Gam4pikp::execute(), Rhopi::execute(), inclks::execute(), inclkstar::execute(), incllambda::execute(), inclphi::execute(), DQAJpsi2PPbarAlg::execute(), DQAKsKpi::execute(), DQARhopi::execute(), DQASelBhabha::execute(), DQASelDimu::execute(), DQASelHadron::execute(), and BeamParams::execute().

◆ instance()

◆ IsDedxInfoValid()

bool ParticleID::IsDedxInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ IsEmcInfoValid()

bool ParticleID::IsEmcInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ IsMucInfoValid()

bool ParticleID::IsMucInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ IsPidInfoValid()

◆ IsTofCInfoValid()

bool ParticleID::IsTofCInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ IsTofCorrInfoValid()

bool ParticleID::IsTofCorrInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ IsTofEInfoValid()

bool ParticleID::IsTofEInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ IsTofInfoValid()

bool ParticleID::IsTofInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ IsTofQInfoValid()

bool ParticleID::IsTofQInfoValid ( ) const
inline

Referenced by LikelihoodCalculation().

◆ lhf()

double ParticleID::lhf ( int  n) const
inline

Definition at line 119 of file ParticleID.h.

119{return m_likelihoodfraction[n];}

Referenced by neuronVal().

◆ LikelihoodCalculation()

int ParticleID::LikelihoodCalculation ( )
protectedvirtual

Implements ParticleIDBase.

Definition at line 426 of file ParticleID.cxx.

426 {
427 int irc = -1;
428
430 if(!valid) return irc;
431 double pdf[5];
432 bool pidcase[5];
433 for(int i = 0; i < 5; i++) {
434 pdf[i] = 1;
435 pidcase[i] = false;
436 }
437
438 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] = true;
439 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] = true;
440 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] = true;
441 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] = true;
442 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] = true;
443
444 for(int i = 0; i < 5; i++) {
445 if(pidcase[i]==0)
446 pdf[i]=0;
447 }
448
449 //
450 // dEdx PID
451 //
452 if(IsDedxInfoUsed()) {
453 if(IsDedxInfoValid()) {
454 bool okpid = false;
455 for(int i = 0; i < 5; i++) {
456 if(pidcase[i] && pdfCalculate(chiDedx(i),1) > pdfCalculate(m_dedxpid->pdfMinSigmaCut(),1.5))
457 if(!okpid) okpid = true;
458 }
459 if(okpid) {
460 m_ndof++;
461 for(int i = 0; i < 5; i++) {
462 pdf[i] *= pdfDedx(i);
463 }
464 }
465 } // dE/dx
466 }
467
468
469 //
470 // Barrel TOF
471 //
472 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed()|IsTofCInfoUsed())
473 { if(IsTofCInfoUsed())
474 {
475
476 if(IsTofCInfoValid()) {
477 bool okpid = false;
478 for(int i = 0; i < 5; i++) {
479 if(pidcase[i] && pdfCalculate(chiTof(i),1) > pdfCalculate(m_tofcpid->pdfMinSigmaCut(),1.5))
480 if(!okpid) okpid = true;
481 }
482 if(okpid) {
483 m_ndof++;
484 for(int i = 0; i < 5; i++) {
485 pdf[i] *= pdfTofC(i);
486 }
487 }
488 } // TOF
489 }
490
491 else {
492 if(IsTofInfoValid()) {
493 bool okpid = false;
494 for(int i = 0; i < 5; i++) {
495 if(pidcase[i] && pdfCalculate(chiTof(i),1) > pdfCalculate(m_tofpid->pdfMinSigmaCut(),1.5))
496 if(!okpid) okpid = true;
497 }
498 if(okpid) {
499 m_ndof++;
500 for(int i = 0; i < 5; i++) {
501 pdf[i] *= pdfTof(i);
502 }
503 }
504 } // TOF
505
506
507
508 //
509 // EndCap Tof
510 //
511
512 if(IsTofEInfoUsed()) {
513 if(IsTofEInfoValid()) {
514 bool okpid = false;
515 for(int i = 0; i < 5; i++) {
516 if(pidcase[i]&& pdfCalculate(chiTofE(i),1) > pdfCalculate(m_tofepid->pdfMinSigmaCut(),1.5))
517 if(!okpid) okpid = true;
518 }
519 if(okpid) {
520 // m_ndof++;
521 // for(int i = 0; i < 5; i++) pdf[i] *= pdfTofE(i);
522 }
523 } // EndCap TOF
524 }
525 }
526
527 }
528
529 // Secondary TOF correction
530 if(IsTofCorrInfoUsed()) {
531 if(IsTofCorrInfoValid()) {
532 bool okpid = false;
533 for(int i = 0; i < 5; i++) {
534 if(pidcase[i] && pdfCalculate(chiTofCorr(i),1) > pdfCalculate(m_tofcorrpid->pdfMinSigmaCut(),1.5))
535 if(!okpid) okpid = true;
536 }
537 if(okpid) {
538 m_ndof++;
539 for(int i = 0; i < 5; i++) {
540 pdf[i] *= pdfTofCorr(i);
541 }
542 }
543 }
544 }
545
546
547 //
548 // Barrel TOF Q
549 //
550
551 if(IsTofQInfoValid()) {
552 bool okpid = false;
553 for(int i = 0; i < 5; i++) {
554 if(pidcase[i])
555 if(!okpid) okpid = true;
556 }
557 if(okpid) {
558 // m_ndof++;
559 for(int i = 0; i < 5; i++) pdf[i] *= pdfTofQ(i);
560 }
561 } // TofQ
562
563 //
564 // Emc PID
565 //
566 if(IsEmcInfoUsed()) {
567 if(IsEmcInfoValid()) {
568 bool okpid = false;
569 for(int i = 0; i < 5; i++) {
570 if(pidcase[i]&&pdfEmc(i)>0)
571 if(!okpid) okpid = true;
572 }
573 if(okpid) {
574 m_ndof++;
575 for(int i = 0; i < 5; i++) {
576 pdf[i] *= pdfEmc(i);
577 }
578 } // Emc Pid
579 }
580 }
581 if(IsMucInfoUsed()) {
582 if(IsMucInfoValid()) {
583 bool okpid = false;
584 for(int i = 0; i < 5; i++) {
585 if(pidcase[i]&&pdfMuc(i)>0)
586 if(!okpid) okpid = true;
587 }
588 if(okpid) {
589 m_ndof++;
590 for(int i = 0; i < 5; i++) {
591 pdf[i] *= pdfMuc(i);
592 }
593 }
594 } // Emc Pid
595 }
596
597
598
599 if(m_ndof <= 0) return irc;
600 for(int i = 0; i < 5; i++) {
601 m_pdf[i] = pdf[i];
602 m_TotalLikelihood += pdf[i];
603 }
604 for(int i = 0; i < 5; i++) {
605 m_likelihoodfraction[i] = pdf[i]/m_TotalLikelihood;
606 }
607
608
609 irc = 0;
610 return irc;
611}
int onlyProton() const
double pdfCalculate(double offset, double sigma)
int onlyMuon() const
int onlyKaon() const
int onlyElectron() const
int onlyPion() const
double pdfEmc(int n)
double pdfTofC(int n)
bool IsTofEInfoValid() const
bool IsEmcInfoValid() const
double pdfDedx(int n)
double chiTofE(int n) const
bool IsTofCorrInfoValid() const
bool IsTofCInfoValid() const
bool IsTofInfoValid() const
double pdfTof(int n)
bool IsTofQInfoValid() const
bool IsDedxInfoValid() const
double pdfMuc(int n)
double pdfTofCorr(int n)
bool IsMucInfoValid() const
double pdf(int n) const
Definition: ParticleID.h:118
double chiTof(int n) const
double pdfTofQ(int n)
double chiTofCorr(int n) const
double chiDedx(int n) const

◆ ndof()

int ParticleID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 115 of file ParticleID.h.

115{return m_ndof;}

◆ neuronPIDCalculation()

int ParticleID::neuronPIDCalculation ( )
protected

◆ neuronStat()

int ParticleID::neuronStat ( ) const
inline

Definition at line 144 of file ParticleID.h.

144{return IsPidInfoValid();}
bool IsPidInfoValid() const

◆ neuronVal()

double ParticleID::neuronVal ( ) const
inline

Definition at line 145 of file ParticleID.h.

145 {
146 if(lhf(0)>0.02) return 1.0;
147 if(lhf(1)>0.02) return 8.5;
148 if(lhf(2)>0.02) return 2.0;
149 if(lhf(3)>0.02) return 4.0;
150 if(lhf(4)>0.02) return 5.0;
151 }
double lhf(int n) const
Definition: ParticleID.h:119

◆ offset()

double ParticleID::offset ( int  i)
inline

Definition at line 153 of file ParticleID.h.

153 {
154 return m_tofcorrpid->offset(i);
155 }
double offset(int n) const
Definition: TofCorrPID.h:26

◆ particleIDCalculation()

int ParticleID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

Definition at line 250 of file ParticleID.cxx.

250 {
251 int irc = -1;
252 bool valid = IsDedxInfoValid() || IsTofInfoValid()||IsTofEInfoValid()
255
256 if(!valid) return irc;
257
258 double chisq[5];
259 bool pidcase[5];
260 for(int i = 0; i < 5; i++) {
261 chisq[i] = 0;
262 pidcase[i] = false;
263 }
264
265 if((m_pidcase & onlyElectron()) == onlyElectron()) pidcase[0] = true;
266 if((m_pidcase & onlyMuon()) == onlyMuon()) pidcase[1] = true;
267 if((m_pidcase & onlyPion()) == onlyPion()) pidcase[2] = true;
268 if((m_pidcase & onlyKaon()) == onlyKaon()) pidcase[3] = true;
269 if((m_pidcase & onlyProton()) == onlyProton()) pidcase[4] = true;
270
271 //
272 // dEdx PID
273 //
274 if(IsDedxInfoUsed()) {
275 if(IsDedxInfoValid()) {
276 bool okpid = false;
277 for(int i = 0; i < 5; i++) {
278 if(pidcase[i] && (fabs(chiDedx(i)) < m_dedxpid->chiMinCut()))
279 if(!okpid) okpid = true;
280 }
281 if(okpid) {
282 m_ndof++;
283 for(int i = 0; i < 5; i++) chisq[i] += chiDedx(i)*chiDedx(i);
284
285
286 }
287 } // dE/dx
288 }
289 //
290 // Barrel TOF
291 //
292
293 if(IsTofInfoUsed()|IsTof1InfoUsed()|IsTof2InfoUsed() | IsTofCInfoUsed())
294 { if(IsTofCInfoUsed())
295 {
296 if(IsTofCInfoValid()) {
297 bool okpid = false;
298 for(int i = 0; i < 5; i++) {
299 if(pidcase[i] && (fabs(chiTofC(i)) < m_tofcpid->chiMinCut()))
300 if(!okpid) okpid = true;
301 }
302 if(okpid) {
303 m_ndof++;
304 for(int i = 0; i < 5; i++) chisq[i] += chiTofC(i)*chiTofC(i);
305 }
306 } // TOF1
307 }
308 else {
309 if(IsTofInfoValid()) {
310 bool okpid = false;
311 for(int i = 0; i < 5; i++) {
312 if(pidcase[i] && (fabs(chiTof(i)) < m_tofpid->chiMinCut()))
313 if(!okpid) okpid = true;
314 }
315 if(okpid) {
316 m_ndof++;
317 for(int i = 0; i < 5; i++) chisq[i] += chiTof(i)*chiTof(i);
318 }
319 } // TOF1
320
321
322 //
323 // EndCap Tof
324 //
325
326 if(IsTofEInfoUsed()) {
327 if(IsTofEInfoValid()) {
328 bool okpid = false;
329 for(int i = 0; i < 5; i++) {
330 if(pidcase[i] && (fabs(chiTofE(i)) < m_tofepid->chiMinCut()))
331 if(!okpid) okpid = true;
332 }
333 if(okpid) {
334 m_ndof++;
335 for(int i = 0; i < 5; i++) chisq[i] += chiTofE(i)*chiTofE(i);
336 }
337 } // EndCap TOF
338 }
339
340 }
341 }
342
343 // Secondary TOF correction
344 if(IsTofCorrInfoUsed()) {
345 if(IsTofCorrInfoValid()) {
346 bool okpid = false;
347 for(int i = 0; i < 5; i++) {
348 // if(pidcase[i] && (fabs(chiTofCorr(i)) < m_tofcorrpid->chiMinCut()))
349 if(pidcase[i] && ( chiTofCorr(i) < 6.0 && chiTofCorr(i) > -4.0 ) )
350 if(!okpid) okpid = true;
351 }
352 if(okpid) {
353 m_ndof++;
354 for(int i = 0; i < 5; i++) chisq[i] += chiTofCorr(i)*chiTofCorr(i);
355 }
356 }
357 }
358
359 //
360 // Barrel TOF Q
361 //
362
363 if(IsTofQInfoUsed()) {
364 if(IsTofQInfoValid()) {
365 bool okpid = false;
366 for(int i = 0; i < 5; i++) {
367 if(pidcase[i] && (fabs(chiTofQ(i)) < m_tofqpid->chiMinCut()))
368 if(!okpid) okpid = true;
369 }
370 if(okpid) {
371 m_ndof++;
372 for(int i = 0; i < 5; i++) chisq[i] += chiTofQ(i)*chiTofQ(i);
373 }
374 } // TofQ
375 }
376
377 // Muc Pid
378 if(IsMucInfoUsed()) {
379 if(IsMucInfoValid()) {
380 bool okpid = false;
381 for(int i = 0; i < 5; i++) {
382 if(pidcase[i] && (fabs(chiMuc(i)) < m_mucpid->chiMinCut()))
383 if(!okpid) okpid = true;
384 }
385 if(okpid) {
386 m_ndof++;
387 for(int i = 0; i < 5; i++) chisq[i] += chiMuc(i)*chiMuc(i);
388 }
389 } // Muc Pid
390 }
391
392
393 // Emc PID
394 if(IsEmcInfoUsed()) {
395 if(IsEmcInfoValid()) {
396 bool okpid = false;
397 for(int i = 0; i < 5; i++) {
398 if(pidcase[i] && (fabs(chiEmc(i)) < m_emcpid->chiMinCut()))
399 if(!okpid) okpid = true;
400 }
401 if(okpid) {
402 m_ndof++;
403 for(int i = 0; i < 5; i++) chisq[i] += chiEmc(i)*chiEmc(i);
404 }
405 } // Emc Pid
406 }
407
408
409 if(m_ndof <= 0) return irc;
410
411
412 for(int i = 0; i < 5; i++) {
413 m_chisq[i] = chisq[i];
414 m_prob[i] = probCalculate(chisq[i], m_ndof);
415 }
416
417
418 irc = 0;
419 return irc;
420}
double probCalculate(double chi2, int n)
double chiMuc(int n) const
double chiTofQ(int n) const
double chiTofC(int n) const
double chiEmc(int n) const

◆ pdf()

double ParticleID::pdf ( int  n) const
inline

Definition at line 118 of file ParticleID.h.

118{ return m_pdf[n];}

Referenced by LikelihoodCalculation().

◆ pdfDedx()

double ParticleID::pdfDedx ( int  n)
inline

Referenced by LikelihoodCalculation().

◆ pdfElectron()

double ParticleID::pdfElectron ( ) const
inline

Definition at line 129 of file ParticleID.h.

129{return m_pdf[0];}

◆ pdfEmc()

double ParticleID::pdfEmc ( int  n)
inline

Referenced by LikelihoodCalculation().

◆ pdfKaon()

double ParticleID::pdfKaon ( ) const
inline

Definition at line 132 of file ParticleID.h.

132{return m_pdf[3];}

◆ pdfMuc()

double ParticleID::pdfMuc ( int  n)
inline

Referenced by LikelihoodCalculation().

◆ pdfMuon()

double ParticleID::pdfMuon ( ) const
inline

Definition at line 130 of file ParticleID.h.

130{return m_pdf[1];}

◆ pdfPion()

double ParticleID::pdfPion ( ) const
inline

Definition at line 131 of file ParticleID.h.

131{return m_pdf[2];}

◆ pdfProton()

double ParticleID::pdfProton ( ) const
inline

Definition at line 133 of file ParticleID.h.

133{return m_pdf[4];}

◆ pdfTof()

double ParticleID::pdfTof ( int  n)
inline

Referenced by LikelihoodCalculation().

◆ pdfTofC()

double ParticleID::pdfTofC ( int  n)
inline

Referenced by LikelihoodCalculation().

◆ pdfTofCorr()

double ParticleID::pdfTofCorr ( int  n)
inline

Referenced by LikelihoodCalculation().

◆ pdfTofE()

double ParticleID::pdfTofE ( int  n)
inline

◆ pdfTofQ()

double ParticleID::pdfTofQ ( int  n)
inline

Referenced by LikelihoodCalculation().

◆ prob()

double ParticleID::prob ( int  n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 114 of file ParticleID.h.

114{ return m_prob[n];}

Referenced by DQAKsKpi::execute(), DQASelBhabha::execute(), DQASelDimu::execute(), and DQASelHadron::execute().

◆ probDedx()

double ParticleID::probDedx ( int  n) const
inline

◆ probElectron()

double ParticleID::probElectron ( ) const
inline

Definition at line 121 of file ParticleID.h.

121{return m_prob[0];}

Referenced by Gam4pikp::execute(), DQASelBhabha::execute(), DQASelDimu::execute(), DQASelHadron::execute(), and BeamParams::execute().

◆ probEmc()

double ParticleID::probEmc ( int  n) const
inline

◆ probKaon()

◆ probMuc()

double ParticleID::probMuc ( int  n) const
inline

◆ probMuon()

double ParticleID::probMuon ( ) const
inline

Definition at line 122 of file ParticleID.h.

122{return m_prob[1];}

Referenced by Gam4pikp::execute(), DQASelBhabha::execute(), DQASelDimu::execute(), DQASelHadron::execute(), and BeamParams::execute().

◆ probPion()

◆ probProton()

double ParticleID::probProton ( ) const
inline

◆ probTof()

double ParticleID::probTof ( int  n) const
inline

◆ probTofC()

double ParticleID::probTofC ( int  n) const
inline

◆ probTofCorr()

double ParticleID::probTofCorr ( int  n) const
inline

◆ probTofE()

double ParticleID::probTofE ( int  n) const
inline

◆ probTofQ()

double ParticleID::probTofQ ( int  n) const
inline

◆ setMethod()

◆ setNhitCut()

void ParticleID::setNhitCut ( const int  nhitcuth = 5)
inline

Definition at line 89 of file ParticleID.h.

89{m_nhitcut = nhitcuth;}

◆ sigma()

double ParticleID::sigma ( int  i)
inline

Definition at line 156 of file ParticleID.h.

156 {
157 return m_tofcorrpid->sigma(i);
158 }
double sigma(int n) const
Definition: TofCorrPID.h:27

◆ usePidSys()


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