3#include "ParticleID/TofEPID.h"
6#include "MdcRecEvent/RecMdcTrack.h"
7#include "TofRecEvent/RecTofTrack.h"
8#include "EvtRecEvent/EvtRecTrack.h"
9#include "DstEvent/TofHitStatus.h"
11#include "TofHitStatus.h"
14TofEPID * TofEPID::m_pointer = 0;
17 if(!m_pointer) m_pointer =
new TofEPID();
26 for(
int i = 0; i < 5; i++) {
49 double ptrk = mdcTrk->
p();
56 SmartRefVector<RecTofTrack> tofTrk = recTrk->
tofTrack();
57 SmartRefVector<RecTofTrack>::iterator it;
59 const std::vector<TTofTrack* >& tofTrk = recTrk->
tofTrack();
60 std::vector<TTofTrack* >::const_iterator it;
64 std::vector<int> tofecount;
66 for(it = tofTrk.begin(); it!=tofTrk.end(); it++,goodtofetrk++) {
67 unsigned int st = (*it)->status();
71 if( hitst->
layer()==1 ) tofecount.push_back(goodtofetrk);
74 if(tofecount.size()!=1)
return irc;
75 it = tofTrk.begin()+tofecount[0];
81 double tof = (*it)->tof();
82 if(tof <=0 )
return irc;
83 double path = (*it)->path();
85 m_rhit = (*it)->zrhit();
89 m_mass2 = ptrk * ptrk * (1/beta2 -1);
95 for(
int i = 0; i < 5; i++) {
98 double texp = (*it)->texp(i);
100 m_offset[i] = tof - texp-(*it)->toffset(i);
101 double sigma_tmp= (*it)->sigma(0);
108 m_sigma[i] = 1.2*sigma_tmp;
109 if(i<2) m_sigma[i]=sigma_tmp;
111 else m_sigma[i]=0.12;
117 m_chi[i] = m_offset[i]/m_sigma[i];
118 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
120 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
128 for(
int i = 0; i < 5; i++)
147 if(ptrk<0.2) ptemp = 0.2;
148 if(ptrk > 2.1) ptemp = 2.1;
149 double plog = log(ptemp);
150 offset = 0.001*(-28.8481+138.159*plog-249.334*plog*plog);
156 if(ptrk<0.2) ptemp = 0.2;
157 if(ptrk > 2.1) ptemp = 2.1;
158 double plog = log(ptemp);
159 offset = 0.001*(-33.6966+1.91915*plog-0.592320*plog*plog);
164 if(ptrk<0.2) ptemp = 0.2;
165 if(ptrk > 2.1) ptemp = 2.1;
166 double plog = log(ptemp);
167 offset = 0.001*(-27.9965 + 1.213 * plog - 2.02740 * plog * plog);
172 if(ptrk<0.3) ptemp = 0.3;
173 if(ptrk > 2.1) ptemp = 2.1;
174 double plog = log(ptemp);
175 offset = 0.001*(-23.4842 -28.7569 * plog + 78.21* plog *plog);
181 if(ptrk<0.4) ptemp = 0.4;
182 if(ptrk > 2.1) ptemp = 2.1;
183 double plog = log(ptemp);
185 offset = 0.001*(-4.854-110.540*plog+99.8732*plog*plog);
187 offset = 0.001*(27.047-145.120*plog+167.014*plog*plog);
207 if(ptrk < 0.2) ptemp = 0.2;
208 if(ptrk > 2.1) ptemp = 2.1;
209 double plog = log(ptemp);
210 sigma = 0.001 * (109.974 +15.2457 * plog + 36.8139 * plog * plog);
217 if(ptrk < 0.2) ptemp = 0.2;
218 if(ptrk > 2.1) ptemp = 2.1;
219 double plog = log(ptemp);
220 sigma = 0.001 * (96.5077 -2.96232 * plog + 3.12910 * plog * plog);
226 if(ptrk < 0.2) ptemp = 0.2;
227 if(ptrk > 2.1) ptemp = 2.1;
228 double plog = log(ptemp);
229 sigma = 0.001 * (105.447 - 2.08044 * plog + 3.44846 * plog * plog);
235 if(ptrk < 0.3) ptemp = 0.3;
236 if(ptrk > 2.1) ptemp = 2.1;
237 double plog = log(ptemp);
238 sigma = 0.001*(88.8806 - 26.8464 * plog + 113.672 * plog * plog);
243 if(ptrk < 0.5) ptemp = 0.5;
244 if(ptrk > 2.1) ptemp = 2.1;
245 double plog = log(ptemp);
247 sigma = 0.001 * (96.3534 -44.1139 * plog + 53.9805 * plog * plog);
249 sigma = 0.001 * (157.345 -98.7357 * plog + 55.1145 * plog * plog);
SmartRefVector< RecTofTrack > tofTrack()
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
double sigma(int n) const
double sigmaTofE(int n, int cntr, double ptrk, double rtof, double ph, double charge)
static TofEPID * instance()
int particleIDCalculation()
double offset(int n) const
double offsetTofE(int n, int cntr, double ptrk, double rtof, double ph, double charge)
unsigned int layer() const
void setStatus(unsigned int status)