BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DDecay.cxx
Go to the documentation of this file.
1#include "GaudiKernel/IDataProviderSvc.h"
2#include "GaudiKernel/ISvcLocator.h"
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/PropertyMgr.h"
5#include "GaudiKernel/SmartDataPtr.h"
6#include <vector>
7
8#include "EventModel/Event.h"
9#include "EventModel/EventHeader.h"
10#include "EventModel/EventModel.h"
11
12#include "DstEvent/TofHitStatus.h"
13#include "EvtRecEvent/EvtRecDTag.h"
14#include "EvtRecEvent/EvtRecEvent.h"
15#include "EvtRecEvent/EvtRecPi0.h"
16#include "EvtRecEvent/EvtRecTrack.h"
17#include "EvtRecEvent/EvtRecVeeVertex.h"
18
19#include "CLHEP/Geometry/Point3D.h"
20#include "CLHEP/Vector/LorentzVector.h"
21#include "CLHEP/Vector/ThreeVector.h"
22#include "CLHEP/Vector/TwoVector.h"
23
24using CLHEP::Hep2Vector;
25using CLHEP::Hep3Vector;
26using CLHEP::HepLorentzVector;
27#ifndef ENABLE_BACKWARDS_COMPATIBILITY
28typedef HepGeom::Point3D<double> HepPoint3D;
29#endif
30
31#include "DDecay.h"
32#include "DTagTool/DTagTool.h"
33
34#include "ParticleID/ParticleID.h"
35#include "VertexDbSvc/IVertexDbSvc.h"
36#include "VertexFit/KinematicFit.h"
37#include "VertexFit/VertexFit.h"
38
39typedef std::vector<int> Vint;
40typedef std::vector<HepLorentzVector> Vp4;
41
42///////////////////////////////////////////////////////////////
43
45DDecay::DDecay( const std::string& name, ISvcLocator* pSvcLocator )
46 : Algorithm( name, pSvcLocator ) {}
47
48StatusCode DDecay::initialize() {
49
50 MsgStream log( msgSvc(), name() );
51
52 log << MSG::INFO << "in initialize()" << endmsg;
53
54 StatusCode status;
55 NTuplePtr nt1( ntupleSvc(), "FILE1/vxyz" );
56 if ( nt1 ) m_tuple1 = nt1;
57 else
58 {
59 m_tuple1 =
60 ntupleSvc()->book( "FILE1/vxyz", CLID_ColumnWiseTuple, "track N-Tuple example" );
61 if ( m_tuple1 )
62 {
63 status = m_tuple1->addItem( "vx0", m_vx0 );
64 status = m_tuple1->addItem( "vy0", m_vy0 );
65 status = m_tuple1->addItem( "vz0", m_vz0 );
66 status = m_tuple1->addItem( "vr0", m_vr0 );
67 }
68 else
69 {
70 log << MSG::ERROR << " Cannot book N-tuple:" << long( m_tuple1 ) << endmsg;
71 return StatusCode::FAILURE;
72 }
73 }
74
75 NTuplePtr nt2( ntupleSvc(), "FILE1/ks" );
76 if ( nt2 ) m_tuple2 = nt2;
77 else
78 {
79 m_tuple2 = ntupleSvc()->book( "FILE1/ks", CLID_ColumnWiseTuple, "ks N-Tuple example" );
80 if ( m_tuple2 )
81 {
82 status = m_tuple2->addItem( "ksmass", m_ksmass );
83 status = m_tuple2->addItem( "ksd", m_ksd );
84 status = m_tuple2->addItem( "ksmode", m_ksmode );
85 }
86 else
87 {
88 log << MSG::ERROR << " Cannot book N-tuple:" << long( m_tuple2 ) << endmsg;
89 return StatusCode::FAILURE;
90 }
91 }
92
93 NTuplePtr nt3( ntupleSvc(), "FILE1/pi0" );
94 if ( nt3 ) m_tuple3 = nt3;
95 else
96 {
97 m_tuple3 = ntupleSvc()->book( "FILE1/pi0", CLID_ColumnWiseTuple, "pi0 N-Tuple example" );
98 if ( m_tuple3 )
99 {
100 status = m_tuple3->addItem( "pi0mass", m_pi0mass );
101 status = m_tuple3->addItem( "pi0mode", m_pi0mode );
102 }
103 else
104 {
105 log << MSG::ERROR << " Cannot book N-tuple:" << long( m_tuple3 ) << endmsg;
106 return StatusCode::FAILURE;
107 }
108 }
109
110 NTuplePtr nt4( ntupleSvc(), "FILE1/tagD" );
111 if ( nt4 ) m_tuple4 = nt4;
112 else
113 {
114 m_tuple4 = ntupleSvc()->book( "FILE1/tagD", CLID_ColumnWiseTuple, "DTag N-Tuple example" );
115 if ( m_tuple4 )
116 {
117 status = m_tuple4->addItem( "mode", m_mode );
118 status = m_tuple4->addItem( "type", m_type );
119 status = m_tuple4->addItem( "charge", m_charge );
120 status = m_tuple4->addItem( "charm", m_charm );
121 status = m_tuple4->addItem( "numofchildren", m_numofchildren );
122 status = m_tuple4->addItem( "mass", m_mass );
123 status = m_tuple4->addItem( "mBC", m_mBC );
124 status = m_tuple4->addItem( "deltaE", m_deltae );
125 status = m_tuple4->addItem( "E", m_e );
126 status = m_tuple4->addItem( "notherTrk", m_ntrk );
127 }
128 else
129 {
130 log << MSG::ERROR << " Cannot book N-tuple:" << long( m_tuple4 ) << endmsg;
131 return StatusCode::FAILURE;
132 }
133 }
134
135 //
136 //--------end of book--------
137 //
138
139 log << MSG::INFO << "successfully return from initialize()" << endmsg;
140 return StatusCode::SUCCESS;
141}
142
143//***********************************************************************
144StatusCode DDecay::execute() {
145
146 MsgStream log( msgSvc(), name() );
147 log << MSG::INFO << "in execute()" << endmsg;
148
149 SmartDataPtr<Event::EventHeader> eventHeader( eventSvc(), "/Event/EventHeader" );
150 int runNo = eventHeader->runNumber();
151 int eventNo = eventHeader->eventNumber();
152
153 // cout<<"**************************************"<<endl;
154 // cout<<"event "<<eventNo<<endl;
155 // cout<<"**************************************"<<endl;
156
157 /// Accessing Ks list
158 SmartDataPtr<EvtRecVeeVertexCol> evtRecVeeVertexCol( eventSvc(),
159 "/Event/EvtRec/EvtRecVeeVertexCol" );
160 if ( !evtRecVeeVertexCol )
161 {
162 log << MSG::FATAL << "Could not find EvtRecVeeVertexCol" << endmsg;
163 return StatusCode::FAILURE;
164 }
165
166 /// Accessing pi0 list
167 SmartDataPtr<EvtRecPi0Col> recPi0Col( eventSvc(), "/Event/EvtRec/EvtRecPi0Col" );
168 if ( !recPi0Col )
169 {
170 log << MSG::FATAL << "Could not find EvtRecPi0Col" << endmsg;
171 return StatusCode::FAILURE;
172 }
173
174 // get primary vertex from db
175 Hep3Vector xorigin( 0, 0, 0 );
176 IVertexDbSvc* vtxsvc;
177 Gaudi::svcLocator()->service( "VertexDbSvc", vtxsvc ).ignore();
178 if ( vtxsvc->isVertexValid() )
179 {
180
181 // vertex[0] = vx; vertex[1]= vy; vertex[2] = vz;
182 double* vertex = vtxsvc->PrimaryVertex();
183 xorigin.setX( vertex[0] );
184 xorigin.setY( vertex[1] );
185 xorigin.setZ( vertex[2] );
186 }
187
188 //****************************
189
190 // use util tool to get dtaglist
191
192 DTagTool dtagTool;
193 if ( dtagTool.isDTagListEmpty() )
194 {
195 // cout<<"no D candidates found"<<endl;
196 return StatusCode::SUCCESS;
197 }
198
199 DTagToolIterator iter_begin = dtagTool.modes_begin();
200 DTagToolIterator iter_end = dtagTool.modes_end();
201
202 cout << "size of dtag:******:" << iter_end - iter_begin << endl;
203
204 int nCharge = 0;
205
206 // test to get one mode only
207 cout << "test single mode search :" << EvtRecDTag::kD0toKPi << endl;
208
209 // access all canddidates of one mode
210 vector<int> mode = dtagTool.mode( EvtRecDTag::kD0toKPi );
211 cout << " there are " << mode.size() << " candidates for this mode" << endl;
212 for ( int i = 0; i < mode.size(); i++ )
213 {
214
215 DTagToolIterator iter = dtagTool.modes_begin() + mode[i];
216 cout << "No." << i + 1 << " candidate deltaE is : " << ( *iter )->deltaE() << endl;
217 }
218
219 // loop the whole DTag list with order when they are filled , do all kinds of fit in side the
220 // loop
221
222 for ( DTagToolIterator iter_dtag = iter_begin; iter_dtag != iter_end; iter_dtag++ )
223 {
224
225 // decay mode name
226 cout << "***********" << endl;
227 cout << "***********" << endl;
228 dtagTool << iter_dtag;
229
230 //****************************************************
231 // mode D0 to KPi only
232 //****************************************************
233
234 if ( ( *iter_dtag )->decayMode() == EvtRecDTag::kD0toKPi )
235 {
236
237 HepLorentzVector p4 = ( *iter_dtag )->p4();
238 p4.boost( -0.011, 0, 0 );
239
240 Hep3Vector p3 = p4.v();
241
242 m_mode = ( *iter_dtag )->decayMode();
243 m_type = ( *iter_dtag )->type();
244 m_charge = ( *iter_dtag )->charge();
245 m_charm = ( *iter_dtag )->charm();
246 m_numofchildren = ( *iter_dtag )->numOfChildren();
247 m_mass = ( *iter_dtag )->mass();
248 m_mBC = ( *iter_dtag )->mBC();
249 m_e = ( *iter_dtag )->beamE();
250 m_deltae = ( *iter_dtag )->deltaE();
251
252 SmartRefVector<EvtRecTrack> tracks = ( *iter_dtag )->tracks();
253 SmartRefVector<EvtRecTrack> othertracks = ( *iter_dtag )->otherTracks();
254 SmartRefVector<EvtRecTrack> othershowers = ( *iter_dtag )->otherShowers();
255 m_ntrk = othertracks.size();
256
257 m_tuple4->write().ignore();
258
259 RecMdcKalTrack* mdcKalTrk1 = tracks[0]->mdcKalTrack();
260 RecMdcKalTrack* mdcKalTrk2 = tracks[1]->mdcKalTrack();
261 cout << "same side track 1 charge is:" << mdcKalTrk1->charge() << endl;
262 cout << "same side track 2 charge is:" << mdcKalTrk2->charge() << endl;
263
264 for ( int tk = 0; tk < othertracks.size(); tk++ )
265 {
266 RecMdcTrack* mdcTrk = othertracks[tk]->mdcTrack();
267 double pch = mdcTrk->p();
268 double x0 = mdcTrk->x();
269 double y0 = mdcTrk->y();
270 double z0 = mdcTrk->z();
271 double phi0 = mdcTrk->helix( 1 );
272 double xp = xorigin.x();
273 double yp = xorigin.y();
274 double Rxy = ( x0 - xp ) * cos( phi0 ) + ( y0 - yp ) * sin( phi0 );
275
276 m_vx0 = x0;
277 m_vy0 = y0;
278 m_vz0 = z0;
279 m_vr0 = Rxy;
280 m_tuple1->write().ignore();
281 nCharge += mdcTrk->charge();
282
283 std::cout << "other side track ID is: " << othertracks[tk]->trackId() << std::endl;
284
285 if ( dtagTool.isPion( othertracks[tk] ) ) cout << "it is pion" << endl;
286 if ( dtagTool.isKaon( othertracks[tk] ) ) cout << "it is kaon" << endl;
287
288 // std::cout<<"momentum="<<pch<<", x0="<<x0<<std::endl;
289
290 } // end of looping charged othertracks
291
292 for ( int i = 0; i < othershowers.size(); i++ )
293 {
294 // RecEmcShower *shr = othershowers[i]->emcShower();
295 // std::cout<<"shower ID is: "<<othershowers[i]->trackId()<<std::endl;
296 }
297
298 } // end of D0 to K Pi mode
299
300 //****************************************************
301 // mode D0 to KPiPi0 only
302 //****************************************************
303 if ( ( *iter_dtag )->decayMode() == EvtRecDTag::kD0toKPiPi0 )
304 {
305
306 m_mode = ( *iter_dtag )->decayMode();
307 m_type = ( *iter_dtag )->type();
308 m_charge = ( *iter_dtag )->charge();
309 m_charm = ( *iter_dtag )->charm();
310 m_numofchildren = ( *iter_dtag )->numOfChildren();
311 m_mass = ( *iter_dtag )->mass();
312 m_mBC = ( *iter_dtag )->mBC();
313 m_e = ( *iter_dtag )->beamE();
314 m_deltae = ( *iter_dtag )->deltaE();
315
316 SmartRefVector<EvtRecTrack> othertracks = ( *iter_dtag )->otherTracks();
317 m_ntrk = othertracks.size();
318
319 m_tuple4->write().ignore();
320
321 /// access pi0 using dtagtool
322 // users have to use second argument to tell pi0Id function the number of pi0s from the
323 // mode default number is 1
324 vector<int> pi0id = dtagTool.pi0Id( iter_dtag );
325 cout << "xxxxxxxxxxxxxxxxxxxxxxxxx"
326 << "num of pi0 is:" << pi0id.size() << endl;
327
328 for ( int i = 0; i < pi0id.size(); i++ )
329 {
330 pi0Iterator pi0Itr = dtagTool.pi0_begin() + pi0id[i];
331 cout << "pi0Mass: " << ( *pi0Itr )->unconMass() << endl;
332 }
333
334 /// or accessing pi0 information this way
335 SmartRefVector<EvtRecTrack> showers = ( *iter_dtag )->showers();
336
337 for ( EvtRecPi0Col::iterator pi0Itr = recPi0Col->begin(); pi0Itr < recPi0Col->end();
338 pi0Itr++ )
339 {
340
341 /// Access pi0 children
342 EvtRecTrack* heGammaTrk = const_cast<EvtRecTrack*>( ( *pi0Itr )->hiEnGamma() );
343 EvtRecTrack* leGammaTrk = const_cast<EvtRecTrack*>( ( *pi0Itr )->loEnGamma() );
344
345 int heGammaTrkId = heGammaTrk->trackId();
346 int leGammaTrkId = leGammaTrk->trackId();
347
348 if ( ( heGammaTrkId != showers[0]->trackId() ) &&
349 ( heGammaTrkId != showers[1]->trackId() ) )
350 continue;
351 if ( ( leGammaTrkId != showers[0]->trackId() ) &&
352 ( leGammaTrkId != showers[1]->trackId() ) )
353 continue;
354
355 const RecEmcShower* heGamma = heGammaTrk->emcShower();
356 const RecEmcShower* leGamma = leGammaTrk->emcShower();
357
358 cout << "pi0Mass: " << ( *pi0Itr )->unconMass() << endl;
359 cout << " E(high): " << heGamma->energy() << endl;
360 cout << " E(low) : " << leGamma->energy() << endl;
361
362 m_pi0mass = ( *pi0Itr )->unconMass();
363 m_pi0mode = ( *iter_dtag )->decayMode();
364 m_tuple3->write().ignore();
365
366 /// ONLY Break out of loop if tag mode has one pi0 child
367 break;
368
369 } // End "pi0Itr" FOR Loop
370
371 } // end of D0 to KPIPI0
372
373 //****************************************************
374 // mode D0 to KsPiPi only
375 //****************************************************
376 if ( ( *iter_dtag )->decayMode() == EvtRecDTag::kD0toKsPiPi )
377 {
378
379 m_mode = ( *iter_dtag )->decayMode();
380 m_type = ( *iter_dtag )->type();
381 m_charge = ( *iter_dtag )->charge();
382 m_charm = ( *iter_dtag )->charm();
383 m_numofchildren = ( *iter_dtag )->numOfChildren();
384 m_mass = ( *iter_dtag )->mass();
385 m_mBC = ( *iter_dtag )->mBC();
386 m_e = ( *iter_dtag )->beamE();
387 m_deltae = ( *iter_dtag )->deltaE();
388
389 SmartRefVector<EvtRecTrack> othertracks = ( *iter_dtag )->otherTracks();
390 m_ntrk = othertracks.size();
391
392 m_tuple4->write().ignore();
393
394 /// accessing Ks using dtagtool
395 // users have to use second argument to tell KsId function the number of Ks from the mode
396 // default number is 1
397 vector<int> ksid = dtagTool.ksId( iter_dtag );
398 cout << "xxxxxxxxxxxxxxxxxxxxxxxxx"
399 << "num of ks is:" << ksid.size() << endl;
400
401 for ( int i = 0; i < ksid.size(); i++ )
402 {
403 ksIterator ksItr = dtagTool.ks_begin() + ksid[i];
404 cout << "ksMass: " << ( *ksItr )->mass() << endl;
405 }
406
407 /// Ks information
408 SmartRefVector<EvtRecTrack> tracks = ( *iter_dtag )->tracks();
409
410 for ( EvtRecVeeVertexCol::iterator ksItr = evtRecVeeVertexCol->begin();
411 ksItr < evtRecVeeVertexCol->end(); ksItr++ )
412 {
413
414 /// Needed to reject Lambda (and conversion?) combinations
415 if ( ( *ksItr )->vertexId() != 310 ) continue;
416
417 EvtRecTrack* aKsChild1Trk = ( *ksItr )->daughter( 0 );
418 EvtRecTrack* aKsChild2Trk = ( *ksItr )->daughter( 1 );
419
420 int ksChild1TrkId = aKsChild1Trk->trackId();
421 int ksChild2TrkId = aKsChild2Trk->trackId();
422
423 if ( ( ksChild1TrkId != tracks[0]->trackId() ) &&
424 ( ksChild1TrkId != tracks[1]->trackId() ) )
425 continue;
426 if ( ( ksChild2TrkId != tracks[0]->trackId() ) &&
427 ( ksChild2TrkId != tracks[1]->trackId() ) )
428 continue;
429
430 cout << "ksMass: " << ( *ksItr )->mass() << endl;
431
432 Hep3Vector ks_D3( 0, 0, 0 );
433 ks_D3.set( ( *ksItr )->w()[4], ( *ksItr )->w()[5], ( *ksItr )->w()[6] );
434
435 m_ksmass = ( *ksItr )->mass();
436 m_ksd = ks_D3.mag();
437 m_ksmode = ( *iter_dtag )->decayMode();
438 m_tuple2->write().ignore();
439
440 /// ONLY Break out of loop if tag mode has one Ks child
441 break;
442
443 } // End "ksItr" FOR Loop
444
445 } // end of D0 to KSpipi
446
447 //****************************************************
448 // mode D+ to K- pi+ pi- only
449 //****************************************************
450 if ( ( *iter_dtag )->decayMode() == EvtRecDTag::kDptoKPiPi )
451 {
452
453 m_mode = ( *iter_dtag )->decayMode();
454 m_type = ( *iter_dtag )->type();
455 m_charge = ( *iter_dtag )->charge();
456 m_charm = ( *iter_dtag )->charm();
457 m_numofchildren = ( *iter_dtag )->numOfChildren();
458 m_mass = ( *iter_dtag )->mass();
459 m_mBC = ( *iter_dtag )->mBC();
460 m_e = ( *iter_dtag )->beamE();
461 m_deltae = ( *iter_dtag )->deltaE();
462
463 SmartRefVector<EvtRecTrack> othertracks = ( *iter_dtag )->otherTracks();
464 m_ntrk = othertracks.size();
465
466 m_tuple4->write().ignore();
467 } // end of Dp to K pi pi
468
469 //****************************************************
470 // mode Ds to Ks pi+ only
471 //****************************************************
472 if ( ( *iter_dtag )->decayMode() == EvtRecDTag::kDstoKsPi )
473 {
474
475 m_mode = ( *iter_dtag )->decayMode();
476 m_type = ( *iter_dtag )->type();
477 m_charge = ( *iter_dtag )->charge();
478 m_charm = ( *iter_dtag )->charm();
479 m_numofchildren = ( *iter_dtag )->numOfChildren();
480 m_mass = ( *iter_dtag )->mass();
481 m_mBC = ( *iter_dtag )->mBC();
482 m_e = ( *iter_dtag )->beamE();
483 m_deltae = ( *iter_dtag )->deltaE();
484
485 SmartRefVector<EvtRecTrack> othertracks = ( *iter_dtag )->otherTracks();
486 m_ntrk = othertracks.size();
487
488 m_tuple4->write().ignore();
489 } // end of Ds to Ks pi
490
491 } // end of looping over the entire DTag list
492
493 //************************
494 cout << "**************" << endl;
495 cout << "**************" << endl;
496 cout << "test print only D0/Dp/Ds modes" << endl;
497
498 // looop only D0 modes
499 vector<int> d0itindex = dtagTool.D0modes();
500 for ( int i = 0; i < d0itindex.size(); i++ )
501 {
502 DTagToolIterator iter = dtagTool.modes_begin() + d0itindex[i];
503 cout << "No." << i + 1 << " D0 mode is :" << ( *iter )->decayMode() << endl;
504 }
505
506 // loop only Dp modes
507 vector<int> dpitindex = dtagTool.Dpmodes();
508 for ( int i = 0; i < dpitindex.size(); i++ )
509 {
510 DTagToolIterator iter = dtagTool.modes_begin() + dpitindex[i];
511 cout << "No." << i + 1 << " Dp mode is :" << ( *iter )->decayMode() << endl;
512 }
513
514 // loop only Ds modes
515 vector<int> dsitindex = dtagTool.Dsmodes();
516 for ( int i = 0; i < dsitindex.size(); i++ )
517 {
518 DTagToolIterator iter = dtagTool.modes_begin() + dsitindex[i];
519 cout << "No." << i + 1 << " Ds mode is :" << ( *iter )->decayMode() << endl;
520 }
521
522 // check single tag
523 //************************
524 cout << "**************" << endl;
525 cout << "**************" << endl;
526 cout << "test single tag " << endl;
527
528 if ( dtagTool.findSTag( EvtRecDTag::kD0toKPi, +1 ) )
529 cout << " find single tag mode: " << ( *dtagTool.stag() )->decayMode() << endl;
530
531 // cosmic and lepton veto for 2 daughter decay modes, like D0->K pi
532 if ( dtagTool.findSTag( EvtRecDTag::kD0toKPi, +1 ) && dtagTool.cosmicandleptonVeto() )
533 {
534 cout << "cosmic and lepton backgaround veto" << endl;
535 cout << " find single tag mode: " << ( *dtagTool.stag() )->decayMode() << endl;
536 }
537
538 // check double tag
539 //************************
540 cout << "**************" << endl;
541 cout << "**************" << endl;
542 cout << "test double tag " << endl;
543
544 // charm calculated automatically, and charge conjucation considered
545 // nameley, will consider D0->K- pi+ & D0_bar->K+ pi- pi0 pair
546 // or D0_bar->K+ pi- & D0->K- pi+ pi0 pair
547 bool dtagflag = dtagTool.findDTag( EvtRecDTag::kD0toKPi, EvtRecDTag::kD0toKPiPi0 );
548 if ( dtagflag )
549 {
550 cout << " find double tag mode 1 :" << endl;
551 dtagTool << dtagTool.dtag1();
552 cout << " find double tag mode 2: " << endl;
553 dtagTool << dtagTool.dtag2();
554 }
555 // no charge conjucation considered
556 // nameley, will only consider D0->K- pi+ & D0_bar->K+ pi- pi0 pair
557 dtagflag = dtagTool.findDTag( EvtRecDTag::kD0toKPi, +1, EvtRecDTag::kD0toKPiPi0, -1 );
558 if ( dtagflag )
559 {
560 cout << " find double tag mode 1 :" << endl;
561 dtagTool << dtagTool.dtag1();
562 cout << " find double tag mode 2: " << endl;
563 dtagTool << dtagTool.dtag2();
564 }
565
566 // use invariant mass to select best double tag
567 dtagflag = dtagTool.findDTag( EvtRecDTag::kD0toKPi, +1, EvtRecDTag::kD0toKPiPi0, -1, "inv" );
568 if ( dtagflag )
569 {
570 cout << " double tag by invariant mass:" << endl;
571 cout << " find double tag mode 1 :" << endl;
572 dtagTool << dtagTool.dtag1();
573 cout << " find double tag mode 2: " << endl;
574 dtagTool << dtagTool.dtag2();
575 }
576
577 // return all valid double tag lists
578 dtagflag = dtagTool.findADTag( EvtRecDTag::kD0toKPi, +1, EvtRecDTag::kD0toKPiPi0, -1 );
579 if ( dtagflag )
580 {
581
582 vector<DTagToolIterator> vdtag1 = dtagTool.vdtag1();
583 vector<DTagToolIterator> vdtag2 = dtagTool.vdtag2();
584
585 cout << " list of all doule tags:" << endl;
586 for ( int i = 0; i < vdtag1.size(); i++ )
587 {
588 cout << " find double tag mode 1 :" << endl;
589 dtagTool << vdtag1[i];
590 cout << " find double tag mode 2: " << endl;
591 dtagTool << vdtag2[i];
592 }
593 }
594
595 dtagTool.clear();
596
597 return StatusCode::SUCCESS;
598} // end of execute()
599
600// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
601StatusCode DDecay::finalize() {
602 MsgStream log( msgSvc(), name() );
603 log << MSG::INFO << "in finalize()" << endmsg;
604 return StatusCode::SUCCESS;
605}
EvtRecVeeVertexCol::iterator ksIterator
EvtRecPi0Col::iterator pi0Iterator
EvtRecDTagCol::iterator DTagToolIterator
DECLARE_COMPONENT(BesBdkRc)
HepGeom::Point3D< double > HepPoint3D
int runNo
Definition DQA_TO_DB.cxx:13
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
std::vector< HepLorentzVector > Vp4
Definition Gam4pikp.cxx:38
std::vector< int > Vint
Definition Gam4pikp.cxx:37
int eventNo
INTupleSvc * ntupleSvc()
IMessageSvc * msgSvc()
Definition DDecay.h:7
StatusCode finalize()
Definition DDecay.cxx:601
StatusCode initialize()
Definition DDecay.cxx:48
StatusCode execute()
Definition DDecay.cxx:144
DDecay(const std::string &name, ISvcLocator *pSvcLocator)
Definition DDecay.cxx:45
vector< int > pi0Id(EvtRecDTagCol::iterator iter, int numpi0=1)
Definition DTagTool.cxx:744
bool isPion(EvtRecTrack *trk)
Definition DTagTool.cxx:954
EvtRecDTagCol::iterator modes_begin()
EvtRecDTagCol::iterator modes_end()
void clear()
Definition DTagTool.cxx:118
bool isKaon(EvtRecTrack *trk)
Definition DTagTool.cxx:970
EvtRecDTagCol::iterator dtag2()
bool findDTag(EvtRecDTag::DecayMode mode1, EvtRecDTag::DecayMode mode2, string smass="mbc")
Definition DTagTool.cxx:291
vector< int > mode(EvtRecDTag::DecayMode decaymode)
Definition DTagTool.cxx:161
bool findSTag(EvtRecDTag::DecayMode mode, int tagcharm)
Definition DTagTool.cxx:208
EvtRecPi0Col::iterator pi0_begin()
vector< int > ksId(EvtRecDTagCol::iterator iter, int numks=1)
Definition DTagTool.cxx:840
vector< EvtRecDTagCol::iterator > vdtag1()
EvtRecVeeVertexCol::iterator ks_begin()
bool findADTag(EvtRecDTag::DecayMode mode1, EvtRecDTag::DecayMode mode2)
Definition DTagTool.cxx:306
EvtRecDTagCol::iterator dtag1()
vector< EvtRecDTagCol::iterator > vdtag2()
bool cosmicandleptonVeto(bool emc=true)
const HepVector helix() const
......
virtual bool isVertexValid()=0
virtual double * PrimaryVertex()=0