4#include "ParticleID/Tof2PID.h"
7#include "EvtRecEvent/EvtRecTrack.h"
8#include "MdcRecEvent/RecMdcTrack.h"
9#include "TofRecEvent/RecTofTrack.h"
10#include "DstEvent/TofHitStatus.h"
12#include "TofHitStatus.h"
15Tof2PID * Tof2PID::m_pointer = 0;
18 if(!m_pointer) m_pointer =
new Tof2PID();
28 m_pars[4]= 0.00165226;
29 m_pars[5]= -1.86503e-06;
30 m_pars[6]= 6.07045e-10;
34 m_pars[10]= 0.00252878;
44 for(
int i = 0; i < 5; i++) {
68 double ptrk = mdcTrk->
p();
75 SmartRefVector<RecTofTrack> tofTrk = recTrk->
tofTrack();
76 SmartRefVector<RecTofTrack>::iterator it;
78 const std::vector<TTofTrack* >& tofTrk = recTrk->
tofTrack();
79 std::vector<TTofTrack* >::const_iterator it;
83 std::vector<int> tof2count;
85 for(it = tofTrk.begin(); it!=tofTrk.end(); it++,goodtof2trk++) {
86 unsigned int st = (*it)->status();
91 if( hitst->
layer()==2 ) tof2count.push_back(goodtof2trk);
95 if(tof2count.size()!=1)
return irc;
96 it = tofTrk.begin()+tof2count[0];
97 double tof = (*it)->tof();
100 if(tof <=0 )
return irc;
103 int cntr = (*it)->tofID();
104 double path = ((*it)->path())*10.0;
112 m_zhit2 = ((*it)->zrhit())*10;
115 m_mass2 = ptrk * ptrk * (1/beta2 -1);
116 if ((m_mass2>20)||(m_mass2<-1))
return irc;
118 double chitemp = 99.;
120 double sig_tmp = (*it)->sigma(0);
121 for(
int i = 0; i < 5; i++) {
122 m_offset[i] = tof - (*it)->texp(i)-(*it)->toffset(i);
124 m_sigma[i] = 1.2*sig_tmp;
125 if(i<2) m_sigma[i]=sig_tmp;
128 m_chi[i] = m_offset[i]/m_sigma[i];
129 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
131 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
137 if(fabs(m_chimin) >
chiMinCut())
return irc;
141 for(
int i = 0; i < 5; i++) {
170 betagamma=ptrk/139.57;
174 betagamma=ptrk/493.68;
179 betagamma=ptrk/938.27;
191 double beta = betagamma / TMath::Sqrt(1 + betagamma*betagamma);
192 double Q0 =
sampleQ0(betagamma,beta);
193 double func[15]= {0.};
201 func[7]=1./(0.89*0.89+z*z);
205 func[11]=1./sqrt(Q0);
207 func[13]=z*z/sqrt(Q0);
208 func[14]=z*z*z/sqrt(Q0);
210 for(
int i=0; i<15; i++) {
211 offset+= m_pars[i]*func[i];
220 double cosz =
cos(ztof/1000.0);
225 sigma = 0.115816 -0.0933215*cosz+ 0.0788252*cosz*cosz;
230 sigma = 0.121536 -0.0935898*cosz+0.0748771*cosz*cosz;
235 sigma = 0.106882-0.0147375*cosz+0.027491*cosz*cosz;
239 sigma =0.106882 -0.0147375*cosz +0.027491 *cosz*cosz;
244 sigma = 0.168489 -0.131762*cosz+ 0.105708*cosz*cosz;
264 double val = p1 / TMath::Power(beta, p4) *
265 ( p2- TMath::Power(beta, p4) -
266 TMath::Log(p3 + TMath::Power(1/betagamma, p5)));
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 offset(int n) const
double sigmaTof2(int n, int cntr, double ptrk, double ztof, double m_ph2, double charge)
static Tof2PID * instance()
double sigma(int n) const
double sampleQ0(double betagamma, double beta)
int particleIDCalculation()
double offsetTof2(int n, int cntr, double ptrk, double ztof, double m_ph2, double charge)
unsigned int layer() const
void setStatus(unsigned int status)