59 {
60 int irc = -1;
61
62 EvtRecTrack* recTrk =
PidTrk();
64 RecMdcTrack* mdcTrk = recTrk->
mdcTrack();
65 double ptrk = mdcTrk->
p();
67
69
70#ifndef BEAN
71 SmartRefVector<RecTofTrack> tofTrk = recTrk->
tofTrack();
72 SmartRefVector<RecTofTrack>::iterator it;
73#else
74 const std::vector<TTofTrack* >& tofTrk = recTrk->
tofTrack();
75 std::vector<TTofTrack* >::const_iterator it;
76#endif
77
78 TofHitStatus *hitst = new TofHitStatus;
79 std::vector<int> tof1count;
80 int goodtof1trk=0;
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);
87 }
88 delete hitst;
89 if(tof1count.size()!=1) return irc;
90 it = tofTrk.begin()+tof1count[0];
91 double tof = (*it)->tof();
92 m_tof1 = tof;
93
94
95 int cntr = (*it)->tofID();
96 double path = ((*it)->path())*10.0;
98 m_ph1 = (*it)->ph();
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.;
105 double pdftemp = 0;
106 double sigma_tmp= (*it)->sigma(0);
107 for(int i = 0; i < 5; i++) {
108
109 m_offset[i] = tof - (*it)->texp(i)-(*it)->toffset(i);
110 if(sigma_tmp!=0) {
111 m_sigma[i] = 1.2*sigma_tmp;
112 if(i<2) m_sigma[i]=sigma_tmp;
113 }
115 m_chi[i] = m_offset[i]/m_sigma[i];
116
117 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
119 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
120 }
121 m_chimin = chitemp;
122 m_pdfmin = pdftemp;
124 if(fabs(m_chimin) >
chiMinCut())
return irc;
125 for(int i = 0; i < 5; i++) {
127 }
128 irc = 0;
129 return irc;
130}
SmartRefVector< RecTofTrack > tofTrack()
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
double pdfMinSigmaCut() const
double sigmaTof1(int n, int cntr, double ptrk, double ztof, double m_ph1, double charge)
unsigned int layer() const
void setStatus(unsigned int status)