141 {
142
143 MsgStream log(
msgSvc(), name());
144 log << MSG::INFO << "in execute()" << endreq;
145
146 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
147 int runNo=eventHeader->runNumber();
148 int eventNo=eventHeader->eventNumber();
149
150
151
152
153
154
155 SmartDataPtr<EvtRecVeeVertexCol> evtRecVeeVertexCol(eventSvc(), "/Event/EvtRec/EvtRecVeeVertexCol");
156 if ( ! evtRecVeeVertexCol ) {
157 log << MSG::FATAL << "Could not find EvtRecVeeVertexCol" << endreq;
158 return StatusCode::FAILURE;
159 }
160
161
162 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(), "/Event/EvtRec/EvtRecPi0Col");
163 if ( ! recPi0Col ) {
164 log << MSG::FATAL << "Could not find EvtRecPi0Col" << endreq;
165 return StatusCode::FAILURE;
166 }
167
168
169
170 Hep3Vector xorigin(0,0,0);
172 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
174
175
177 xorigin.setX(vertex[0]);
178 xorigin.setY(vertex[1]);
179 xorigin.setZ(vertex[2]);
180 }
181
182
183
184
185
186
189
190 return StatusCode::SUCCESS;
191 }
192
195
196 cout<<"size of dtag:******:"<<iter_end-iter_begin<<endl;
197
198 int nCharge = 0;
199
200
201
203
204
206 cout<<" there are "<< mode.size() <<" candidates for this mode" <<endl;
207 for( int i=0; i < mode.size(); i++){
208
210 cout<<"No."<<i+1<<" candidate deltaE is : "<< (*iter)->deltaE()<<endl;
211
212 }
213
214
215
216
217 for (
DTagToolIterator iter_dtag=iter_begin; iter_dtag != iter_end; iter_dtag++){
218
219
220 cout<<"***********"<<endl;
221 cout<<"***********"<<endl;
222 dtagTool<< iter_dtag;
223
224
225
226
227
228
230
231 HepLorentzVector
p4=(*iter_dtag)->p4();
232 p4.boost(-0.011,0,0);
233
234 Hep3Vector
p3=
p4.v();
235
236 m_mode=(*iter_dtag)->decayMode();
237 m_type=(*iter_dtag)->type();
238 m_charge=(*iter_dtag)->charge();
239 m_charm=(*iter_dtag)->charm();
240 m_numofchildren=(*iter_dtag)->numOfChildren();
241 m_mass=(*iter_dtag)->mass();
242 m_mBC=(*iter_dtag)->mBC();
243 m_e=(*iter_dtag)->beamE();
244 m_deltae=(*iter_dtag)->deltaE();
245
246 SmartRefVector<EvtRecTrack> tracks=(*iter_dtag)->tracks();
247 SmartRefVector<EvtRecTrack> othertracks=(*iter_dtag)->otherTracks();
248 SmartRefVector<EvtRecTrack> othershowers=(*iter_dtag)->otherShowers();
249 m_ntrk=othertracks.size();
250
251 m_tuple4->write();
252
253
256 cout<<
"same side track 1 charge is:"<<mdcKalTrk1->
charge()<<endl;
257 cout<<
"same side track 2 charge is:"<<mdcKalTrk2->
charge()<<endl;
258
259 for(int tk=0; tk<othertracks.size(); tk++){
261 double pch=mdcTrk->
p();
262 double x0=mdcTrk->
x();
263 double y0=mdcTrk->
y();
264 double z0=mdcTrk->
z();
265 double phi0=mdcTrk->
helix(1);
266 double xp=xorigin.x();
267 double yp=xorigin.y();
268 double Rxy=(x0-xp)*
cos(phi0)+(y0-yp)*
sin(phi0);
269
270 m_vx0=x0;
271 m_vy0=y0;
272 m_vz0=z0;
273 m_vr0=Rxy;
274 m_tuple1->write();
275 nCharge += mdcTrk->
charge();
276
277 std::cout<<"other side track ID is: "<<othertracks[tk]->trackId()<<std::endl;
278
279 if(dtagTool.
isPion(othertracks[tk]) )
280 cout<<"it is pion"<<endl;
281 if(dtagTool.
isKaon(othertracks[tk]) )
282 cout<<"it is kaon"<<endl;
283
284
285
286 }
287
288 for(int i=0; i<othershowers.size(); i++){
289
290
291 }
292
293 }
294
295
296
297
298
299
301
302 m_mode=(*iter_dtag)->decayMode();
303 m_type=(*iter_dtag)->type();
304 m_charge=(*iter_dtag)->charge();
305 m_charm=(*iter_dtag)->charm();
306 m_numofchildren=(*iter_dtag)->numOfChildren();
307 m_mass=(*iter_dtag)->mass();
308 m_mBC=(*iter_dtag)->mBC();
309 m_e=(*iter_dtag)->beamE();
310 m_deltae=(*iter_dtag)->deltaE();
311
312 SmartRefVector<EvtRecTrack> othertracks=(*iter_dtag)->otherTracks();
313 m_ntrk=othertracks.size();
314
315 m_tuple4->write();
316
317
318
319
320
321 vector<int> pi0id= dtagTool.
pi0Id(iter_dtag);
322 cout<<"xxxxxxxxxxxxxxxxxxxxxxxxx"<<"num of pi0 is:"<<pi0id.size()<<endl;
323
324 for(int i=0; i<pi0id.size(); i++){
326 cout<<"pi0Mass: " << (*pi0Itr)->unconMass() << endl;
327
328 }
329
330
331 SmartRefVector<EvtRecTrack> showers=(*iter_dtag)->showers();
332
333 for(EvtRecPi0Col::iterator pi0Itr = recPi0Col->begin();
334 pi0Itr < recPi0Col->end(); pi0Itr++){
335
336
339
340 int heGammaTrkId = heGammaTrk->
trackId();
341 int leGammaTrkId = leGammaTrk->
trackId();
342
343 if((heGammaTrkId != showers[0]->trackId())&&
344 (heGammaTrkId != showers[1]->trackId())) continue;
345 if((leGammaTrkId != showers[0]->trackId())&&
346 (leGammaTrkId != showers[1]->trackId())) continue;
347
350
351 cout<<"pi0Mass: " << (*pi0Itr)->unconMass() << endl;
352 cout<<
" E(high): " << heGamma->
energy() << endl;
353 cout<<
" E(low) : " << leGamma->
energy() << endl;
354
355 m_pi0mass = (*pi0Itr)->unconMass();
356 m_pi0mode = (*iter_dtag)->decayMode();
357 m_tuple3->write();
358
359
360 break;
361
362 }
363
364
365 }
366
367
368
369
370
372
373 m_mode=(*iter_dtag)->decayMode();
374 m_type=(*iter_dtag)->type();
375 m_charge=(*iter_dtag)->charge();
376 m_charm=(*iter_dtag)->charm();
377 m_numofchildren=(*iter_dtag)->numOfChildren();
378 m_mass=(*iter_dtag)->mass();
379 m_mBC=(*iter_dtag)->mBC();
380 m_e=(*iter_dtag)->beamE();
381 m_deltae=(*iter_dtag)->deltaE();
382
383 SmartRefVector<EvtRecTrack> othertracks=(*iter_dtag)->otherTracks();
384 m_ntrk=othertracks.size();
385
386 m_tuple4->write();
387
388
389
390
391 vector<int> ksid= dtagTool.
ksId(iter_dtag);
392 cout<<"xxxxxxxxxxxxxxxxxxxxxxxxx"<<"num of ks is:"<<ksid.size()<<endl;
393
394 for(int i=0; i<ksid.size(); i++){
396 cout<<"ksMass: " << (*ksItr)->mass() << endl;
397
398 }
399
400
401
402 SmartRefVector<EvtRecTrack> tracks=(*iter_dtag)->tracks();
403
404 for(EvtRecVeeVertexCol::iterator ksItr = evtRecVeeVertexCol->begin();
405 ksItr < evtRecVeeVertexCol->end(); ksItr++){
406
407
408 if((*ksItr)->vertexId() != 310) continue;
409
412
413 int ksChild1TrkId = aKsChild1Trk->
trackId();
414 int ksChild2TrkId = aKsChild2Trk->
trackId();
415
416 if((ksChild1TrkId != tracks[0]->trackId())&&
417 (ksChild1TrkId != tracks[1]->trackId())) continue;
418 if((ksChild2TrkId != tracks[0]->trackId())&&
419 (ksChild2TrkId != tracks[1]->trackId())) continue;
420
421 cout<<"ksMass: " << (*ksItr)->mass() << endl;
422
423 Hep3Vector ks_D3(0,0,0);
424 ks_D3.set((*ksItr)->w()[4],(*ksItr)->w()[5],(*ksItr)->w()[6]);
425
426 m_ksmass = (*ksItr)->mass();
427 m_ksd = ks_D3.mag();
428 m_ksmode = (*iter_dtag)->decayMode();
429 m_tuple2->write();
430
431
432 break;
433
434 }
435
436 }
437
438
439
440
441
443
444 m_mode=(*iter_dtag)->decayMode();
445 m_type=(*iter_dtag)->type();
446 m_charge=(*iter_dtag)->charge();
447 m_charm=(*iter_dtag)->charm();
448 m_numofchildren=(*iter_dtag)->numOfChildren();
449 m_mass=(*iter_dtag)->mass();
450 m_mBC=(*iter_dtag)->mBC();
451 m_e=(*iter_dtag)->beamE();
452 m_deltae=(*iter_dtag)->deltaE();
453
454 SmartRefVector<EvtRecTrack> othertracks=(*iter_dtag)->otherTracks();
455 m_ntrk=othertracks.size();
456
457 m_tuple4->write();
458 }
459
460
461
462
464
465 m_mode=(*iter_dtag)->decayMode();
466 m_type=(*iter_dtag)->type();
467 m_charge=(*iter_dtag)->charge();
468 m_charm=(*iter_dtag)->charm();
469 m_numofchildren=(*iter_dtag)->numOfChildren();
470 m_mass=(*iter_dtag)->mass();
471 m_mBC=(*iter_dtag)->mBC();
472 m_e=(*iter_dtag)->beamE();
473 m_deltae=(*iter_dtag)->deltaE();
474
475 SmartRefVector<EvtRecTrack> othertracks=(*iter_dtag)->otherTracks();
476 m_ntrk=othertracks.size();
477
478 m_tuple4->write();
479 }
480
481
482 }
483
484
485
486 cout<<"**************"<<endl;
487 cout<<"**************"<<endl;
488 cout<<"test print only D0/Dp/Ds modes"<<endl;
489
490
491 vector<int> d0itindex= dtagTool.
D0modes();
492 for( int i=0; i< d0itindex.size(); i++){
494 cout<<"No."<<i+1<<" D0 mode is :"<< (*iter)->decayMode()<<endl;
495 }
496
497
498 vector<int> dpitindex= dtagTool.
Dpmodes();
499 for( int i=0; i< dpitindex.size(); i++){
501 cout<<"No."<<i+1<<" Dp mode is :"<< (*iter)->decayMode()<<endl;
502 }
503
504
505 vector<int> dsitindex= dtagTool.
Dsmodes();
506 for( int i=0; i< dsitindex.size(); i++){
508 cout<<"No."<<i+1<<" Ds mode is :"<< (*iter)->decayMode()<<endl;
509 }
510
511
512
513
514 cout<<"**************"<<endl;
515 cout<<"**************"<<endl;
516 cout<<"test single tag "<<endl;
517
519 cout<<
" find single tag mode: "<< (*dtagTool.
stag())->decayMode() <<endl;
520
521
523 cout<<"cosmic and lepton backgaround veto"<<endl;
524 cout<<
" find single tag mode: "<< (*dtagTool.
stag())->decayMode() <<endl;
525 }
526
527
528
529 cout<<"**************"<<endl;
530 cout<<"**************"<<endl;
531 cout<<"test double tag "<<endl;
532
533
534
535
537 if( dtagflag){
538 cout<<" find double tag mode 1 :"<<endl;
539 dtagTool<<dtagTool.
dtag1();
540 cout<<" find double tag mode 2: "<< endl;
541 dtagTool<<dtagTool.
dtag2();
542 }
543
544
546 if( dtagflag){
547 cout<<" find double tag mode 1 :"<<endl;
548 dtagTool<<dtagTool.
dtag1();
549 cout<<" find double tag mode 2: "<< endl;
550 dtagTool<<dtagTool.
dtag2();
551 }
552
553
554
556 if( dtagflag){
557 cout<<" double tag by invariant mass:"<<endl;
558 cout<<" find double tag mode 1 :"<<endl;
559 dtagTool<<dtagTool.
dtag1();
560 cout<<" find double tag mode 2: "<< endl;
561 dtagTool<<dtagTool.
dtag2();
562 }
563
564
566 if( dtagflag){
567
568 vector<DTagToolIterator> vdtag1=dtagTool.
vdtag1();
569 vector<DTagToolIterator> vdtag2=dtagTool.
vdtag2();
570
571 cout<<" list of all doule tags:"<<endl;
572 for(int i=0;i<vdtag1.size();i++){
573 cout<<" find double tag mode 1 :"<<endl;
574 dtagTool<<vdtag1[i];
575 cout<<" find double tag mode 2: "<< endl;
576 dtagTool<<vdtag2[i];
577 }
578
579 }
580
582
583}
double sin(const BesAngle a)
double cos(const BesAngle a)
const HepVector helix() const
......
RecEmcShower * emcShower()
virtual bool isVertexValid()=0
virtual double * PrimaryVertex()=0
double double double * p4