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