133 {
134
135
136 SmartDataPtr<Event::EventHeader> eventHeaderpid(eventSvc_,"/Event/EventHeader");
137 m_run=eventHeaderpid->runNumber();
138
140
141
142
143 if(m_datatof.size()==0 || m_mctof.size()==0)
144 m_tofcorrec=false;
145
146
147
150
151 for(int pid=0; pid<5; ++pid){
152 HepVector zhelix;
153 if(pid==0){
156 }
157 else if(pid==1){
160 }
161 else if(pid==2){
164 }
165 else if(pid==3){
168 }
169 else{
172 }
173
174 double kappa=zhelix[2];
175 double theta=CLHEP::pi/2.0-atan(zhelix[4]);
176 m_p[pid]=1.0/fabs(kappa)/
sin(theta);
177 m_costh[pid]=
cos(theta);
178 }
179 }
180 else{
181 for(int i=0; i<5; ++i){
182 m_p[i]=-99;
183 m_costh[i]=-99;
184 }
185
186 }
187
188
189
190 m_mass[0]=0.000511;
191 m_mass[1]=0.105658;
192 m_mass[2]=0.14;
193 m_mass[3]=0.494;
194 m_mass[4]=0.94;
195
196
197 for(int i=0; i<5; ++i){
198 if(m_tofcorrec){
199 if(m_run>0){
200 m_tofscale1[i]=toflayer1scale(m_p[i]/m_mass[i],fabs(m_costh[i]),m_datatof);
201 m_tofscale2[i]=toflayer2scale(m_p[i]/m_mass[i],fabs(m_costh[i]),m_datatof);
202 }
203 else{
204 m_tofscale1[i]=mctoflayer1scale(m_p[i]/m_mass[i],fabs(m_costh[i]),m_mctof);
205 m_tofscale2[i]=mctoflayer2scale(m_p[i]/m_mass[i],fabs(m_costh[i]),m_mctof);
206 }
207 }
208 else{
209 m_tofscale1[i]=1.0;
210 m_tofscale2[i]=1.0;
211 }
212 }
213
214
215
216 m_eop=-99;
220 if(fabs(m_p[0])>0)
221 m_eop=
energy/fabs(m_p[0]);
222 }
223
224
225
226
229 m_dedxchi[0]= dedxTrk->
chi(0);
230 m_dedxchi[1]= dedxTrk->
chi(1);
231 m_dedxchi[2]= dedxTrk->
chi(2);
232 m_dedxchi[3]= dedxTrk->
chi(3);
233 m_dedxchi[4]= dedxTrk->
chi(4);
234 }
235 else{
236 m_dedxchi[0]=-99;
237 m_dedxchi[1]=-99;
238 m_dedxchi[2]=-99;
239 m_dedxchi[3]=-99;
240 m_dedxchi[4]=-99;
241 }
242
243
244
245
246 m_tofchi[0]=-99;
247 m_tofchi[1]=-99;
248 m_tofchi[2]=-99;
249 m_tofchi[3]=-99;
250 m_tofchi[4]=-99;
251
252 m_tofdt[0]=-99;
253 m_tofdt[1]=-99;
254 m_tofdt[2]=-99;
255 m_tofdt[3]=-99;
256 m_tofdt[4]=-99;
257
258
259 m_tofdt1[0]=-99;
260 m_tofdt1[1]=-99;
261 m_tofdt1[2]=-99;
262 m_tofdt1[3]=-99;
263 m_tofdt1[4]=-99;
264
265 m_tofdt2[0]=-99;
266 m_tofdt2[1]=-99;
267 m_tofdt2[2]=-99;
268 m_tofdt2[3]=-99;
269 m_tofdt2[4]=-99;
270
271 int layer1size=0;
272 int layer2size=0;
273
274
276 SmartRefVector<RecTofTrack> tofTrkCol=track->
tofTrack();
277 SmartRefVector<RecTofTrack>::iterator iter_tof=tofTrkCol.begin();
278
279 for(;iter_tof!=tofTrkCol.end();iter_tof++){
281 status->
setStatus( (*iter_tof)->status() );
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
311
313 layer1size++;
314 for(int i=0; i<5; i++)
315 m_tofdt1[i]=(*iter_tof)->tof() - m_tofscale1[i]*(*iter_tof)->texp(i);
316 m_sigma1=(*iter_tof)->sigma(0);;
317 }
318 }
321 if(status->
layer()==1){
322 layer1size++;
323
324 for(int i=0; i<5; i++){
325 m_tofdt1[i]=(*iter_tof)->tof() - m_tofscale1[i]*(*iter_tof)->texp(i);
326 }
327 m_sigma1=(*iter_tof)->sigma(0);;
328 }
329 else if(status->
layer()==2){
330 layer2size++;
331
332 for(int i=0; i<5; i++){
333 m_tofdt2[i]=(*iter_tof)->tof() - m_tofscale2[i]*(*iter_tof)->texp(i);
334 }
335 m_sigma2=(*iter_tof)->sigma(0);;
336 }
337
338 }
339
340 }
341
342
343
344
345 delete status;
346 }
347
348 }
349
350 if(layer1size>1){
351 m_tofdt1[0]=-99;
352 m_tofdt1[1]=-99;
353 m_tofdt1[2]=-99;
354 m_tofdt1[3]=-99;
355 m_tofdt1[4]=-99;
356 }
357 if(layer2size>1){
358 m_tofdt2[0]=-99;
359 m_tofdt2[1]=-99;
360 m_tofdt2[2]=-99;
361 m_tofdt2[3]=-99;
362 m_tofdt2[4]=-99;
363 }
364
365
366
369
370}
double sin(const BesAngle a)
double cos(const BesAngle a)
************Class m_ypar INTEGER m_KeyWgt INTEGER m_nphot INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
static void setPidType(PidType pidType)
bool isMdcKalTrackValid()
SmartRefVector< RecTofTrack > tofTrack()
RecEmcShower * emcShower()
RecMdcKalTrack * mdcKalTrack()
const HepVector & getZHelix() const
HepVector & getZHelixMu()
unsigned int layer() const
void setStatus(unsigned int status)