3#include "ParticleID/MrpcPID.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"
14MrpcPID * MrpcPID::m_pointer = 0;
17 if(!m_pointer) m_pointer =
new MrpcPID();
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];
78 double tof = (*it)->tof();
79 if(tof <=0 )
return irc;
80 double path = (*it)->path();
81 m_rhit = (*it)->zrhit();
85 m_mass2 = ptrk * ptrk * (1/beta2 -1);
95 double xmass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272};
97 for(
int i = 0; i < 5; i++) {
100 double texp = (*it)->texp(i);
101 m_offset[i] = tof - texp;
107 double sigma_tmp= (*it)->sigma(i);
110 if (sigma_tmp!=0) m_sigma[i]=sigma_tmp;
111 else m_sigma[i]=0.08;
114 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);
125 for(
int i = 0; i < 5; i++)
SmartRefVector< RecTofTrack > tofTrack()
int particleIDCalculation()
static MrpcPID * instance()
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
unsigned int layer() const
void setStatus(unsigned int status)