4#include "ParticleID/Tof1PID.h"
7#include "MdcRecEvent/RecMdcTrack.h"
8#include "TofRecEvent/RecTofTrack.h"
9#include "EvtRecEvent/EvtRecTrack.h"
10#include "DstEvent/TofHitStatus.h"
12#include "TofHitStatus.h"
15Tof1PID * Tof1PID::m_pointer = 0;
17 if(!m_pointer) m_pointer =
new Tof1PID();
24 m_pars[2]= -0.0733139;
26 m_pars[4]= 0.00145052;
27 m_pars[5]= -1.72471e-06;
28 m_pars[6]= 5.92726e-10;
29 m_pars[7]= -0.0645428;
30 m_pars[8]= -0.00143637;
32 m_pars[10]= 0.0101188;
35 m_pars[13]= -0.443142;
41 for(
int i = 0; i < 5; i++) {
65 double ptrk = mdcTrk->
p();
71 SmartRefVector<RecTofTrack> tofTrk = recTrk->
tofTrack();
72 SmartRefVector<RecTofTrack>::iterator it;
74 const std::vector<TTofTrack* >& tofTrk = recTrk->
tofTrack();
75 std::vector<TTofTrack* >::const_iterator it;
79 std::vector<int> tof1count;
81 for(it = tofTrk.begin(); it!=tofTrk.end(); it++,goodtof1trk++) {
82 unsigned int st = (*it)->status();
86 if( hitst->
layer()==1 ) tof1count.push_back(goodtof1trk);
89 if(tof1count.size()!=1)
return irc;
90 it = tofTrk.begin()+tof1count[0];
91 double tof = (*it)->tof();
95 int cntr = (*it)->tofID();
96 double path = ((*it)->path())*10.0;
99 m_zhit1 = ((*it)->zrhit())*10;
101 m_mass2 = ptrk * ptrk * (1/beta2 -1);
102 if ((m_mass2>20)||(m_mass2<-1))
return irc;
103 if(tof <=0 )
return irc;
104 double chitemp = 99.;
106 double sigma_tmp= (*it)->sigma(0);
107 for(
int i = 0; i < 5; i++) {
109 m_offset[i] = tof - (*it)->texp(i)-(*it)->toffset(i);
111 m_sigma[i] = 1.2*sigma_tmp;
112 if(i<2) m_sigma[i]=sigma_tmp;
115 m_chi[i] = m_offset[i]/m_sigma[i];
117 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
119 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
124 if(fabs(m_chimin) >
chiMinCut())
return irc;
125 for(
int i = 0; i < 5; i++) {
154 betagamma=ptrk/139.57;
158 betagamma=ptrk/493.68;
163 betagamma=ptrk/938.27;
175 double beta = betagamma / TMath::Sqrt(1 + betagamma*betagamma);
176 double Q0 =
sampleQ0(betagamma,beta);
177 double func[15]= {0.};
185 func[7]=1./(0.84*0.84+z*z);
189 func[11]=1./sqrt(Q0);
191 func[13]=z*z/sqrt(Q0);
192 func[14]=z*z*z/sqrt(Q0);
194 for(
int i=0; i<15; i++) {
195 offset+= m_pars[i]*func[i];
204 double cosz =
cos(ztof/1000.0);
209 sigma = 0.132405-0.135638*cosz+0.105528*cosz*cosz;
214 sigma = 0.164057 -0.199648*cosz+ 0.139481*cosz*cosz;
219 sigma = 0.132943-0.0996678*cosz+0.0785578*cosz*cosz;
223 sigma = 0.146572 -0.124672*cosz+0.0920656*cosz*cosz;
228 sigma = 0.1513 -0.0806081*cosz+0.0607409*cosz*cosz;
243 double val = 0.261/ TMath::Power(beta, 1.96) *( 5.43- TMath::Power(beta, 1.96) -TMath::Log(1.12 + TMath::Power(1/betagamma, 0.386)));
double cos(const BesAngle a)
SmartRefVector< RecTofTrack > tofTrack()
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
double pdfMinSigmaCut() const
double sampleQ0(double betagamma, double beta)
double sigma(int n) const
double offsetTof1(int n, int cntr, double ptrk, double ztof, double m_ph1, double charge)
int particleIDCalculation()
static Tof1PID * instance()
double sigmaTof1(int n, int cntr, double ptrk, double ztof, double m_ph1, double charge)
double offset(int n) const
unsigned int layer() const
void setStatus(unsigned int status)