43 {
44 int irc = -1;
48
49 double ptrk = mdcTrk->
p();
50
51
52
54
55#ifndef BEAN
56 SmartRefVector<RecTofTrack> tofTrk = recTrk->
tofTrack();
57 SmartRefVector<RecTofTrack>::iterator it;
58#else
59 const std::vector<TTofTrack* >& tofTrk = recTrk->
tofTrack();
60 std::vector<TTofTrack* >::const_iterator it;
61#endif
62
64 std::vector<int> tofecount;
65 int goodtofetrk=0;
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);
72 }
73 delete hitst;
74 if(tofecount.size()!=1) return irc;
75 it = tofTrk.begin()+tofecount[0];
76
77
78
79
80
81 double tof = (*it)->tof();
82 if(tof <=0 ) return irc;
83 double path = (*it)->path();
84
85 m_rhit = (*it)->zrhit();
86
87
89 m_mass2 = ptrk * ptrk * (1/beta2 -1);
90
91
92
93 double chitemp = 99.;
94 double pdftemp = 0;
95 for(int i = 0; i < 5; i++) {
96
97
98 double texp = (*it)->texp(i);
99
100 m_offset[i] = tof - texp-(*it)->toffset(i);
101 double sigma_tmp= (*it)->sigma(0);
102
103
104
105
106
107 if(sigma_tmp!=0) {
108 m_sigma[i] = 1.2*sigma_tmp;
109 if(i<2) m_sigma[i]=sigma_tmp;
110 }
111 else m_sigma[i]=0.12;
112
113
114
115
116
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);
121 }
122 m_chimin = chitemp;
123
124
125
126
127
128 for(int i = 0; i < 5; i++)
130
131 m_ndof = 1;
132 irc = 0;
133 return irc;
134}
SmartRefVector< RecTofTrack > tofTrack()
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
unsigned int layer() const
void setStatus(unsigned int status)