CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
MrpcPID Class Reference

#include <MrpcPID.h>

+ Inheritance diagram for MrpcPID:

Public Member Functions

 ~MrpcPID ()
 
void init ()
 
void calculate ()
 
bool IsPidInfoValid () const
 
double chi (int n) const
 
double prob (int n) const
 
double sigma (int n) const
 
double offset (int n) const
 
int ndof () const
 
double mass2 () const
 
int part () const
 
double rhit () const
 
int neuronPID () const
 
- Public Member Functions inherited from ParticleIDBase
 ParticleIDBase ()
 
virtual ~ParticleIDBase ()
 
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 useMrpc () 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
 
int MrpcValid () const
 
void set_path (const char *s_path=0)
 
void set_path (std::string s_path)
 

Static Public Member Functions

static MrpcPIDinstance ()
 

Protected Member Functions

int neuronPIDCalculation ()
 
int particleIDCalculation ()
 
int LikelihoodCalculation ()
 
- Protected Member Functions inherited from ParticleIDBase

Additional Inherited Members

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

Detailed Description

Definition at line 10 of file MrpcPID.h.

Constructor & Destructor Documentation

◆ ~MrpcPID()

MrpcPID::~MrpcPID ( )
inline

Definition at line 14 of file MrpcPID.h.

14{;}

Member Function Documentation

◆ calculate()

void MrpcPID::calculate ( )
virtual

Implements ParticleIDBase.

Definition at line 39 of file MrpcPID.cxx.

39 {
40 if(particleIDCalculation()==0) m_ndof=1;
41}
int particleIDCalculation()
Definition MrpcPID.cxx:43

◆ chi()

double MrpcPID::chi ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 19 of file MrpcPID.h.

19{return m_chi[n];}
const Int_t n

◆ init()

void MrpcPID::init ( )
virtual

Implements ParticleIDBase.

Definition at line 25 of file MrpcPID.cxx.

25 {
26 for(int i = 0; i < 5; i++) {
27 m_chi[i] = 99.0;
28 m_prob[i] = -1.0;
29 m_offset[i] = 99.0;
30 m_sigma[i] = 1.0;
31 }
32 m_chimin = 99.;
33 m_pdfmin =99.;
34 m_ndof = 0;
35 m_mass2 = -999;
36 m_rhit = -99;
37}

Referenced by ParticleID::init().

◆ instance()

MrpcPID * MrpcPID::instance ( )
static

Definition at line 16 of file MrpcPID.cxx.

16 {
17 if(!m_pointer) m_pointer = new MrpcPID();
18 return m_pointer;
19}

Referenced by ParticleID::init().

◆ IsPidInfoValid()

bool MrpcPID::IsPidInfoValid ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 18 of file MrpcPID.h.

18{return (m_ndof > 0); }

◆ LikelihoodCalculation()

int MrpcPID::LikelihoodCalculation ( )
inlineprotectedvirtual

Implements ParticleIDBase.

Definition at line 32 of file MrpcPID.h.

32{return -1;}

◆ mass2()

double MrpcPID::mass2 ( ) const
inline

Definition at line 24 of file MrpcPID.h.

24{return m_mass2;}

◆ ndof()

int MrpcPID::ndof ( ) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 23 of file MrpcPID.h.

23{return m_ndof;}

◆ neuronPID()

int MrpcPID::neuronPID ( ) const
inline

Definition at line 27 of file MrpcPID.h.

27{return -1;}

◆ neuronPIDCalculation()

int MrpcPID::neuronPIDCalculation ( )
inlineprotected

Definition at line 30 of file MrpcPID.h.

30{ return -1;}

◆ offset()

double MrpcPID::offset ( int n) const
inline

Definition at line 22 of file MrpcPID.h.

22{return m_offset[n];}

◆ part()

int MrpcPID::part ( ) const
inline

Definition at line 25 of file MrpcPID.h.

25{return m_part;}

◆ particleIDCalculation()

int MrpcPID::particleIDCalculation ( )
protectedvirtual

Implements ParticleIDBase.

Definition at line 43 of file MrpcPID.cxx.

43 {
44 int irc = -1;
45 EvtRecTrack* recTrk = PidTrk();
46 if(!(recTrk->isMdcTrackValid())) return irc;
47 RecMdcTrack* mdcTrk = recTrk->mdcTrack();
48
49 double ptrk = mdcTrk->p();
50 // double cost = cos(mdcTrk->theta());
51 // double charge = mdcTrk->charge();
52
53 if(!(recTrk->isTofTrackValid())) return irc;
54
55#ifndef BEAN
56 SmartRefVector<RecTofTrack> tofTrk = recTrk->tofTrack();
57 SmartRefVector<RecTofTrack>::iterator it;//=tofTrk.begin();
58#else
59 const std::vector<TTofTrack* >& tofTrk = recTrk->tofTrack();
60 std::vector<TTofTrack* >::const_iterator it;//=tofTrk.begin();
61#endif
62
63 TofHitStatus *hitst = new TofHitStatus;
64 std::vector<int> tofecount;
65 int goodtofetrk=0;
66 for(it = tofTrk.begin(); it!=tofTrk.end(); it++,goodtofetrk++) {
67 unsigned int st = (*it)->status();
68 hitst->setStatus(st);
69 if( (hitst->is_barrel()) ) continue;
70 if( !(hitst->is_counter()) ) continue;
71 if( hitst->layer()==1 ) tofecount.push_back(goodtofetrk);
72 }
73 delete hitst;
74 if(tofecount.size()!=1) return irc;//not tof2 track or more than 1 tracks
75 it = tofTrk.begin()+tofecount[0];
76
77
78 double tof = (*it)->tof();
79 if(tof <=0 ) return irc;
80 double path = (*it)->path();
81 m_rhit = (*it)->zrhit();
82
83
84 double beta2 = path*path/velc()/velc()/tof/tof;
85 m_mass2 = ptrk * ptrk * (1/beta2 -1);
86
87
88
89 double chitemp = 99.;
90 double pdftemp = 0;
91
92
93
94
95 double xmass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
96
97 for(int i = 0; i < 5; i++) {
98
99
100 double texp = (*it)->texp(i);
101 m_offset[i] = tof - texp;
102
103
104
105
106
107 double sigma_tmp= (*it)->sigma(i);
108
109
110 if (sigma_tmp!=0) m_sigma[i]=sigma_tmp;
111 else m_sigma[i]=0.08;
112
113
114 m_chi[i] = m_offset[i]/m_sigma[i];
115
116
117 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
118 double ppp = pdfCalculate(m_chi[i],1);
119 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
120 }
121 m_chimin = chitemp;
122
123 // calculate prob
124
125 for(int i = 0; i < 5; i++)
126 m_prob[i] = probCalculate(m_chi[i]*m_chi[i], 1);
127
128
129
130 m_ndof = 1;
131 irc = 0;
132 return irc;
133}
const double xmass[5]
Definition Gam4pikp.cxx:50
const double p() const
Definition DstMdcTrack.h:58
SmartRefVector< RecTofTrack > tofTrack()
Definition EvtRecTrack.h:69
bool isTofTrackValid()
Definition EvtRecTrack.h:54
bool isMdcTrackValid()
Definition EvtRecTrack.h:47
RecMdcTrack * mdcTrack()
Definition EvtRecTrack.h:61
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
static std::string path
bool is_barrel() const
unsigned int layer() const
void setStatus(unsigned int status)
bool is_counter() const

Referenced by calculate().

◆ prob()

double MrpcPID::prob ( int n) const
inlinevirtual

Implements ParticleIDBase.

Definition at line 20 of file MrpcPID.h.

20{return m_prob[n];}

◆ rhit()

double MrpcPID::rhit ( ) const
inline

Definition at line 26 of file MrpcPID.h.

26{return m_rhit;}

◆ sigma()

double MrpcPID::sigma ( int n) const
inline

Definition at line 21 of file MrpcPID.h.

21{return m_sigma[n];}

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