BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DTagTool.cxx
Go to the documentation of this file.
1#include "GaudiKernel/Bootstrap.h"
2#include "GaudiKernel/IDataProviderSvc.h"
3#include "GaudiKernel/ISvcLocator.h"
4#include "GaudiKernel/SmartDataPtr.h"
5
6#include "DstEvent/TofHitStatus.h"
7#include "EventModel/EventModel.h"
8#include "EvtRecEvent/EvtRecEvent.h"
9#include "EvtRecEvent/EvtRecTrack.h"
10
11#include "VertexDbSvc/IVertexDbSvc.h"
12#include "VertexFit/Helix.h"
13
14#include "DTagTool/DTagTool.h"
15
17 : m_evtSvc( 0 )
18 , m_iterbegin( 0 )
19 , m_iterend( 0 )
20 , m_iterstag( 0 )
21 , m_iterdtag1( 0 )
22 , m_iterdtag2( 0 )
23 , m_chargebegin( 0 )
24 , m_chargeend( 0 )
25 , m_showerbegin( 0 )
26 , m_showerend( 0 )
27 , m_tag1desigma( 1.0 )
28 , m_tag2desigma( 1.0 ) {
29
30 SmartDataPtr<EvtRecEvent> evtRecEvent( eventSvc(), "/Event/EvtRec/EvtRecEvent" );
31 if ( !evtRecEvent )
32 {
33 cout << MSG::FATAL << "Could not find EvtRecEvent" << endl;
34 exit( 1 );
35 }
36
37 SmartDataPtr<EvtRecTrackCol> evtRecTrackCol( eventSvc(), "/Event/EvtRec/EvtRecTrackCol" );
38 if ( !evtRecTrackCol )
39 {
40 cout << MSG::FATAL << "Could not find EvtRecTrackCol" << endl;
41 exit( 1 );
42 }
43
44 StatusCode sc = Gaudi::svcLocator()->service( "SimplePIDSvc", m_simplePIDSvc );
45 if ( sc.isFailure() )
46 {
47 // log << MSG::FATAL << "Could not load SimplePIDSvc!" << endmsg;
48 exit( 1 );
49 }
50
51 m_chargebegin = evtRecTrackCol->begin();
52 m_chargeend = evtRecTrackCol->begin() + evtRecEvent->totalCharged();
53 m_showerbegin = evtRecTrackCol->begin() + evtRecEvent->totalCharged();
54 m_showerend = evtRecTrackCol->begin() + evtRecEvent->totalTracks();
55
56 /// Accessing DTagList
57 SmartDataPtr<EvtRecDTagCol> evtRecDTagCol( eventSvc(), EventModel::EvtRec::EvtRecDTagCol );
58 if ( !evtRecDTagCol )
59 {
60 cout << "Could not find EvtRecDTagCol" << endl;
61 exit( 1 );
62 }
63
64 /// Accessing Ks list
65 SmartDataPtr<EvtRecVeeVertexCol> evtRecVeeVertexCol( eventSvc(),
66 "/Event/EvtRec/EvtRecVeeVertexCol" );
67 if ( !evtRecVeeVertexCol )
68 {
69 cout << "Could not find EvtRecVeeVertexCol" << endl;
70 exit( 1 );
71 }
72
73 /// Accessing pi0 list
74 SmartDataPtr<EvtRecPi0Col> recPi0Col( eventSvc(), "/Event/EvtRec/EvtRecPi0Col" );
75 if ( !recPi0Col )
76 {
77 cout << "Could not find EvtRecPi0Col" << endl;
78 exit( 1 );
79 }
80
81 /// Accessing eta list
82
83 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol( eventSvc(), "/Event/EvtRec/EvtRecEtaToGGCol" );
84 if ( !recEtaToGGCol )
85 {
86 cout << "Could not find EvtRecEtaToGGCol" << endl;
87 exit( 1 );
88 }
89
90 m_iterbegin = evtRecDTagCol->begin();
91 m_iterend = evtRecDTagCol->end();
92 m_pi0iterbegin = recPi0Col->begin();
93 m_pi0iterend = recPi0Col->end();
94 m_etaiterbegin = recEtaToGGCol->begin();
95 m_etaiterend = recEtaToGGCol->end();
96 m_ksiterbegin = evtRecVeeVertexCol->begin();
97 m_ksiterend = evtRecVeeVertexCol->end();
98
99 if ( evtRecDTagCol->size() > 0 ) m_isdtaglistempty = false;
100 else m_isdtaglistempty = true;
101
102 // set initial pid requirement
103 m_pid = true;
104
105 // fill d0, dp, ds modes seprately
106 int index = 0;
107 for ( EvtRecDTagCol::iterator iter = m_iterbegin; iter != m_iterend; iter++ )
108 {
109
110 if ( (int)( ( *iter )->decayMode() ) < 200 ) m_d0modes.push_back( index );
111 else if ( (int)( ( *iter )->decayMode() ) < 400 ) m_dpmodes.push_back( index );
112 else if ( (int)( ( *iter )->decayMode() ) < 1000 ) m_dsmodes.push_back( index );
113
114 index++;
115 }
116}
117
119
120 m_d0modes.clear();
121 m_dpmodes.clear();
122 m_dsmodes.clear();
123}
124
126
127 m_d0modes.clear();
128 m_dpmodes.clear();
129 m_dsmodes.clear();
130}
131
132bool DTagTool::compare( EvtRecDTagCol::iterator pair1_iter1,
133 EvtRecDTagCol::iterator pair1_iter2,
134 EvtRecDTagCol::iterator pair2_iter1,
135 EvtRecDTagCol::iterator pair2_iter2, double mD, string smass ) {
136
137 double value1 = 0;
138 double value2 = 0;
139 if ( smass == "mbc" )
140 {
141 value1 = fabs( 0.5 * ( ( *pair1_iter1 )->mBC() + ( *pair1_iter2 )->mBC() ) - mD );
142 value2 = fabs( 0.5 * ( ( *pair2_iter1 )->mBC() + ( *pair2_iter2 )->mBC() ) - mD );
143 }
144 else if ( smass == "de" )
145 {
146 value1 = pow( ( *pair1_iter1 )->deltaE() / m_tag1desigma, 2 ) +
147 pow( ( *pair1_iter2 )->deltaE() / m_tag2desigma, 2 );
148 value2 = pow( ( *pair2_iter1 )->deltaE() / m_tag1desigma, 2 ) +
149 pow( ( *pair2_iter2 )->deltaE() / m_tag2desigma, 2 );
150 }
151 else if ( smass == "inv" )
152 {
153 value1 = fabs( 0.5 * ( ( *pair1_iter1 )->mass() + ( *pair1_iter2 )->mass() ) - mD );
154 value2 = fabs( 0.5 * ( ( *pair2_iter1 )->mass() + ( *pair2_iter2 )->mass() ) - mD );
155 }
156
157 if ( value1 <= value2 ) return true;
158 else return false;
159}
160
161vector<int> DTagTool::mode( EvtRecDTag::DecayMode decaymode ) {
162
163 vector<int> mode;
164 int index = 0;
165 for ( EvtRecDTagCol::iterator iter = m_iterbegin; iter != m_iterend; iter++ )
166 {
167
168 if ( m_pid )
169 {
170 if ( ( *iter )->decayMode() == decaymode && ( *iter )->type() == 1 )
171 mode.push_back( index );
172 }
173 else
174 {
175 if ( ( *iter )->decayMode() == decaymode ) mode.push_back( index );
176 }
177
178 index++;
179 }
180
181 return mode;
182}
183
184vector<int> DTagTool::mode( int decaymode ) {
185
186 vector<int> mode;
187 int index = 0;
188 for ( EvtRecDTagCol::iterator iter = m_iterbegin; iter != m_iterend; iter++ )
189 {
190
191 if ( m_pid )
192 {
193 if ( ( *iter )->decayMode() == decaymode && ( *iter )->type() == 1 )
194 mode.push_back( index );
195 }
196 else
197 {
198 if ( ( *iter )->decayMode() == decaymode ) mode.push_back( index );
199 }
200
201 index++;
202 }
203
204 return mode;
205}
206
207// search single tag with charm
209
210 return findSTag( static_cast<int>( mode ), tagcharm );
211
212} // end of stag
213
214// search single tag without charm
216 return findSTag( static_cast<int>( mode ) );
217
218} // end of stag
219
220// use integer as argument
221bool DTagTool::findSTag( int mode, int tagcharm ) {
222
223 bool isStcand = false;
224 double de_min = 1;
225
226 // loop over the dtag list
227 EvtRecDTagCol::iterator iter_dtag = m_iterbegin;
228 for ( ; iter_dtag != m_iterend; iter_dtag++ )
229 {
230
231 if ( m_pid )
232 {
233 if ( ( *iter_dtag )->type() != 1 || ( *iter_dtag )->decayMode() != mode ||
234 ( *iter_dtag )->charm() != tagcharm )
235 continue;
236 }
237 else
238 {
239 if ( ( *iter_dtag )->decayMode() != mode || ( *iter_dtag )->charm() != tagcharm )
240 continue;
241 }
242 if ( fabs( ( *iter_dtag )->deltaE() ) < fabs( de_min ) )
243 {
244 isStcand = true;
245 m_iterstag = iter_dtag;
246 de_min = ( *iter_dtag )->deltaE();
247 }
248
249 } // end of looping over the entire DTag list
250
251 return isStcand;
252
253} // end of stag
254
256
257 bool isStcand = false;
258 double de_min = 1;
259
260 // loop over the dtag list
261 EvtRecDTagCol::iterator iter_dtag = m_iterbegin;
262 for ( ; iter_dtag != m_iterend; iter_dtag++ )
263 {
264
265 if ( m_pid )
266 {
267 if ( ( *iter_dtag )->type() != 1 || ( *iter_dtag )->decayMode() != mode ) continue;
268 }
269 else
270 {
271 if ( ( *iter_dtag )->decayMode() != mode ) continue;
272 }
273
274 if ( fabs( ( *iter_dtag )->deltaE() ) < fabs( de_min ) )
275 {
276 isStcand = true;
277 m_iterstag = iter_dtag;
278 de_min = ( *iter_dtag )->deltaE();
279 }
280
281 } // end of looping over the entire DTag list
282
283 return isStcand;
284
285} // end of stag
286
287////////////////////////////////////////////
288////////////////////////////////////////////
289
290// generic double tagging searches
292 string smass ) {
293
294 return findDTag( static_cast<int>( mode1 ), static_cast<int>( mode2 ), smass );
295}
296
297bool DTagTool::findDTag( EvtRecDTag::DecayMode mode1, int tagcharm1,
298 EvtRecDTag::DecayMode mode2, int tagcharm2, string smass ) {
299
300 return findDTag( static_cast<int>( mode1 ), tagcharm1, static_cast<int>( mode2 ), tagcharm2,
301 smass );
302
303} // end of findDtag
304
305// find all the double tags
307
308 return findADTag( static_cast<int>( mode1 ), static_cast<int>( mode2 ) );
309}
310
312 EvtRecDTag::DecayMode mode2, int tagcharm2 ) {
313
314 return findADTag( static_cast<int>( mode1 ), tagcharm1, static_cast<int>( mode2 ),
315 tagcharm2 );
316
317} // end of findDtag
318
319bool DTagTool::findDTag( int mode1, int mode2, string smass ) {
320
321 int tagcharm1 = ( mode1 < 10 || mode1 >= 200 ) ? +1 : 0;
322 int tagcharm2 = ( mode2 < 10 || mode2 >= 200 ) ? -1 : 0;
323
324 if ( tagcharm1 * tagcharm2 > 0 )
325 {
326 cout << "double tagging warning! two modes can't have same nonzero charmness" << endl;
327 return false;
328 }
329
330 // define D candidate mass
331 double mDcand = 0;
332 if ( mode1 < 200 && mode2 < 200 ) mDcand = 1.86484;
333 else if ( mode1 >= 200 && mode1 < 400 && mode2 >= 200 && mode2 < 400 ) mDcand = 1.86966;
334 else if ( mode1 >= 400 && mode1 < 1000 && mode2 >= 400 && mode2 < 1000 ) mDcand = 1.96835;
335 else
336 {
337 cout << "double tag modes are not from same particle ! " << endl;
338 return false;
339 }
340
341 vector<int> igood1, igood2;
342 igood1.clear(), igood2.clear();
343 int index = 0;
344 EvtRecDTagCol::iterator iter_dtag = m_iterbegin;
345
346 // charge conjucation considered
347 for ( ; iter_dtag != m_iterend; iter_dtag++ )
348 {
349 int iter_mode = ( *iter_dtag )->decayMode();
350 int iter_charm = ( *iter_dtag )->charm();
351 int iter_type = ( *iter_dtag )->type();
352
353 if ( m_pid )
354 {
355 if ( iter_mode == mode1 && iter_charm == tagcharm1 && iter_type == 1 )
356 igood1.push_back( index );
357 if ( tagcharm1 != 0 && iter_mode == mode1 && iter_charm == -tagcharm1 && iter_type == 1 )
358 igood1.push_back( index );
359
360 if ( iter_mode == mode2 && iter_charm == tagcharm2 && iter_type == 1 )
361 igood2.push_back( index );
362 if ( tagcharm2 != 0 && iter_mode == mode2 && iter_charm == -tagcharm2 && iter_type == 1 )
363 igood2.push_back( index );
364 }
365 else
366 {
367 if ( iter_mode == mode1 && iter_charm == tagcharm1 ) igood1.push_back( index );
368 if ( tagcharm1 != 0 && iter_mode == mode1 && iter_charm == -tagcharm1 )
369 igood1.push_back( index );
370
371 if ( iter_mode == mode2 && iter_charm == tagcharm2 ) igood2.push_back( index );
372 if ( tagcharm2 != 0 && iter_mode == mode2 && iter_charm == -tagcharm2 )
373 igood2.push_back( index );
374 }
375
376 index++;
377 }
378
379 // look for the best pair of double-tagged event
380 if ( igood1.size() < 1 || igood2.size() < 1 ) return false;
381
382 bool isDtcand = false;
383 int index_i = 0, index_j = 0;
384
385 EvtRecDTagCol::iterator iter_i, iter_j;
386 int count = 0;
387 for ( int i = 0; i < igood1.size(); i++ )
388 {
389
390 iter_i = m_iterbegin + igood1[i];
391
392 int charm_i = ( *iter_i )->charm();
393 for ( int j = 0; j < igood2.size(); j++ )
394 {
395 iter_j = m_iterbegin + igood2[j];
396
397 int charm_j = ( *iter_j )->charm();
398 if ( charm_i * charm_j > 0 || igood2[j] == igood1[i] ) continue;
399
400 if ( shareTracks( iter_i, iter_j ) ) continue;
401 count++;
402 if ( count == 1 )
403 {
404 m_iterdtag1 = iter_i;
405 m_iterdtag2 = iter_j;
406 }
407
408 if ( compare( iter_i, iter_j, m_iterdtag1, m_iterdtag2, mDcand, smass ) )
409 {
410 m_iterdtag1 = iter_i;
411 m_iterdtag2 = iter_j;
412 isDtcand = true;
413 }
414
415 } // end of j loop
416 } // end of i loop
417
418 return isDtcand;
419}
420
421bool DTagTool::findDTag( int mode1, int tagcharm1, int mode2, int tagcharm2, string smass ) {
422
423 if ( tagcharm1 * tagcharm2 > 0 )
424 {
425 cout << "double tagging warning! two modes can't have same nonzero charmness" << endl;
426 return false;
427 }
428
429 // define D candidate mass
430 double mDcand = 0;
431 if ( mode1 < 200 && mode2 < 200 ) mDcand = 1.86484;
432 else if ( mode1 >= 200 && mode1 < 400 && mode2 >= 200 && mode2 < 400 ) mDcand = 1.86966;
433 else if ( mode1 >= 400 && mode1 < 1000 && mode2 >= 400 && mode2 < 1000 ) mDcand = 1.96835;
434 else
435 {
436 cout << "double tag modes are not from same particle ! " << endl;
437 return false;
438 }
439
440 vector<int> igood1, igood2;
441 igood1.clear(), igood2.clear();
442 int index = 0;
443 EvtRecDTagCol::iterator iter_dtag = m_iterbegin;
444
445 for ( ; iter_dtag != m_iterend; iter_dtag++ )
446 {
447 int iter_mode = ( *iter_dtag )->decayMode();
448 int iter_charm = ( *iter_dtag )->charm();
449 int iter_type = ( *iter_dtag )->type();
450
451 if ( m_pid )
452 {
453 if ( iter_mode == mode1 && iter_charm == tagcharm1 && iter_type == 1 )
454 igood1.push_back( index );
455
456 if ( iter_mode == mode2 && iter_charm == tagcharm2 && iter_type == 1 )
457 igood2.push_back( index );
458 }
459 else
460 {
461 if ( iter_mode == mode1 && iter_charm == tagcharm1 ) igood1.push_back( index );
462
463 if ( iter_mode == mode2 && iter_charm == tagcharm2 ) igood2.push_back( index );
464 }
465
466 index++;
467 }
468
469 // look for the best pair of double-tagged event
470
471 if ( igood1.size() < 1 || igood2.size() < 1 ) return false;
472
473 bool isDtcand = false;
474 int index_i = 0, index_j = 0;
475
476 EvtRecDTagCol::iterator iter_i, iter_j;
477 int count = 0;
478 for ( int i = 0; i < igood1.size(); i++ )
479 {
480
481 iter_i = m_iterbegin + igood1[i];
482 int charm_i = ( *iter_i )->charm();
483 for ( int j = 0; j < igood2.size(); j++ )
484 {
485 iter_j = m_iterbegin + igood2[j];
486 int charm_j = ( *iter_j )->charm();
487 if ( charm_i * charm_j > 0 || igood2[j] == igood1[i] ) continue;
488
489 if ( shareTracks( iter_i, iter_j ) ) continue;
490 count++;
491 if ( count == 1 )
492 {
493 m_iterdtag1 = iter_i;
494 m_iterdtag2 = iter_j;
495 }
496
497 if ( compare( iter_i, iter_j, m_iterdtag1, m_iterdtag2, mDcand, smass ) )
498 {
499 m_iterdtag1 = iter_i;
500 m_iterdtag2 = iter_j;
501 isDtcand = true;
502 }
503
504 } // end of j loop
505 } // end of i loop
506
507 return isDtcand;
508
509} // end of findDtag
510
511bool DTagTool::findADTag( int mode1, int mode2 ) {
512
513 int tagcharm1 = ( mode1 < 10 || mode1 >= 200 ) ? +1 : 0;
514 int tagcharm2 = ( mode2 < 10 || mode2 >= 200 ) ? -1 : 0;
515
516 if ( tagcharm1 * tagcharm2 > 0 )
517 {
518 cout << "double tagging warning! two modes can't have same nonzero charmness" << endl;
519 return false;
520 }
521
522 // define D candidate mass
523 double mDcand = 0;
524 if ( mode1 < 200 && mode2 < 200 ) mDcand = 1.86484;
525 else if ( mode1 >= 200 && mode1 < 400 && mode2 >= 200 && mode2 < 400 ) mDcand = 1.86966;
526 else if ( mode1 >= 400 && mode1 < 1000 && mode2 >= 400 && mode2 < 1000 ) mDcand = 1.96835;
527 else
528 {
529 cout << "double tag modes are not from same particle ! " << endl;
530 return false;
531 }
532
533 vector<int> igood1, igood2;
534 igood1.clear(), igood2.clear();
535 int index = 0;
536 EvtRecDTagCol::iterator iter_dtag = m_iterbegin;
537
538 // charge conjucation considered
539 for ( ; iter_dtag != m_iterend; iter_dtag++ )
540 {
541 int iter_mode = ( *iter_dtag )->decayMode();
542 int iter_charm = ( *iter_dtag )->charm();
543 int iter_type = ( *iter_dtag )->type();
544
545 if ( m_pid )
546 {
547 if ( iter_mode == mode1 && iter_charm == tagcharm1 && iter_type == 1 )
548 igood1.push_back( index );
549 if ( tagcharm1 != 0 && iter_mode == mode1 && iter_charm == -tagcharm1 && iter_type == 1 )
550 igood1.push_back( index );
551
552 if ( iter_mode == mode2 && iter_charm == tagcharm2 && iter_type == 1 )
553 igood2.push_back( index );
554 if ( tagcharm2 != 0 && iter_mode == mode2 && iter_charm == -tagcharm2 && iter_type == 1 )
555 igood2.push_back( index );
556 }
557 else
558 {
559 if ( iter_mode == mode1 && iter_charm == tagcharm1 ) igood1.push_back( index );
560 if ( tagcharm1 != 0 && iter_mode == mode1 && iter_charm == -tagcharm1 )
561 igood1.push_back( index );
562
563 if ( iter_mode == mode2 && iter_charm == tagcharm2 ) igood2.push_back( index );
564 if ( tagcharm2 != 0 && iter_mode == mode2 && iter_charm == -tagcharm2 )
565 igood2.push_back( index );
566 }
567
568 index++;
569 }
570
571 // look for the best pair of double-tagged event
572
573 bool isDtcand = false;
574 EvtRecDTagCol::iterator iter_i, iter_j;
575
576 for ( int i = 0; i < igood1.size(); i++ )
577 {
578
579 iter_i = m_iterbegin + igood1[i];
580 int charm_i = ( *iter_i )->charm();
581
582 for ( int j = 0; j < igood2.size(); j++ )
583 {
584 iter_j = m_iterbegin + igood2[j];
585 int charm_j = ( *iter_j )->charm();
586 if ( charm_i * charm_j > 0 || igood2[j] == igood1[i] ) continue;
587 if ( shareTracks( iter_i, iter_j ) ) continue;
588
589 m_viterdtag1.push_back( m_iterbegin + igood1[i] );
590 m_viterdtag2.push_back( m_iterbegin + igood2[j] );
591
592 } // end of j loop
593 } // end of i loop
594
595 if ( m_viterdtag1.size() > 0 ) { isDtcand = true; }
596
597 return isDtcand;
598}
599
600bool DTagTool::findADTag( int mode1, int tagcharm1, int mode2, int tagcharm2 ) {
601
602 if ( tagcharm1 * tagcharm2 > 0 )
603 {
604 cout << "double tagging warning! two modes can't have same nonzero charmness" << endl;
605 return false;
606 }
607
608 // define D candidate mass
609 double mDcand = 0;
610 if ( mode1 < 200 && mode2 < 200 ) mDcand = 1.86484;
611 else if ( mode1 >= 200 && mode1 < 400 && mode2 >= 200 && mode2 < 400 ) mDcand = 1.86966;
612 else if ( mode1 >= 400 && mode1 < 1000 && mode2 >= 400 && mode2 < 1000 ) mDcand = 1.96835;
613 else
614 {
615 cout << "double tag modes are not from same particle ! " << endl;
616 return false;
617 }
618
619 vector<int> igood1, igood2;
620 igood1.clear(), igood2.clear();
621 int index = 0;
622 EvtRecDTagCol::iterator iter_dtag = m_iterbegin;
623
624 for ( ; iter_dtag != m_iterend; iter_dtag++ )
625 {
626 int iter_mode = ( *iter_dtag )->decayMode();
627 int iter_charm = ( *iter_dtag )->charm();
628 int iter_type = ( *iter_dtag )->type();
629
630 if ( m_pid )
631 {
632 if ( iter_mode == mode1 && iter_charm == tagcharm1 && iter_type == 1 )
633 igood1.push_back( index );
634
635 if ( iter_mode == mode2 && iter_charm == tagcharm2 && iter_type == 1 )
636 igood2.push_back( index );
637 }
638 else
639 {
640 if ( iter_mode == mode1 && iter_charm == tagcharm1 ) igood1.push_back( index );
641
642 if ( iter_mode == mode2 && iter_charm == tagcharm2 ) igood2.push_back( index );
643 }
644
645 index++;
646 }
647
648 // look for the best pair of double-tagged event
649
650 bool isDtcand = false;
651 double deltaM = 1.00;
652 int index_i = 0, index_j = 0;
653 EvtRecDTagCol::iterator iter_i, iter_j;
654
655 for ( int i = 0; i < igood1.size(); i++ )
656 {
657
658 iter_i = m_iterbegin + igood1[i];
659 int charm_i = ( *iter_i )->charm();
660 for ( int j = 0; j < igood2.size(); j++ )
661 {
662 iter_j = m_iterbegin + igood2[j];
663 int charm_j = ( *iter_j )->charm();
664 if ( charm_i * charm_j > 0 || igood2[j] == igood1[i] ) continue;
665
666 if ( shareTracks( iter_i, iter_j ) ) continue;
667
668 m_viterdtag1.push_back( m_iterbegin + igood1[i] );
669 m_viterdtag2.push_back( m_iterbegin + igood2[j] );
670
671 } // end of j loop
672 } // end of i loop
673
674 if ( m_viterdtag1.size() > 0 ) isDtcand = true;
675
676 return isDtcand;
677
678} // end of findADtag
679
680//////////////////////////////////
681//////////////////////////////////
682
683void DTagTool::operator<<( EvtRecDTagCol::iterator iter ) {
684
685 cout << " print mode:" << ( *iter )->decayMode() << endl;
686 cout << "beam energy is:" << ( *iter )->beamE() << endl;
687 cout << "mBC is:" << ( *iter )->mBC() << endl;
688 cout << "deltaE is:" << ( *iter )->deltaE() << endl;
689 cout << "inv mass is:" << ( *iter )->mass() << endl;
690 cout << "charge is:" << ( *iter )->charge() << endl;
691 cout << "charm is:" << ( *iter )->charm() << endl;
692 cout << "num of children is:" << ( *iter )->numOfChildren() << endl;
693
694 cout << "found " << ( *iter )->tracks().size() << " same side tracks." << endl;
695 cout << "found " << ( *iter )->otherTracks().size() << " other side tracks." << endl;
696 cout << "found " << ( *iter )->showers().size() << " same side showers." << endl;
697 cout << "found " << ( *iter )->otherShowers().size() << " other side showers." << endl;
698}
699
700HepLorentzVector DTagTool::pi0p4( EvtRecPi0Col::iterator pi0Itr, bool isconstrain ) {
701
702 if ( isconstrain )
703 {
704 HepLorentzVector p41 = ( *pi0Itr )->hiPfit();
705 HepLorentzVector p42 = ( *pi0Itr )->loPfit();
706 return ( p41 + p42 );
707 }
708 else
709 {
710 EvtRecTrack* trk1 = const_cast<EvtRecTrack*>( ( *pi0Itr )->hiEnGamma() );
711 EvtRecTrack* trk2 = const_cast<EvtRecTrack*>( ( *pi0Itr )->loEnGamma() );
712
713 RecEmcShower* emctrk1 = ( trk1 )->emcShower();
714 RecEmcShower* emctrk2 = ( trk2 )->emcShower();
715
716 HepLorentzVector p41 = p4shower( emctrk1 );
717 HepLorentzVector p42 = p4shower( emctrk2 );
718 return ( p41 + p42 );
719 }
720}
721
722HepLorentzVector DTagTool::etap4( EvtRecEtaToGGCol::iterator etaItr, bool isconstrain ) {
723
724 if ( isconstrain )
725 {
726 HepLorentzVector p41 = ( *etaItr )->hiPfit();
727 HepLorentzVector p42 = ( *etaItr )->loPfit();
728 return ( p41 + p42 );
729 }
730 else
731 {
732 EvtRecTrack* trk1 = const_cast<EvtRecTrack*>( ( *etaItr )->hiEnGamma() );
733 EvtRecTrack* trk2 = const_cast<EvtRecTrack*>( ( *etaItr )->loEnGamma() );
734
735 RecEmcShower* emctrk1 = ( trk1 )->emcShower();
736 RecEmcShower* emctrk2 = ( trk2 )->emcShower();
737
738 HepLorentzVector p41 = p4shower( emctrk1 );
739 HepLorentzVector p42 = p4shower( emctrk2 );
740 return ( p41 + p42 );
741 }
742}
743
744vector<int> DTagTool::pi0Id( EvtRecDTagCol::iterator iter_dtag, int numpi0 ) {
745
746 SmartRefVector<EvtRecTrack> showers = ( *iter_dtag )->showers();
747 if ( showers.size() < 2 * numpi0 )
748 {
749 cout << "too many pi0 required" << endl;
750 exit( 1 );
751 }
752
753 vector<int> canid;
754 canid.clear();
755
756 for ( EvtRecPi0Col::iterator pi0Itr = m_pi0iterbegin; pi0Itr < m_pi0iterend; pi0Itr++ )
757 {
758
759 /// Access pi0 children
760 EvtRecTrack* heGammaTrk = const_cast<EvtRecTrack*>( ( *pi0Itr )->hiEnGamma() );
761 EvtRecTrack* leGammaTrk = const_cast<EvtRecTrack*>( ( *pi0Itr )->loEnGamma() );
762
763 int heGammaTrkId = heGammaTrk->trackId();
764 int leGammaTrkId = leGammaTrk->trackId();
765
766 for ( int index = 0; index < numpi0; ++index )
767 {
768 bool isheid = false;
769 bool isleid = false;
770
771 for ( int i = index * 2; i < index * 2 + 2; ++i )
772 {
773
774 if ( !isheid && heGammaTrkId == showers[i]->trackId() ) isheid = true;
775 if ( !isleid && leGammaTrkId == showers[i]->trackId() ) isleid = true;
776 }
777
778 if ( isheid && isleid ) canid.push_back( pi0Itr - m_pi0iterbegin );
779 }
780
781 if ( canid.size() == numpi0 )
782 {
783 return canid;
784 break;
785 }
786
787 } // End "pi0Itr" FOR Loop
788
789 return canid;
790}
791
792vector<int> DTagTool::etaId( EvtRecDTagCol::iterator iter_dtag, int numeta ) {
793
794 SmartRefVector<EvtRecTrack> showers = ( *iter_dtag )->showers();
795 if ( showers.size() < 2 * numeta )
796 {
797 cout << "too many eta required" << endl;
798 exit( 1 );
799 }
800
801 vector<int> canid;
802 canid.clear();
803
804 for ( EvtRecEtaToGGCol::iterator etaItr = m_etaiterbegin; etaItr < m_etaiterend; etaItr++ )
805 {
806
807 /// Access eta children
808 EvtRecTrack* heGammaTrk = const_cast<EvtRecTrack*>( ( *etaItr )->hiEnGamma() );
809 EvtRecTrack* leGammaTrk = const_cast<EvtRecTrack*>( ( *etaItr )->loEnGamma() );
810
811 int heGammaTrkId = heGammaTrk->trackId();
812 int leGammaTrkId = leGammaTrk->trackId();
813
814 for ( int index = 0; index < numeta; ++index )
815 {
816 bool isheid = false;
817 bool isleid = false;
818
819 for ( int i = index * 2; i < index * 2 + 2; ++i )
820 {
821
822 if ( !isheid && heGammaTrkId == showers[i]->trackId() ) isheid = true;
823 if ( !isleid && leGammaTrkId == showers[i]->trackId() ) isleid = true;
824 }
825
826 if ( isheid && isleid ) canid.push_back( etaItr - m_etaiterbegin );
827 }
828
829 if ( canid.size() == numeta )
830 {
831 return canid;
832 break;
833 }
834
835 } // End "etaItr" FOR Loop
836
837 return canid;
838}
839
840vector<int> DTagTool::ksId( EvtRecDTagCol::iterator iter_dtag, int numks ) {
841
842 SmartRefVector<EvtRecTrack> tracks = ( *iter_dtag )->tracks();
843 if ( tracks.size() < 2 * numks )
844 {
845 cout << "too many kshort required" << endl;
846 exit( 1 );
847 }
848 vector<int> canid;
849 canid.clear();
850
851 if ( tracks.size() == 0 ) return canid;
852
853 for ( EvtRecVeeVertexCol::iterator ksItr = m_ksiterbegin; ksItr < m_ksiterend; ksItr++ )
854 {
855
856 /// Needed to reject Lambda (and conversion?) combinations
857 if ( ( *ksItr )->vertexId() != 310 ) continue;
858
859 EvtRecTrack* aKsChild1Trk = ( *ksItr )->daughter( 0 );
860 EvtRecTrack* aKsChild2Trk = ( *ksItr )->daughter( 1 );
861
862 int ksChild1TrkId = aKsChild1Trk->trackId();
863 int ksChild2TrkId = aKsChild2Trk->trackId();
864
865 for ( int index = 0; index < numks; ++index )
866 {
867 bool isc1id = false;
868 bool isc2id = false;
869
870 for ( int i = index * 2; i < index * 2 + 2; ++i )
871 {
872 if ( !isc1id && ksChild1TrkId == tracks[i]->trackId() ) isc1id = true;
873 if ( !isc2id && ksChild2TrkId == tracks[i]->trackId() ) isc2id = true;
874 }
875
876 if ( isc1id && isc2id ) canid.push_back( ksItr - m_ksiterbegin );
877 }
878
879 if ( canid.size() == numks )
880 {
881 return canid;
882 break;
883 }
884 } // End "ksItr" FOR Loop
885
886 return canid;
887}
888
889HepLorentzVector DTagTool::p4shower( RecEmcShower* shower ) {
890
891 double Eemc = shower->energy();
892 double phi = shower->phi();
893 double theta = shower->theta();
894 HepLorentzVector p4( Eemc * sin( theta ) * cos( phi ), Eemc * sin( theta ) * sin( phi ),
895 Eemc * cos( theta ), Eemc );
896 return p4;
897}
898
899HepLorentzVector DTagTool::p4( RecMdcKalTrack* mdcKalTrack, int pid ) {
900
901 HepVector zhelix;
902 double mass = 0;
903
904 if ( pid == 0 )
905 {
906 zhelix = mdcKalTrack->getZHelixE();
907 mass = 0.000511;
908 }
909 else if ( pid == 1 )
910 {
911 zhelix = mdcKalTrack->getZHelixMu();
912 mass = 0.105658;
913 }
914 else if ( pid == 2 )
915 {
916 zhelix = mdcKalTrack->getZHelix();
917 mass = 0.139570;
918 }
919 else if ( pid == 3 )
920 {
921 zhelix = mdcKalTrack->getZHelixK();
922 mass = 0.493677;
923 }
924 else
925 {
926 zhelix = mdcKalTrack->getZHelixP();
927 mass = 0.938272;
928 }
929
930 double dr( 0 ), phi0( 0 ), kappa( 0 ), dz( 0 ), tanl( 0 );
931 dr = zhelix[0];
932 phi0 = zhelix[1];
933 kappa = zhelix[2];
934 dz = zhelix[3];
935 tanl = zhelix[4];
936
937 int charge = 0;
938
939 if ( kappa > 0.0000000001 ) charge = 1;
940 else if ( kappa < -0.0000000001 ) charge = -1;
941
942 double pxy = 0;
943 if ( kappa != 0 ) pxy = 1.0 / fabs( kappa );
944
945 double px = pxy * ( -sin( phi0 ) );
946 double py = pxy * cos( phi0 );
947 double pz = pxy * tanl;
948
949 double e = sqrt( pxy * pxy + pz * pz + mass * mass );
950
951 return HepLorentzVector( px, py, pz, e );
952}
953
955
956 SmartRefVector<EvtRecTrack> pionid = ( *m_iterbegin )->pionId();
957
958 for ( int i = 0; i < pionid.size(); i++ )
959 {
960 if ( trk->trackId() == pionid[i]->trackId() )
961 {
962 return true;
963 break;
964 }
965 }
966
967 return false;
968}
969
971 SmartRefVector<EvtRecTrack> kaonid = ( *m_iterbegin )->kaonId();
972
973 for ( int i = 0; i < kaonid.size(); i++ )
974 {
975 if ( trk->trackId() == kaonid[i]->trackId() )
976 {
977 return true;
978 break;
979 }
980 }
981
982 return false;
983}
984
986
987 m_simplePIDSvc->preparePID( trk );
988 return ( m_simplePIDSvc->iselectron( true ) );
989
990 /*
991
992 double dedxchi=-99;
993 double Eemc=0;
994 double ptrk=-99;
995
996 if(trk->isMdcDedxValid()){
997 RecMdcDedx* dedxTrk=trk->mdcDedx();
998 dedxchi=dedxTrk->chiE();
999 }
1000
1001 if( trk->isMdcKalTrackValid() ){
1002 RecMdcKalTrack *mdcKalTrk = trk->mdcKalTrack();
1003 ptrk= mdcKalTrk->p();
1004 }
1005 if( trk->isEmcShowerValid()){
1006 RecEmcShower *emcTrk = trk->emcShower();
1007 Eemc=emcTrk->energy();
1008 }
1009
1010 double eop = Eemc/ptrk;
1011
1012 if( fabs(eop)>0.8 && fabs(dedxchi)<5)
1013 return true;
1014 else
1015 return false;
1016 */
1017}
1018
1020
1021 double depth = -99;
1022
1023 double dedxchi = -99;
1024 double Eemc = 0;
1025 double ptrk = -99;
1026
1027 if ( trk->isMdcDedxValid() )
1028 {
1029 RecMdcDedx* dedxTrk = trk->mdcDedx();
1030 dedxchi = dedxTrk->chiMu();
1031 }
1032
1033 if ( trk->isMdcKalTrackValid() )
1034 {
1035 RecMdcKalTrack* mdcKalTrk = trk->mdcKalTrack();
1036 ptrk = mdcKalTrk->p();
1037 }
1038 if ( trk->isEmcShowerValid() )
1039 {
1040 RecEmcShower* emcTrk = trk->emcShower();
1041 Eemc = emcTrk->energy();
1042 }
1043
1044 double eop = Eemc / ptrk;
1045
1046 if ( trk->isMucTrackValid() )
1047 {
1048 RecMucTrack* mucTrk = trk->mucTrack();
1049 depth = mucTrk->depth();
1050 }
1051
1052 if ( fabs( dedxchi ) < 5 && fabs( Eemc ) > 0.15 && fabs( Eemc ) < 0.3 &&
1053 ( depth >= 80 * ptrk - 60 || depth > 40 ) )
1054 return true;
1055 return false;
1056}
1057
1059
1060 if ( !trk->isMdcKalTrackValid() ) { return false; }
1061
1062 Hep3Vector xorigin( 0, 0, 0 );
1063 IVertexDbSvc* vtxsvc;
1064 Gaudi::svcLocator()->service( "VertexDbSvc", vtxsvc ).ignore();
1065 if ( vtxsvc->isVertexValid() )
1066 {
1067 double* dbv = vtxsvc->PrimaryVertex();
1068 double* vv = vtxsvc->SigmaPrimaryVertex();
1069 xorigin.setX( dbv[0] );
1070 xorigin.setY( dbv[1] );
1071 xorigin.setZ( dbv[2] );
1072 }
1073
1074 RecMdcKalTrack* mdcKalTrk = trk->mdcKalTrack();
1075 mdcKalTrk->setPidType( RecMdcKalTrack::pion );
1076 HepVector a = mdcKalTrk->getZHelix();
1077 HepSymMatrix Ea = mdcKalTrk->getZError();
1078 HepPoint3D pivot( 0., 0., 0. );
1079 HepPoint3D IP( xorigin[0], xorigin[1], xorigin[2] );
1080 VFHelix helixp( pivot, a, Ea );
1081 helixp.pivot( IP );
1082 HepVector vec = helixp.a();
1083 double vrl = vec[0];
1084 double vzl = vec[3];
1085 double costheta = cos( mdcKalTrk->theta() );
1086
1087 if ( fabs( vrl ) < 1 && fabs( vzl ) < 10 && fabs( costheta ) < 0.93 ) return true;
1088 return false;
1089}
1090
1092
1093 if ( !trk->isMdcKalTrackValid() ) { return false; }
1094
1095 Hep3Vector xorigin( 0, 0, 0 );
1096 IVertexDbSvc* vtxsvc;
1097 Gaudi::svcLocator()->service( "VertexDbSvc", vtxsvc ).ignore();
1098 if ( vtxsvc->isVertexValid() )
1099 {
1100 double* dbv = vtxsvc->PrimaryVertex();
1101 double* vv = vtxsvc->SigmaPrimaryVertex();
1102 xorigin.setX( dbv[0] );
1103 xorigin.setY( dbv[1] );
1104 xorigin.setZ( dbv[2] );
1105 }
1106
1107 RecMdcKalTrack* mdcKalTrk = trk->mdcKalTrack();
1108 mdcKalTrk->setPidType( RecMdcKalTrack::pion );
1109 HepVector a = mdcKalTrk->getZHelix();
1110 HepSymMatrix Ea = mdcKalTrk->getZError();
1111 HepPoint3D pivot( 0., 0., 0. );
1112 HepPoint3D IP( xorigin[0], xorigin[1], xorigin[2] );
1113 VFHelix helixp( pivot, a, Ea );
1114 helixp.pivot( IP );
1115 HepVector vec = helixp.a();
1116 double vrl = vec[0];
1117 double vzl = vec[3];
1118 double costheta = cos( mdcKalTrk->theta() );
1119
1120 if ( fabs( vzl ) < 20 && fabs( costheta ) < 0.93 ) { return true; }
1121 return false;
1122}
1123
1125 if ( !( trk->isEmcShowerValid() ) ) return false;
1126 RecEmcShower* emcTrk = trk->emcShower();
1127 double eraw = emcTrk->energy();
1128 double time = emcTrk->time();
1129 double costh = cos( emcTrk->theta() );
1130 if ( ( ( fabs( costh ) < 0.80 && eraw > 0.025 ) ||
1131 ( fabs( costh ) > 0.86 && fabs( costh ) < 0.92 && eraw > 0.05 ) ) &&
1132 time > 0 && time < 14 )
1133 return true;
1134
1135 return false;
1136}
1137
1138bool DTagTool::isGoodShower( EvtRecTrack* trk, double shwDang ) {
1139 if ( !( trk->isEmcShowerValid() ) ) return false;
1140
1141 Hep3Vector xorigin( 0, 0, 0 );
1142 IVertexDbSvc* vtxsvc;
1143 Gaudi::svcLocator()->service( "VertexDbSvc", vtxsvc ).ignore();
1144 if ( vtxsvc->isVertexValid() )
1145 {
1146 double* dbv = vtxsvc->PrimaryVertex();
1147 double* vv = vtxsvc->SigmaPrimaryVertex();
1148 xorigin.setX( dbv[0] );
1149 xorigin.setY( dbv[1] );
1150 xorigin.setZ( dbv[2] );
1151 }
1152 SmartDataPtr<EvtRecEvent> evtRecEvent( eventSvc(), EventModel::EvtRec::EvtRecEvent );
1153 SmartDataPtr<EvtRecTrackCol> evtRecTrackCol( eventSvc(),
1155
1156 RecEmcShower* emcTrk = trk->emcShower();
1157 Hep3Vector emcpos( emcTrk->x(), emcTrk->y(), emcTrk->z() );
1158 Hep3Vector Gm_Vec( emcTrk->x(), emcTrk->y(), emcTrk->z() );
1159 Hep3Vector Gm_Mom = Gm_Vec - xorigin;
1160 Gm_Mom.setMag( emcTrk->energy() );
1161 HepLorentzVector shP4( Gm_Mom, emcTrk->energy() );
1162
1163 double costh = shP4.vect().cosTheta();
1164 double eraw = emcTrk->energy();
1165 double time = emcTrk->time();
1166 if ( time < 0 || time > 14 ) return false;
1167 if ( !( ( fabs( costh ) < 0.80 && eraw > 0.025 ) ||
1168 ( fabs( costh ) > 0.86 && fabs( costh ) < 0.92 && eraw > 0.05 ) ) )
1169 return false;
1170 double dang = 200.;
1171 for ( int j = 0; j < evtRecEvent->totalCharged(); j++ )
1172 {
1173 EvtRecTrackIterator jtTrk = evtRecTrackCol->begin() + j;
1174 if ( !( *jtTrk )->isExtTrackValid() ) continue;
1175 RecExtTrack* extTrk = ( *jtTrk )->extTrack();
1176 if ( extTrk->emcVolumeNumber() == -1 ) continue;
1177 Hep3Vector extpos = extTrk->emcPosition();
1178 double angd = extpos.angle( emcpos );
1179 if ( angd < dang ) dang = angd;
1180 }
1181 if ( dang >= 200 ) return false;
1182 dang = dang * 180 / ( CLHEP::pi );
1183 if ( fabs( dang ) < shwDang ) return false;
1184 return true;
1185}
1186
1188
1189 // good track list
1190 vector<EvtRecTrackIterator> iGood;
1191 iGood.clear();
1192 for ( EvtRecTrackIterator iter = m_chargebegin; iter != m_chargeend; iter++ )
1193 {
1194 if ( isGoodTrack( *iter ) ) iGood.push_back( iter );
1195 }
1196
1197 if ( iGood.size() != 2 ) return true;
1198
1199 // cosmic veto
1200 double time1 = -99, time2 = -99;
1201 for ( vector<EvtRecTrackIterator>::size_type i = 0; i < 2; i++ )
1202 {
1203 if ( ( *iGood[i] )->isTofTrackValid() )
1204 {
1205 SmartRefVector<RecTofTrack> tofTrkCol = ( *iGood[i] )->tofTrack();
1206 SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
1207
1208 for ( ; iter_tof != tofTrkCol.end(); iter_tof++ )
1209 {
1210 TofHitStatus* status = new TofHitStatus;
1211 status->setStatus( ( *iter_tof )->status() );
1212 if ( status->is_cluster() )
1213 {
1214 if ( i == 0 ) time1 = ( *iter_tof )->tof();
1215 else time2 = ( *iter_tof )->tof();
1216 }
1217 delete status;
1218 }
1219 }
1220 }
1221 if ( time1 != -99 && time2 != -99 && fabs( time1 - time2 ) > 5 ) return false;
1222
1223 // rad bhabha veto
1224 if ( isElectron( *iGood[0] ) && isElectron( *iGood[1] ) ) return false;
1225
1226 // rad dimu veto
1227 if ( isMuon( *iGood[0] ) && isMuon( *iGood[1] ) ) return false;
1228
1229 // require additonal emc shower in the event
1230 if ( emc )
1231 {
1232
1233 bool gotgoodshower = false;
1234
1235 for ( EvtRecTrackIterator iter = m_showerbegin; iter != m_showerend; iter++ )
1236 {
1237
1238 if ( !( *iter )->isEmcShowerValid() ) continue;
1239 RecEmcShower* emcTrk = ( *iter )->emcShower();
1240
1241 double eraw = emcTrk->energy();
1242 double time = emcTrk->time();
1243 if ( !( eraw > 0.05 && time > 0 && time < 14 ) ) continue;
1244
1245 double angle1 = angleShowerwithTrack( *iter, *iGood[0] );
1246 double angle2 = angleShowerwithTrack( *iter, *iGood[1] );
1247
1248 if ( angle1 > 20 && angle2 > 20 )
1249 {
1250 gotgoodshower = true;
1251 break;
1252 }
1253 }
1254
1255 return gotgoodshower;
1256
1257 } // end of adding emc
1258
1259 return true;
1260}
1261
1263
1264 double angle = -100;
1265
1266 RecEmcShower* emcTrk = shower->emcShower();
1267 Hep3Vector emcpos( emcTrk->x(), emcTrk->y(), emcTrk->z() );
1268
1269 if ( !track->isExtTrackValid() ) return angle;
1270 RecExtTrack* extTrk = track->extTrack();
1271 if ( extTrk->emcVolumeNumber() == -1 ) return angle;
1272 Hep3Vector extpos = extTrk->emcPosition();
1273 // maqm if(extpos==(-99,-99,-99))
1274 Hep3Vector temp( -99, -99, -99 );
1275 if ( extpos == temp ) return angle;
1276
1277 return extpos.angle( emcpos ) * 180 / CLHEP::pi;
1278}
1279
1280bool DTagTool::shareTracks( EvtRecDTagCol::iterator iter1, EvtRecDTagCol::iterator iter2 ) {
1281
1282 SmartRefVector<EvtRecTrack> tracks1 = ( *iter1 )->tracks();
1283 SmartRefVector<EvtRecTrack> showers1 = ( *iter1 )->showers();
1284 SmartRefVector<EvtRecTrack> tracks2 = ( *iter2 )->tracks();
1285 SmartRefVector<EvtRecTrack> showers2 = ( *iter2 )->showers();
1286
1287 // charged tracks
1288 for ( int i = 0; i < tracks1.size(); i++ )
1289 {
1290 for ( int j = 0; j < tracks2.size(); j++ )
1291 {
1292 if ( tracks1[i] == tracks2[j] ) return true;
1293 }
1294 }
1295
1296 // neutral showers
1297 for ( int i = 0; i < showers1.size(); i++ )
1298 {
1299 for ( int j = 0; j < showers2.size(); j++ )
1300 {
1301 if ( showers1[i] == showers2[j] ) return true;
1302 }
1303 }
1304
1305 return false;
1306}
1307
1308IDataProviderSvc* DTagTool::eventSvc() {
1309
1310 if ( m_evtSvc == 0 )
1311 {
1312
1313 StatusCode sc = Gaudi::svcLocator()->service( "EventDataSvc", m_evtSvc, true );
1314 if ( sc.isFailure() ) { assert( false ); }
1315 }
1316
1317 return m_evtSvc;
1318}
dble_vec_t vec[12]
double mass
HepGeom::Point3D< double > HepPoint3D
Double_t time
EvtRecTrackCol::iterator EvtRecTrackIterator
DOUBLE_PRECISION count[3]
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
vector< int > pi0Id(EvtRecDTagCol::iterator iter, int numpi0=1)
Definition DTagTool.cxx:744
vector< int > etaId(EvtRecDTagCol::iterator iter, int numeta=1)
Definition DTagTool.cxx:792
bool isGoodTrack(EvtRecTrack *trk)
bool isPion(EvtRecTrack *trk)
Definition DTagTool.cxx:954
double angleShowerwithTrack(EvtRecTrack *shower, EvtRecTrack *track)
void clear()
Definition DTagTool.cxx:118
bool isElectron(EvtRecTrack *trk)
Definition DTagTool.cxx:985
bool isKaon(EvtRecTrack *trk)
Definition DTagTool.cxx:970
bool findDTag(EvtRecDTag::DecayMode mode1, EvtRecDTag::DecayMode mode2, string smass="mbc")
Definition DTagTool.cxx:291
bool shareTracks(EvtRecDTagCol::iterator iter1, EvtRecDTagCol::iterator iter2)
vector< int > mode(EvtRecDTag::DecayMode decaymode)
Definition DTagTool.cxx:161
bool findSTag(EvtRecDTag::DecayMode mode, int tagcharm)
Definition DTagTool.cxx:208
bool isGoodTrack_loose(EvtRecTrack *trk)
HepLorentzVector pi0p4(EvtRecPi0Col::iterator pi0Itr, bool isconstrain=true)
Definition DTagTool.cxx:700
bool compare(EvtRecDTagCol::iterator pair1_iter1, EvtRecDTagCol::iterator pair1_iter2, EvtRecDTagCol::iterator pair2_iter1, EvtRecDTagCol::iterator pair2_iter2, double mD, string smass)
Definition DTagTool.cxx:132
vector< int > ksId(EvtRecDTagCol::iterator iter, int numks=1)
Definition DTagTool.cxx:840
void operator<<(EvtRecDTagCol::iterator iter)
Definition DTagTool.cxx:683
IDataProviderSvc * eventSvc()
bool isGoodShower(EvtRecTrack *trk)
HepLorentzVector p4(RecMdcKalTrack *mdcKalTrack, int pid)
Definition DTagTool.cxx:899
bool isMuon(EvtRecTrack *trk)
HepLorentzVector p4shower(RecEmcShower *shower)
Definition DTagTool.cxx:889
HepLorentzVector etap4(EvtRecEtaToGGCol::iterator etaItr, bool isconstrain=true)
Definition DTagTool.cxx:722
bool findADTag(EvtRecDTag::DecayMode mode1, EvtRecDTag::DecayMode mode2)
Definition DTagTool.cxx:306
bool cosmicandleptonVeto(bool emc=true)
virtual bool isVertexValid()=0
virtual double * SigmaPrimaryVertex()=0
virtual double * PrimaryVertex()=0
void setStatus(unsigned int status)
const HepPoint3D & pivot(void) const
returns pivot position.
const HepVector & a(void) const
returns helix parameters.