43 {
44 int irc = -1;
48
49#ifndef BEAN
50 SmartRefVector<RecTofTrack> tofTrackCol = recTrk->
tofTrack();
51 SmartRefVector<RecTofTrack>::iterator it;
52#else
53 const std::vector<TTofTrack* >& tofTrackCol = recTrk->
tofTrack();
54 std::vector<TTofTrack* >::const_iterator it;
55#endif
56
57 bool isMRPC = false;
58 if( tofTrackCol.size()!=1 && tofTrackCol.size()!=3 ) { return irc; }
59 else {
61 if( tofTrackCol.size()==1 ) {
62 it = tofTrackCol.begin();
64 bool isRaw = hitst->
is_raw();
65 if( isRaw ) { return irc; }
70 if( !isReadout || !isCounter || !isCluster ) { return irc; }
71 }
72 else if( tofTrackCol.size()==3 ) {
73 unsigned int icounter = -1;
74 unsigned int inumber = 0;
75 for( it = tofTrackCol.begin(); it != tofTrackCol.end(); it++, inumber++ ) {
77 bool isRaw = hitst->
is_raw();
78 if( isRaw ) continue;
80 if( !isMRPC ) { return irc; }
84 if( !isReadout && isCounter && isCluster ) { icounter = inumber; }
85 }
86 if( icounter == -1 ) { return irc; }
87 it = tofTrackCol.begin() + icounter;
88 }
89 }
90
91 double tof = (*it)->tof();
92 if( tof <= 0 ) { return irc; }
93 double path = (*it)->path();
94 m_rhit = (*it)->zrhit();
96 double beta2 = beta*beta;
98 double ptrk = mdcTrk->
p();
99 m_mass2 =
ptrk*
ptrk*(1.0/beta2 -1.0);
100
101 double chitemp = 99.;
102 double pdftemp = 0;
103 for( unsigned int i=0; i<5; i++ ) {
104 double texp = (*it)->texp(i);
105 m_offset[i] = tof - texp - (*it)->toffset(i);
106 double sigma_tmp = (*it)->sigma(0);
107 if( !isMRPC ) {
108 if( sigma_tmp>0 ) {
109 if( i<2 ) { m_sigma[i] = sigma_tmp; }
110 else { m_sigma[i] = 1.2*sigma_tmp; }
111 }
112 else { m_sigma[i] = 0.12; }
113 }
114 else {
115
116 int strip = (*it)->strip();
117 if( strip<0 || strip>11 ) { m_sigma[i] = 0.065; }
118 else {
120 if( strip==0 ) { p0=0.16;
p1=0.0; }
121 else if( strip==1 ) { p0=0.051094;
p1=0.019467; }
122 else if( strip==2 ) { p0=0.056019;
p1=0.012964; }
123 else if( strip==3 ) { p0=0.043901;
p1=0.015933; }
124 else if( strip==4 ) { p0=0.049750;
p1=0.010473; }
125 else if( strip==5 ) { p0=0.048345;
p1=0.008545; }
126 else if( strip==6 ) { p0=0.046518;
p1=0.009038; }
127 else if( strip==7 ) { p0=0.048803;
p1=0.007251; }
128 else if( strip==8 ) { p0=0.047523;
p1=0.008434; }
129 else if( strip==9 ) { p0=0.042187;
p1=0.010307; }
130 else if( strip==10 ) { p0=0.050337;
p1=0.005951; }
131 else if( strip==11 ) { p0=0.054740;
p1=0.005629; }
132 if(
ptrk<0.05 ) { m_sigma[i] = p0+
p1/0.05; }
133 else { m_sigma[i] = p0+
p1/
ptrk; }
134 }
135 }
136 m_chi[i] = m_offset[i]/m_sigma[i];
137
138 if( fabs(m_chi[i]) < chitemp ) { chitemp = fabs(m_chi[i]); }
140 if( fabs(ppp) > pdftemp ) { pdftemp = fabs(ppp); }
141 }
142 m_chimin = chitemp;
143
144
145
146 for( unsigned int i=0; i<5; i++ ) {
148 }
149
150 irc = 0;
151 return irc;
152}
SmartRefVector< RecTofTrack > tofTrack()
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
void setStatus(unsigned int status)