ATLAS Offline Software
T_AnalysisConfig_Tier0.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
23 #ifndef TrigInDetAnalysisExample_T_AnalysisConfig_Tier0_H
24 #define TrigInDetAnalysisExample_T_AnalysisConfig_Tier0_H
25 
26 
30 
35 
36 #include "TTree.h"
37 #include "TFile.h"
38 
39 
40 // McParticleEvent includes
42 
44 #include "AtlasHepMC/GenEvent.h"
45 #include "AtlasHepMC/GenVertex.h"
46 #include "AtlasHepMC/GenParticle.h"
47 
48 #include "EventInfo/EventInfo.h"
49 #include "EventInfo/EventID.h"
51 
52 
53 
55 
57 
63 
64 
65 #include "VxVertex/VxContainer.h"
66 
68 
70 
72 
73 
76 
78 
81 
82 
83 
84 
85 
86 template<typename T>
88 
89 public:
90 
91  // Full constructor: test/reference/selection
92  // - analysisInstanceName: the name of the analysis chain being created
93  // - xxxChainName: the name of the chain to be used as test/reference/selection; must be "StoreGate" in case of direct access to SG containers
94  // - xxxType: the type of tracks to be retrieved from the test/reference/selection chain or container
95  // - xxxKey: the key for tracks to be retrieved from the test/reference/selection chain or container
96  // - all standard operations are performed in loops over 0=test 1=reference 2=selection
97  T_AnalysisConfig_Tier0(const std::string& analysisInstanceName,
98  const std::string& testChainName, const std::string& testType, const std::string& testKey,
99  const std::string& referenceChainName, const std::string& referenceType, const std::string& referenceKey,
100  TrackFilter* testFilter, TrackFilter* referenceFilter,
101  TrackAssociator* associator,
103  T_AnalysisConfig<T>( analysisInstanceName,
104  testChainName, testType, testKey,
105  referenceChainName, referenceType, referenceKey,
106  testFilter, referenceFilter,
107  associator,
108  analysis ),
109  _analysis(0),
110  m_useBeamCondSvc(false),
111  m_doOffline(true),
112  m_doMuons(false),
113  m_doElectrons(false),
114  m_doTaus(false),
115  m_doBjets(false),
116  m_hasTruthMap(false),
117  m_doTauThreeProng(false),
118  m_tauEtCutOffline(false),
119  m_NRois(0),
120  m_NRefTracks(0),
121  m_NTestTracks(0),
122  m_runPurity(false),
123  m_shifter(false),
124  m_pTthreshold(0),
125  m_first(true),
126  m_containTracks(false)
127  {
128  m_event = new TIDA::Event();
129  m_chainNames.push_back(testChainName);
130 
131 #if 0
132  ChainString& chain = m_chainNames.back();
133 
134  std::cout << "\nT_AnalysisConfig_Tier0::name: " << name() << "\t" << this << std::endl;
135  std::cout << "T_AnalysisConfig_Tier0::chain specification: " << testChainName << " -> " << chain << "\t" << chain.raw() << std::endl;
136  std::cout << "\tchain: " << chain.head() << std::endl;
137  std::cout << "\tkey: " << chain.tail() << std::endl;
138  std::cout << "\troi: " << chain.roi() << std::endl;
139  std::cout << "\tvtx: " << chain.vtx() << std::endl;
140  std::cout << "\tte: " << chain.element() << std::endl;
141 
142  std::cout << "\tpost: " << chain.post() << std::endl;
143  std::cout << "\tpt: " << chain.postvalue("pt") << std::endl;
144 
145  std::cout << "\tcontainTracks: " << m_containTracks << std::endl;
146 #endif
147 
148  m_testType = testType;
149  }
150 
151  virtual ~T_AnalysisConfig_Tier0() { delete m_event; }
152 
153  void setRunPurity( bool b ) { m_runPurity=b; }
154 
155  void setShifter( bool b ) { m_shifter=b; }
156 
157  void useBeamCondSvc( bool b ) { m_useBeamCondSvc = b; }
158 
159  void containTracks( bool b ) { m_containTracks = b; }
160 
161 public:
162 
164 
166  // void verbose( std::ostream& s ) {
167  // if( m_provider->msg().level() <= MSG::VERBOSE ) m_provider->msg(MSG::VERBOSE) << s << endmsg;
168  // }
169 
170 protected:
171 
175 
178 
183 
184  // using T_AnalysisConfig<T>::selectTracks<TrigInDetTrackCollection>;
185 
186  // using T_AnalysisConfig<T>::selectTracks;
187 
188  virtual void loop() {
189 
190  if( m_provider->msg().level() <= MSG::VERBOSE) {
191  m_provider->msg(MSG::VERBOSE) << "AnalysisConfig_Tier0::loop() for " << T_AnalysisConfig<T>::m_analysisInstanceName << endmsg;
192  }
193 
194  // get (offline) beam position
195  double xbeam = 0;
196  double ybeam = 0;
197 
198  if ( m_first ) {
199 
200  m_first = false;
201 
202  m_provider->msg(MSG::VERBOSE) << " using beam position\tx=" << xbeam << "\ty=" << ybeam << endmsg;
203 
204  if (m_provider->msg().level() <= MSG::VERBOSE) {
205 
206  std::vector<std::string> configuredChains = (*(m_tdt))->getListOfTriggers("L2_.*, EF_.*, HLT_.*");
207 
208  for ( unsigned i=0 ; i<configuredChains.size() ; i++ ) {
209  m_provider->msg(MSG::VERBOSE) << "Chain " << configuredChains[i] << endmsg;
210  }
211 
212  }
213 
214 
216 
217  std::vector<ChainString> chains;
218 
222  while ( chainitr!=m_chainNames.end() ) {
223 
225  ChainString& chainName = (*chainitr);
226 
227  m_provider->msg(MSG::INFO) << "process chain " << chainName << endmsg;
228 
229  if ( chainName.head() == "" ) {
230 
231  std::string selectChain = chainName.raw();
232 
233  chains.push_back( ChainString(selectChain) );
234 
235  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
236  m_provider->msg(MSG::VERBOSE) << "Matching chain " << selectChain << " (" << chainName.head() << ")" << endmsg;
237  }
238 
239  }
240  else {
241 
243  std::vector<std::string> selectChains = (*(m_tdt))->getListOfTriggers( chainName.head() );
244 
245 
246  for ( unsigned iselected=0 ; iselected<selectChains.size() ; iselected++ ) {
247 
248  selectChains[iselected] = chainName.subs( selectChains[iselected] );
249 
250 #if 0
251  std::cout << "sorting:: chain specification: " << chainName << "\traw:" << chainName.raw() << std::endl;
252  std::cout << "\tchain: " << chainName.head() << std::endl;
253  std::cout << "\tkey: " << chainName.tail() << std::endl;
254  std::cout << "\troi: " << chainName.roi() << std::endl;
255  std::cout << "\tvtx: " << chainName.vtx() << std::endl;
256  std::cout << "\tte: " << chainName.element() << std::endl;
257  std::cout << "\tind: " << chainName.extra() << std::endl;
258 #endif
259 
261  chains.push_back( ChainString(selectChains[iselected]) );
262 
263  if(m_provider->msg().level() <= MSG::VERBOSE) {
264  m_provider->msg(MSG::VERBOSE) << "Matching chain " << selectChains[iselected] << " (" << chainName.head() << ")" << endmsg;
265  }
266 
267  }
268  }
269 
270  ++chainitr;
271  }
272 
273  // m_chainNames.insert( m_chainNames.end(), chains.begin(), chains.end() );
275 
276  for ( unsigned ic=0 ; ic<m_chainNames.size() ; ic++ ) m_provider->msg(MSG::VERBOSE) << "Analyse chain " << m_chainNames[ic] << endmsg;
277 
278  }
279 
280 
283 
284  Filter_etaPT filter_etaPT(5,200);
285  Filter_Combined filter_truth( &filter_etaPT, &filter_etaPT);
286 
288  // Filter_Combined filterRef (&filter_offline, &filter_vertex);
289 
290  int iRefFilter = 1;
291  int iTestFilter = 0;
292 
293  if ( m_runPurity ) {
294  iRefFilter = 0;
295  iTestFilter = 1;
296  }
297 
298  Filter_Combined filterRef( m_filters[iRefFilter][0], &filter );
299  Filter_Combined filterTest( m_filters[iTestFilter][0], &filter );
300 
301  TrigTrackSelector selectorTruth( &filter_truth );
302  TrigTrackSelector selectorRef( &filterRef );
303  m_selectorRef = &selectorRef;
304  TrigTrackSelector selectorTest( &filterTest );
305  m_selectorTest = &selectorTest;
306 
307  if ( xbeam!=0 || ybeam!=0 ) {
308  m_selectorRef->setBeamline( xbeam, ybeam );
309  }
310 
312 
313  // clear the ntuple TIDA::Event class
314  m_event->clear();
315 
317 #ifndef XAODTRACKING_TRACKPARTICLE_H
318  const EventInfo* pEventInfo;
319 #else
320  const xAOD::EventInfo* pEventInfo;
321 #endif
322  unsigned run_number = 0;
323  uint64_t event_number = 0;
324  unsigned lumi_block = 0;
325  unsigned bunch_crossing_id = 0;
326  unsigned time_stamp = 0;
327  double mu_val = 0;
328 
329  if ( this->template retrieve(pEventInfo, "EventInfo").isFailure() ) {
330  m_provider->msg(MSG::WARNING) << "Failed to get EventInfo " << endmsg;
331  } else {
332 
333 #ifndef XAODTRACKING_TRACKPARTICLE_H
334  run_number = pEventInfo->event_ID()->run_number();
335  event_number = pEventInfo->event_ID()->event_number();
336  lumi_block = pEventInfo->event_ID()->lumi_block();
337  time_stamp = pEventInfo->event_ID()->time_stamp();
338  bunch_crossing_id = pEventInfo->event_ID()->bunch_crossing_id();
339  mu_val = pEventInfo->averageInteractionsPerCrossing();
340 #else
341  run_number = pEventInfo->runNumber();
342  event_number = pEventInfo->eventNumber();
343  lumi_block = pEventInfo->lumiBlock();
344  time_stamp = pEventInfo->timeStamp();
345  bunch_crossing_id = pEventInfo->bcid();
346  mu_val = pEventInfo->averageInteractionsPerCrossing();
347 #endif
348  }
349 
350  if(m_provider->msg().level() <= MSG::VERBOSE){
351  m_provider->msg(MSG::VERBOSE) << "run " << run_number
352  << "\tevent " << event_number
353  << "\tlb " << lumi_block << endmsg;
354  }
355 
356  // m_provider->msg(MSG::INFO) << "run " << run_number
357  // << "\tevent " << event_number
358  // << "\tlb " << lumi_block << endmsg;
359 
360  // std::cout << "run " << run_number << "\tevent " << event_number << "\tlb " << lumi_block << std::endl;
361 
362 
363  // clear the ntuple TIDA::Event class
364  m_event->clear();
365 
367  m_event->event_number(event_number);
368  m_event->lumi_block(lumi_block);
369  m_event->time_stamp(time_stamp);
370  m_event->bunch_crossing_id(bunch_crossing_id);
371  m_event->mu(mu_val);
372 
375 
376  bool analyse = false;
377 
378  // Check HLTResult
379 
380  for ( unsigned ichain=0 ; ichain<m_chainNames.size() ; ichain++ ) {
381 
382  const std::string& chainname = m_chainNames[ichain].head();
383 
384  if ( chainname == "" ) analyse = true;
385  else {
386 
387  //Only for trigger chains
388  if ( chainname.find("L2") == std::string::npos &&
389  chainname.find("EF") == std::string::npos &&
390  chainname.find("HLT") == std::string::npos ) continue;
391 
392  if ( m_provider->msg().level() <= MSG::DEBUG ) {
393  m_provider->msg(MSG::DEBUG) << "Chain " << chainname
394  << "\tpass " << (*m_tdt)->isPassed(chainname)
395  << "\tpres " << (*m_tdt)->getPrescale(chainname) << endmsg;
396  }
397 
398  // std::cout << "Chain " << chainname << "\tpass " << (*m_tdt)->isPassed(chainname)
399  // << "\tpres " << (*m_tdt)->getPrescale(chainname) << std::endl;
400 
401  if ( (*(m_tdt))->isPassed(chainname) || (*(m_tdt))->getPrescale(chainname) ) analyse = true;
402 
403  }
404  }
405 
406  // Remove this code to skip on truncated HLT results
407  // Need to leave the code here for the time being however, since we will
408  // still need in the future a more robust test to achieve this same
409  // functionality
410  //
411  // if ( (*m_tdt)->ExperimentalAndExpertMethods().isHLTTruncated() ) {
412  // m_provider->msg(MSG::WARNING) << "HLTResult truncated, skipping event" << endmsg;
413  // return;
414  // }
415 
416  if ( !this->m_keepAllEvents && !analyse ) {
417  // m_provider->msg(MSG::VERBOSE) << "No chains passed unprescaled - not processing this event" << endmsg;
418  if(m_provider->msg().level() <= MSG::VERBOSE)
419  m_provider->msg(MSG::VERBOSE) << "No chains passed unprescaled - not processing this event" << endmsg;
420  return;
421  }
422 
424 
425  selectorTruth.clear();
426 
427  if(m_provider->msg().level() <= MSG::VERBOSE)
428  m_provider->msg(MSG::VERBOSE) << "MC Truth flag " << m_mcTruth << endmsg;
429 
430  const TrigInDetTrackTruthMap* truthMap = 0;
431 
432  if ( m_mcTruth ) {
433  if(m_provider->msg().level() <= MSG::VERBOSE ) m_provider->msg(MSG::VERBOSE) << "getting Truth" << endmsg;
434 
435  if ( this->template retrieve(truthMap, "TrigInDetTrackTruthMap").isFailure()) {
436  if(m_provider->msg().level() <= MSG::VERBOSE)
437  m_provider->msg(MSG::VERBOSE) << "TrigInDetTrackTruthMap not found" << endmsg;
438  m_hasTruthMap = false;
439  }
440  else {
441  if(m_provider->msg().level() <= MSG::VERBOSE)
442  m_provider->msg(MSG::VERBOSE) << "TrigInDetTrackTruthMap found" << endmsg;
443  m_hasTruthMap = true;
444  }
445  }
446 
447 
449 
450  std::vector<TIDA::Vertex> vertices;
451  std::vector<TIDA::Vertex> vertices_rec;
452 
453  std::vector<double> refbeamspot;
454  std::vector<double> testbeamspot;
455 
456 
457 
458 #ifndef XAODTRACKING_TRACKPARTICLE_H
459 
460  const VxContainer* primaryVtxCollection;
461 
462  if ( m_doOffline ) {
463  if ( m_provider->evtStore()->template contains<VxContainer>("VxPrimaryCandidate") ) {
464  if ( this->template retrieve(primaryVtxCollection, "VxPrimaryCandidate").isFailure()) {
465  if (m_provider->msg().level() <= MSG::WARNING) m_provider->msg(MSG::WARNING) << "Primary vertex container not found" << endmsg;
466  }
467  else {
468  VxContainer::const_iterator vtxitr = primaryVtxCollection->begin();
469  for ( ; vtxitr != primaryVtxCollection->end(); ++vtxitr) {
470  if ( (*vtxitr)->vxTrackAtVertex()->size()>0 ) {
471  vertices.push_back( TIDA::Vertex( (*vtxitr)->recVertex().position().x(),
472  (*vtxitr)->recVertex().position().y(),
473  (*vtxitr)->recVertex().position().z(),
474  0,0,0,
475  (*vtxitr)->vxTrackAtVertex()->size() ) );
476  }
477  }
478  }
479 
480  // filter_vertex.setVertex(vertices);
481  }
482  }
483 
484 #else
485 
486  //std::vector<TIDA::Vertex> vertices;
487 
488  m_provider->msg(MSG::VERBOSE) << "fetching AOD Primary vertex container" << endmsg;
489 
490  const xAOD::VertexContainer* xaodVtxCollection = 0;
491 
492  if ( this->template retrieve( xaodVtxCollection, "PrimaryVertices" ).isFailure()) {
493  if (m_provider->msg().level() <= MSG::WARNING) m_provider->msg(MSG::WARNING) << "xAOD Primary vertex container not found with key " << "PrimaryVertices" << endmsg;
494  }
495 
496  if ( xaodVtxCollection!=0 ) {
497 
498  m_provider->msg(MSG::VERBOSE) << "xAOD Primary vertex container " << xaodVtxCollection->size() << " entries" << endmsg;
499 
500  xAOD::VertexContainer::const_iterator vtxitr = xaodVtxCollection->begin();
501  for ( ; vtxitr != xaodVtxCollection->end(); ++vtxitr ) {
502  if ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) {
503  vertices.push_back( TIDA::Vertex( (*vtxitr)->x(),
504  (*vtxitr)->y(),
505  (*vtxitr)->z(),
507  (*vtxitr)->covariancePosition()(Trk::x,Trk::x),
508  (*vtxitr)->covariancePosition()(Trk::y,Trk::y),
509  (*vtxitr)->covariancePosition()(Trk::z,Trk::z),
510  (*vtxitr)->nTrackParticles(),
512  (*vtxitr)->chiSquared(),
513  (*vtxitr)->numberDoF() ) );
514  }
515  }
516  }
517 
518 
519 #endif
520 
521 
523 
524  if ( m_mcTruth ) {
525  m_event->addChain( "Truth" );
527  m_event->back().back().addTracks(selectorTruth.tracks());
528  }
529 
531 
532  if ( m_doOffline ) {
533  for ( unsigned i=0 ; i<vertices.size() ; i++ ) {
534  if(m_provider->msg().level() <= MSG::VERBOSE)
535  m_provider->msg(MSG::VERBOSE) << "vertex " << i << " " << vertices[i] << endmsg;
536  m_event->addVertex(vertices[i]);
537  }
538  }
539 
541 
542  // int Noff = 0;
543  std::vector<TIDA::Track*> offline_tracks;
544  std::vector<TIDA::Track*> electron_tracks;
545  std::vector<TIDA::Track*> muon_tracks;
546 
547  std::vector<TIDA::Track*> ref_tracks;
548  std::vector<TIDA::Track*> test_tracks;
549 
550  offline_tracks.clear();
551  electron_tracks.clear();
552  muon_tracks.clear();
553 
554  ref_tracks.clear();
555  test_tracks.clear();
556 
558  for ( unsigned ichain=0 ; ichain<m_chainNames.size() ; ichain++ ) {
559 
560  test_tracks.clear();
561 
563 
564  // std::string& chainname = chains[ichain];
565  const std::string& chainname = m_chainNames[ichain].head();
566  const std::string& key = m_chainNames[ichain].tail();
567  const std::string& vtx_name = m_chainNames[ichain].vtx();
568  //no currently used but retained in case
569  //const std::string& roi_name = m_chainNames[ichain].roi();
570  //const std::string& te_name = m_chainNames[ichain].element();
571 
572  m_pTthreshold = 0;
573 
574  if ( m_chainNames[ichain].postcount() ) {
575  std::string ptvalue = m_chainNames[ichain].postvalue("pt");
576  if ( ptvalue!="" ) m_pTthreshold = std::stod(ptvalue);
577  }
578 
579  // std::cout << "\tchain " << m_chainNames[ichain] << "\tchainname " << chainname << "\tvtx " << vtx_name << "\troi " << roi_name << std::endl;
580 
581  unsigned _decisiontype = TrigDefs::Physics;
582  unsigned decisiontype;
583 
584  if ( this->requireDecision() ) _decisiontype = TrigDefs::requireDecision;
585 
586 
587  if ( m_chainNames[ichain].passed() ) decisiontype = _decisiontype;
588  else decisiontype = TrigDefs::alsoDeactivateTEs;
589 
590  // if ( decisiontype==TrigDefs::requireDecision ) std::cout << "\tSUTT TrigDefs::requireDecision " << decisiontype << std::endl;
591  // if ( decisiontype==TrigDefs::Physics ) std::cout << "\tSUTT TrigDefs::Physics " << decisiontype << std::endl;
592 
593 
595  const std::string& key_index_string = m_chainNames[ichain].extra();
596  unsigned key_index = 0;
597  if ( key_index_string!="" ) key_index = std::atoi( key_index_string.c_str() );
598 
599  if ( chainname!="" && m_provider->msg().level() <= MSG::VERBOSE ) {
600 
601  m_provider->msg(MSG::VERBOSE) << "status for chain " << chainname
602  << "\tpass " << (*m_tdt)->isPassed(chainname)
603  << "\tprescale " << (*m_tdt)->getPrescale(chainname) << endmsg;
604 
605  m_provider->msg(MSG::VERBOSE) << "fetching features for chain " << chainname << endmsg;
606 
607  m_provider->msg(MSG::VERBOSE) << chainname << "\tpassed: " << (*m_tdt)->isPassed( chainname ) << endmsg;
608  }
609 
610  // std::cout << "\tstatus for chain " << chainname
611  // << "\tpass " << (*m_tdt)->isPassed( chainname )
612  // << "\tpassdt " << (*m_tdt)->isPassed( chainname, decisiontype )
613  // << "\tprescale " << (*m_tdt)->getPrescale( chainname ) << std::endl;
614 
615 
616  // m_provider->msg(MSG::INFO) << chainname << "\tpassed: " << (*m_tdt)->isPassed( chainname ) << "\t" << m_chainNames[ichain] << "\trun " << run_number << "\tevent " << event_number << endmsg;
617 
618 
619  if ( chainname!="" && !this->m_keepAllEvents && !(*m_tdt)->isPassed( chainname, decisiontype ) ) continue;
620 
623  // Trig::FeatureContainer f = (*m_tdt)->features( chainname, TrigDefs::alsoDeactivateTEs);
624 
627 
628  ChainString& chainConfig = m_chainNames[ichain];
629 
630  std::string chainName = chainConfig.head();
631 
632  m_event->addChain( chainConfig );
633 
635 
636  if ( chainName == "" ) {
637 
639 
641 
642  TIDARoiDescriptor* roiInfo = new TIDARoiDescriptor(true);
643 
644  chain.addRoi( *roiInfo );
645 
646 
647 # ifdef XAODTRACKING_TRACKPARTICLE_H
648  if ( m_provider->evtStore()->template contains<xAOD::TrackParticleContainer>(key) ) {
649  this->template selectTracks<xAOD::TrackParticleContainer>( m_selectorTest, key );
650  refbeamspot = this->template getBeamspot<xAOD::TrackParticleContainer>( key );
651  }
652 # endif
653 
654  const std::vector<TIDA::Track*>& testtracks = m_selectorTest->tracks();
655 
656  chain.back().addTracks(testtracks);
657 
658  delete roiInfo;
659 
660  }
661  else {
662 
663  Trig::FeatureContainer f = (*m_tdt)->features( chainname, decisiontype );
664  Trig::FeatureContainer::combination_const_iterator c(f.getCombinations().begin());
665  Trig::FeatureContainer::combination_const_iterator cEnd(f.getCombinations().end());
666 
667 
668  if ( c==cEnd ) {
669  if(m_provider->msg().level() <= MSG::VERBOSE){
670  m_provider->msg(MSG::VERBOSE) << "No combinations: skipping this chain " << chainname << endmsg;
671  }
672  continue;
673  }
674 
675  if(m_provider->msg().level() <= MSG::VERBOSE) {
676  m_provider->msg(MSG::VERBOSE) << "combinations for chain " << chainname << " " << (cEnd-c) << endmsg;
677  }
678 
679  unsigned icomb = 0;
680 
681  for( ; c!=cEnd ; ++c ) {
682 
683  icomb++;
684 
685  // now add rois to this ntuple chain
686 
687  // Get seeding RoI
688  // std::vector< Trig::Feature<TrigRoiDescriptor> > initRois = c->get<TrigRoiDescriptor>("initialRoI", TrigDefs::alsoDeactivateTEs);
689  // std::vector< Trig::Feature<TrigRoiDescriptor> > initRois = c->get<TrigRoiDescriptor>("forID", TrigDefs::alsoDeactivateTEs);
690 
691  std::vector< Trig::Feature<TrigRoiDescriptor> > initRois;
692 
693  std::string roi_key = m_chainNames[ichain].roi();
694 
695  if ( roi_key=="SuperRoi" && icomb>1 ) continue;
696 
697  if ( roi_key!="" ) {
698  initRois = c->get<TrigRoiDescriptor>(roi_key, decisiontype );
699  }
700  else {
701  initRois = c->get<TrigRoiDescriptor>("forID", decisiontype );
702  if ( initRois.empty() ) initRois = c->get<TrigRoiDescriptor>("", decisiontype );
703  if ( initRois.empty() ) initRois = c->get<TrigRoiDescriptor>("initialRoI", decisiontype );
704  }
705 
706  // std::cout << "initRois.size() " << initRois.size() << std::endl;
707 
708  if ( initRois.empty() ) continue;
709 
710 
711  // for ( unsigned ir=0 ; ir<initRois.size() ; ir++ ) {
712  // std::cout << "\t" << ir << "\t" << *initRois[ir].cptr() << std::endl;
713  // }
714 
715  // Skip chains seeded by multiple RoIs: not yet implemented
716  if(initRois.size()>1 && roi_key!="SuperRoi" ) {
717  if(m_provider->msg().level() <= MSG::VERBOSE)
718  m_provider->msg(MSG::VERBOSE) << " More than one initial RoI found for seeded chain " << chainname << ": not yet supported" << endmsg;
719  continue;
720  }
721 
722  TIDARoiDescriptor* roiInfo = 0;
723 
724  if( !initRois.empty() ) {
725  const TrigRoiDescriptor* roid = initRois[0].cptr();
726 
727  if(m_provider->msg().level() <= MSG::VERBOSE)
728  m_provider->msg(MSG::VERBOSE) << " RoI descriptor for seeded chain " << chainname << " " << *roid << endmsg;
729 
730  roiInfo = new TIDARoiDescriptor(TIDARoiDescriptorBuilder(*roid));
731  // roiInfo->etaHalfWidth(m_roiInfo->etaHalfWidth());
732  // roiInfo->phiHalfWidth(m_roiInfo->phiHalfWidth());
733  // roiInfo->etaHalfWidth(roid->etaHalfWidth());
734  // roiInfo->phiHalfWidth(roid->phiHalfWidth());
735  // roiInfo->zedHalfWidth(roid->zedHalfWidth());
736 
737  if(m_provider->msg().level() <= MSG::VERBOSE)
738  m_provider->msg(MSG::VERBOSE) << "using chain roi " << *roid << endmsg;
739 
740  }
741  else {
742  roiInfo = new TIDARoiDescriptor();
743  // roiInfo->etaHalfWidth(5);
744  // roiInfo->phiHalfWidth(M_PI);
745  // roiInfo->zedHalfWidth(m_roiInfo->zedHalfWidth());
746 
747  if(m_provider->msg().level() <= MSG::WARNING)
748  m_provider->msg(MSG::WARNING) << "roi not found" << endmsg;
749 
750  }
751 
752  if(m_provider->msg().level() <= MSG::VERBOSE) m_provider->msg(MSG::VERBOSE) << *roiInfo << endmsg;
753 
755 
756  m_provider->msg(MSG::VERBOSE) << "Searching for collection " << key << endmsg;
757  // std::cout << "Searching for collection " << key << std::endl;
758 
760  if ( key.find("InDetTrigParticleCreation")!=std::string::npos ||
761  key.find("_IDTrig")!=std::string::npos ||
762  key.find("_EFID")!=std::string::npos ||
763  chainName.find("EF_")!=std::string::npos ||
764  chainName.find("HLT_")!=std::string::npos ) {
765 # ifdef XAODTRACKING_TRACKPARTICLE_H
766  if ( this->template selectTracks<xAOD::TrackParticleContainer>( m_selectorTest, c, key ) ) testbeamspot = this->template getBeamspot<xAOD::TrackParticleContainer>( c, key );
767  else if ( this->template selectTracks<Rec::TrackParticleContainer>( m_selectorTest, c, key ) );
768 # else
769  if ( this->template selectTracks<Rec::TrackParticleContainer>( m_selectorTest, c, key ) );
770 # endif
771  else if ( this->template selectTracks<TrackCollection>( m_selectorTest, c, key ) );
772  else if ( this->template selectTracks<TrigInDetTrackCollection>( m_selectorTest, c, truthMap, key, key_index ) );
773  else {
774  //m_provider->msg(MSG::WARNING) << "No track collection " << key << " found" << endmsg;
775  }
776  }
777  else {
779  if ( chainName.find("L2_")!=std::string::npos ) {
780  if ( this->template selectTracks<TrigInDetTrackCollection>( m_selectorTest, c, truthMap, key, key_index ) );
781  else if ( this->template selectTracks<Rec::TrackParticleContainer>( m_selectorTest, c, key ) );
782  else if ( this->template selectTracks<TrackCollection>( m_selectorTest, c, key ) );
783 # ifdef XAODTRACKING_TRACKPARTICLE_H
784  else if ( this->template selectTracks<xAOD::TrackParticleContainer>( m_selectorTest, c, key ) ) testbeamspot = this->template getBeamspot<xAOD::TrackParticleContainer>( c, key );
785 # endif
786  else m_provider->msg(MSG::WARNING) << "No track collection " << key << " found" << endmsg;
787  }
788  }
789 
790 
791  const std::vector<TIDA::Track*>& testtracks = m_selectorTest->tracks();
792 
793  m_provider->msg(MSG::VERBOSE) << "test tracks.size() " << testtracks.size() << endmsg;
794  // std::cout << "test tracks.size() " << testtracks.size() << std::endl;
795 
796  // std::cout << "\ttest tracks.size() " << testtracks.size() << std::endl;
797 
798  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
799  m_provider->msg(MSG::VERBOSE) << "test tracks.size() " << testtracks.size() << endmsg;
800  for ( int ii=testtracks.size() ; ii-- ; ) {
801  m_provider->msg(MSG::VERBOSE) << " test track " << ii << " " << *testtracks[ii] << endmsg;
802  //test_tracks.push_back(testtracks.at(ii));
803  }
804  }
805 
806  chain.addRoi( *roiInfo );
807 
808  chain.back().addTracks(testtracks);
809 
810  delete roiInfo;
811 
813 
815 
816  // std::cout << "vertex " << vtx_name << "\tchain " << chainName << "\tconfig " << chainConfig << std::endl;
817 
818  if ( vtx_name!="" ) {
819 
820  m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer for chain " << chainConfig << " with key " << vtx_name << endmsg;
821 
822  std::vector< Trig::Feature<xAOD::VertexContainer> > xaodtrigvertices = c->get<xAOD::VertexContainer>(vtx_name);
823 
824  if ( xaodtrigvertices.empty() ) {
825  if ( m_provider->msg().level() <= MSG::DEBUG ) {
826  m_provider->msg(MSG::WARNING) << "\tNo xAOD::VertexContainer for chain " << chainConfig << " for key " << vtx_name << endmsg;
827  }
828  }
829  else {
830 
831  m_provider->msg(MSG::VERBOSE) << "\txAOD::VertexContainer found with size " << xaodtrigvertices.size() << "\t" << vtx_name << endmsg;
832 
833  for ( unsigned iv=0 ; iv<xaodtrigvertices.size() ; iv++ ) {
834 
835  const xAOD::VertexContainer* vert = xaodtrigvertices[iv].cptr();
836 
837  m_provider->msg(MSG::VERBOSE) << "\t" << iv << " xAOD VxContainer for " << chainConfig << " " << vert << " key " << vtx_name << endmsg;
838 
840 
841  for ( ; vtxitr != vert->end(); ++vtxitr) {
844  // if ( ( (*vtxitr)->nTrackParticles()>0 && (*vtxitr)->vertexType()!=0 ) || vtx_name=="EFHistoPrmVtx" ) {
845  if ( (*vtxitr)->vertexType()!=0 || vtx_name=="EFHistoPrmVtx" ) {
846  chain.back().addVertex( TIDA::Vertex( (*vtxitr)->x(),
847  (*vtxitr)->y(),
848  (*vtxitr)->z(),
850  (*vtxitr)->covariancePosition()(Trk::x,Trk::x),
851  (*vtxitr)->covariancePosition()(Trk::y,Trk::y),
852  (*vtxitr)->covariancePosition()(Trk::z,Trk::z),
853  (*vtxitr)->nTrackParticles(),
855  (*vtxitr)->chiSquared(),
856  (*vtxitr)->numberDoF() ) );
857 
858  }
859  }
860  }
861 
862  }
863 
864  }
865 
866  }
867 
868  }
869 
870 
871  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
872  m_provider->msg(MSG::VERBOSE) << "event: " << *m_event << endmsg;
873  }
874 
876 
877  for ( unsigned iroi=0 ; iroi<chain.size() ; iroi++ ) {
878 
879  m_selectorRef->clear();
880 
881  if ( this->filterOnRoi() ) {
882  filterRef.setRoi( &chain.rois().at(iroi).roi() );
883  filterRef.containtracks( m_containTracks );
884  }
885  else filterRef.setRoi( 0 );
886 
887  test_tracks.clear();
888 
889 
903 
904  if ( m_provider->msg().level() <= MSG::VERBOSE )
905  m_provider->msg(MSG::VERBOSE) << "MC Truth flag " << m_mcTruth << endmsg;
906 
907  bool foundTruth = false;
908 
909  if ( !m_doOffline && m_mcTruth ) {
910 
911  if ( this->filterOnRoi() ) filter_truth.setRoi( &chain.rois().at(iroi).roi() );
912  else filter_truth.setRoi( 0 ); // don't filter on RoI unless needed
913 
914  selectorTruth.clear();
915 
916  if ( m_provider->msg().level() <= MSG::VERBOSE )
917  m_provider->msg(MSG::VERBOSE) << "getting Truth" << endmsg;
918 
919  if ( m_provider->evtStore()->template contains<TruthParticleContainer>("INav4MomTruthEvent") ) {
920  //ESD
921  this->template selectTracks<TruthParticleContainer>( &selectorTruth, "INav4MomTruthEvent" );
922  foundTruth = true;
923  }
924  else if ( m_provider->evtStore()->template contains<TruthParticleContainer>("SpclMC") ) {
926  this->template selectTracks<TruthParticleContainer>( &selectorTruth, "SpclMC");
927  foundTruth = true;
928  }
929  else if ( m_provider->evtStore()->template contains<TruthParticleContainer>("") ) {
931  this->template selectTracks<TruthParticleContainer>( &selectorTruth, "");
932  foundTruth = true;
933  }
934  else
935  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
936  m_provider->msg(MSG::VERBOSE) << "Truth not found - none whatsoever!" << endmsg;
937  }
938  }
939 
940 
941  if ( !m_doOffline && m_mcTruth && !foundTruth ) {
942 
943  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
944  m_provider->msg(MSG::VERBOSE) << "getting Truth" << endmsg;
945  }
946 
948 
949  const DataHandle<McEventCollection> mcevent;
950 
952 
953  std::string keys[4] = { "GEN_AOD", "TruthEvent", "", "G4Truth" };
954 
955  std::string key = "";
956 
957  bool foundcollection = false;
958 
959  for ( int ik=0 ; ik<4 ; ik++ ) {
960 
961  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
962  m_provider->msg(MSG::VERBOSE) << "Try McEventCollection: " << keys[ik] << endmsg;
963  }
964 
965  if ( !m_provider->evtStore()->template contains<McEventCollection>(keys[ik]) ) {
966  if( m_provider->msg().level() <= MSG::VERBOSE )
967  m_provider->msg(MSG::VERBOSE) << "No McEventCollection: " << keys[ik] << endmsg;
968  continue;
969  }
970 
971  if ( m_provider->msg().level() <= MSG::VERBOSE )
972  m_provider->msg(MSG::VERBOSE) << "evtStore()->retrieve( mcevent, " << keys[ik] << " )" << endmsg;
973 
974  if ( this->template retrieve( mcevent, keys[ik] ).isFailure() ) {
975  if ( m_provider->msg().level() <= MSG::VERBOSE )
976  m_provider->msg(MSG::VERBOSE) << "Failed to get McEventCollection: " << keys[ik] << endmsg;
977  }
978  else {
980  key = keys[ik];
981  if(m_provider->msg().level() <= MSG::VERBOSE)
982  m_provider->msg(MSG::VERBOSE) << "Found McEventCollection: " << key << endmsg;
983  foundcollection = true;
984  break;
985  }
986  }
987 
989  if ( !foundcollection ) {
990  if(m_provider->msg().level() <= MSG::VERBOSE)
991  m_provider->msg(MSG::WARNING) << "No MC Truth Collections of any sort, whatsoever!!!" << endmsg;
992 
993  // m_tree->Fill();
994  // return StatusCode::FAILURE;
995 
996  return;
997  }
998 
999  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
1000  m_provider->msg(MSG::VERBOSE) << "Found McEventCollection: " << key << "\tNevents " << mcevent->size() << endmsg;
1001  }
1002 
1003  McEventCollection::const_iterator evitr = mcevent->begin();
1004  McEventCollection::const_iterator evend = mcevent->end();
1005 
1006  unsigned ie = 0;
1007  unsigned ip = 0;
1008 
1009  unsigned ie_ip = 0;
1010 
1011  while ( evitr!=evend ) {
1012 
1013  int _ip = 0;
1014 
1015  int pid = HepMC::signal_process_id((*evitr));
1016 
1017  //The logic should be clarified here
1018  if ( pid!=0 ) {
1019 
1020  for (auto pitr: *(*evitr)) {
1021 
1022  selectorTruth.selectTrack( pitr );
1023 
1024  ++_ip;
1025 
1026  }
1027 
1028  }
1029  ++ie;
1030  ++evitr;
1031 
1032  if ( _ip>0 ) {
1034  // m_provider->msg(MSG::VERBOSE) << "Found " << ie << "\tpid " << pid << "\t with " << ip << " TruthParticles (GenParticles)" << endmsg;
1035  ++ie_ip;
1036  ip += _ip;
1037  }
1038  }
1039 
1040  if(m_provider->msg().level() <= MSG::VERBOSE){
1041  m_provider->msg(MSG::VERBOSE) << "Found " << ip << " TruthParticles (GenParticles) in " << ie_ip << " GenEvents out of " << ie << endmsg;
1042  m_provider->msg(MSG::VERBOSE) << "selected " << selectorTruth.size() << " TruthParticles (GenParticles)" << endmsg;
1043  }
1044 
1045  if(selectorTruth.size() > 0) foundTruth = true;
1046 
1047  if ( !(ip>0) ) {
1048  if (m_provider->msg().level() <= MSG::VERBOSE) m_provider->msg(MSG::WARNING) << "NO TRUTH PARTICLES - returning" << endmsg;
1049  return;
1050  }
1051 
1052  }
1053 
1055 
1056  // m_provider->msg(MSG::VERBOSE) << " Offline tracks " << endmsg;
1057 
1058  if ( m_doOffline ) {
1059 
1060 # ifdef XAODTRACKING_TRACKPARTICLE_H
1061  if ( m_provider->evtStore()->template contains<xAOD::TrackParticleContainer>("InDetTrackParticles") ) {
1062  this->template selectTracks<xAOD::TrackParticleContainer>( m_selectorRef, "InDetTrackParticles" );
1063  refbeamspot = this->template getBeamspot<xAOD::TrackParticleContainer>( "InDetTrackParticles" );
1064  }
1065  else if (m_provider->evtStore()->template contains<Rec::TrackParticleContainer>("TrackParticleCandidate") ) {
1066  this->template selectTracks<Rec::TrackParticleContainer>( m_selectorRef, "TrackParticleCandidate" );
1067  }
1068 # else
1069  if (m_provider->evtStore()->template contains<Rec::TrackParticleContainer>("TrackParticleCandidate") ) {
1070  this->template selectTracks<Rec::TrackParticleContainer>( m_selectorRef, "TrackParticleCandidate" );
1071  }
1072 # endif
1073  else if ( m_provider->msg().level() <= MSG::WARNING ) {
1074  m_provider->msg(MSG::WARNING) << " Offline tracks not found " << endmsg;
1075  }
1076 
1077  ref_tracks = m_selectorRef->tracks();
1078 
1079  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
1080  m_provider->msg(MSG::VERBOSE) << "ref tracks.size() " << m_selectorRef->tracks().size() << endmsg;
1081  for ( int ii=m_selectorRef->tracks().size() ; ii-- ; ) {
1082  m_provider->msg(MSG::VERBOSE) << " ref track " << ii << " " << *m_selectorRef->tracks()[ii] << endmsg;
1083  }
1084  }
1085 
1086  }
1087  else {
1089  if ( m_mcTruth && foundTruth ){
1090  ref_tracks=selectorTruth.tracks();
1091  }
1092  }
1093 
1094 
1095 
1096  test_tracks.clear();
1097 
1098  for ( unsigned itrk=0 ; itrk<chain.rois().at(iroi).tracks().size() ; itrk++ ) {
1099  test_tracks.push_back(&(chain.rois().at(iroi).tracks().at(itrk)));
1100  }
1101 
1102 
1103  // std::cout << "sutt track multiplicities: offline " << offline_tracks.size() << "\ttest " << test_tracks.size() << std::endl;
1104 
1105  _analysis->setvertices( vertices.size() );
1106 
1107  if ( refbeamspot.size()>0 ) _analysis->setBeamRef( refbeamspot );
1108  if ( testbeamspot.size()>0 ) _analysis->setBeamTest( testbeamspot );
1109 
1112 
1113  if ( m_runPurity ) {
1114 
1115  if ( this->getUseHighestPT() ) HighestPTOnly( test_tracks );
1116 
1117  if ( m_pTthreshold>0 ) FilterPT( test_tracks, m_pTthreshold );
1118 
1120  m_NRois++;
1121  m_NRefTracks += test_tracks.size();
1122  m_NTestTracks += ref_tracks.size();
1123 
1125  m_associator->match( test_tracks, ref_tracks );
1126 
1127  _analysis->execute( test_tracks, ref_tracks, m_associator );
1128 
1129  }
1130  else {
1131 
1133 
1134  if ( this->getUseHighestPT() ) HighestPTOnly( ref_tracks );
1135 
1137 
1138  if ( m_pTthreshold>0 ) FilterPT( ref_tracks, m_pTthreshold );
1139 
1141  m_NRois++;
1142  m_NRefTracks += ref_tracks.size();
1143  m_NTestTracks += test_tracks.size();
1144 
1146  m_associator->match( ref_tracks, test_tracks );
1147 
1148  // std::cout << "SUTT: execute : N tracks " << ref_tracks.size() << " " << test_tracks.size() << std::endl;
1149 
1150  _analysis->setroi( &chain.rois().at(iroi).roi() );
1151  _analysis->execute( ref_tracks, test_tracks, m_associator );
1152 
1153  // std::cout << "chain " << m_chainNames[ichain] << " " << "\tvtx name " << vtx_name << std::endl;
1154 
1155  if ( vtx_name!="" ) {
1157  std::vector<TIDA::Vertex> vr = chain.rois().at(iroi).vertices();
1158  std::vector<TIDA::Vertex*> vtx_rec;
1159  for ( unsigned iv=0 ; iv<vr.size() ; iv++ ) vtx_rec.push_back( &vr[iv] );
1160 
1161  std::vector<TIDA::Vertex*> vtx;
1162  if ( this->getVtxIndex()<0 ) {
1163  for ( unsigned iv=0 ; iv<vertices.size() ; iv++ ) vtx.push_back( &vertices[iv] );
1164  }
1165  else {
1166  if ( vertices.size()>unsigned(this->getVtxIndex()) ) vtx.push_back( &vertices[this->getVtxIndex()] );
1167  }
1168 
1169  _analysis->execute_vtx( vtx, vtx_rec, m_event );
1170  }
1171 
1172  }
1173 
1174  if ( _analysis->debug() ) {
1175  m_provider->msg(MSG::INFO) << "Missing track for " << m_chainNames[ichain]
1176  << "\trun " << run_number
1177  << "\tevent " << event_number
1178  << "\tlb " << lumi_block << endmsg;
1179  }
1180 
1181  }
1182 
1183  }
1184 
1185  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
1186  m_provider->msg(MSG::VERBOSE) << "\n\nEvent " << *m_event << endmsg;
1187  }
1188  }
1189 
1190 
1191 
1192  virtual void book() {
1193 
1194  if(m_provider->msg().level() <= MSG::VERBOSE)
1195  m_provider->msg(MSG::VERBOSE) << "AnalysisConfig_Tier0::book() " << name() << endmsg;
1196 
1197  m_provider->msg(MSG::ERROR) << "AnalysisConfig_Tier0::book() should no longer ever be called: " << name() << endmsg;
1198 
1199  }
1200 
1201 
1202 
1203  virtual void finalize() {
1204 
1205  if(m_provider->msg().level() <= MSG::VERBOSE)
1206  m_provider->msg(MSG::VERBOSE) << "AnalysisConfig_Tier0::finalise() " << m_provider->name() << endmsg;
1207 
1208  m_analysis->finalise();
1209 
1210  m_provider->msg(MSG::INFO) << m_provider->name() << " " << m_chainNames[0] << " \tNRois processed: " << m_NRois << "\tRef tracks: " << m_NRefTracks << "\tTestTracks: " << m_NTestTracks << endmsg;
1211 
1212  if(m_provider->msg().level() <= MSG::VERBOSE)
1213  m_provider->msg(MSG::VERBOSE) << m_provider->name() << " finalised" << endmsg;
1214 
1215  }
1216 
1217 
1218 protected:
1219 
1221 
1223 
1224  std::vector<ChainString> m_chainNames;
1225  std::vector<Analysis_Tier0*> m_analyses;
1226  std::string m_testType;
1227 
1231  bool m_doTaus;
1236 
1237  std::string m_outputFileName;
1238 
1240  int m_NRois;
1243 
1245 
1247 
1249 
1250  bool m_first;
1251 
1253 
1254 };
1255 
1256 
1257 
1258 #endif // TrigInDetAnalysisExample_T_AnalysisConfig_Tier0_H
1259 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
T_AnalysisConfig< T >::m_selectorRef
TrigTrackSelector * m_selectorRef
Definition: T_AnalysisConfig.h:981
Trig::FeatureContainer::combination_const_iterator
std::vector< Combination >::const_iterator combination_const_iterator
Definition: FeatureContainer.h:69
TrackAnalysis::setBeamTest
void setBeamTest(double x, double y, double z=0)
Definition: TrackAnalysis.h:110
Trk::y
@ y
Definition: ParamDefs.h:56
TIDA::Associator
Definition: TIDAAssociator.h:24
TIDARoiDescriptorBuilder.h
T_AnalysisConfig< T >::m_mcTruth
bool m_mcTruth
Definition: T_AnalysisConfig.h:988
Analysis_Tier0::setvertices
void setvertices(int numvtx)
Definition: Analysis_Tier0.h:52
Filter_RoiSelector.h
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
GenEvent.h
plotting.plot_kinematics.run_number
run_number
Definition: plot_kinematics.py:29
ElectronContainer.h
T_AnalysisConfig_Tier0::m_containTracks
bool m_containTracks
Definition: T_AnalysisConfig_Tier0.h:1252
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
Trk::z
@ z
global position (cartesian)
Definition: ParamDefs.h:57
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
T_AnalysisConfig< T >::m_provider
T * m_provider
Definition: T_AnalysisConfig.h:957
TrigTrackSelector::clear
virtual void clear() override
Definition: TrigTrackSelector.h:102
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
TrackAnalysis::finalise
virtual void finalise()=0
T_AnalysisConfig_Tier0::setShifter
void setShifter(bool b)
Definition: T_AnalysisConfig_Tier0.h:155
TIDA::Roi::addTracks
void addTracks(const std::vector< TIDA::Track > &tracks)
accessors for the track vector
Definition: TIDARoi.h:46
T_AnalysisConfig< T >::m_tdt
ToolHandle< Trig::TrigDecisionTool > * m_tdt
Definition: T_AnalysisConfig.h:959
TIDAEvent.h
Basic event class to contain a vector of chains for trigger analysis
T_AnalysisConfig_Tier0::finalize
virtual void finalize()
Definition: T_AnalysisConfig_Tier0.h:1203
TruthParticleContainer.h
TrackFilter
Definition: TrackFilter.h:26
HepMC::signal_process_id
int signal_process_id(const GenEvent &e)
Definition: GenEvent.h:635
TrackSelector::size
unsigned size() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:63
Filter_etaPT
Definition: Filter_etaPT.h:27
Analysis_Tier0.h
T_AnalysisConfig_Tier0::setRunPurity
void setRunPurity(bool b)
Definition: T_AnalysisConfig_Tier0.h:153
GenVertex.h
T_AnalysisConfig_Tier0::m_chainNames
std::vector< ChainString > m_chainNames
Definition: T_AnalysisConfig_Tier0.h:1224
TIDAVertex.h
JiveXML::Event
struct Event_t Event
Definition: ONCRPCServer.h:65
MuonContainer.h
Filters.h
T_AnalysisConfig< T >::analysis
const TrackAnalysis * analysis() const
Definition: T_AnalysisConfig.h:258
Analysis_Tier0
Definition: Analysis_Tier0.h:30
Analysis_Tier0::execute_vtx
virtual void execute_vtx(const std::vector< TIDA::Vertex * > &vtx0, const std::vector< TIDA::Vertex * > &vtx1, const TIDA::Event *tevt=0)
Definition: Analysis_Tier0.cxx:755
Analysis_Tier0::debug
bool debug() const
Definition: Analysis_Tier0.h:66
TIDARoiDescriptor
Describes the Region of Ineterest geometry It has basically 8 parameters.
Definition: TIDARoiDescriptor.h:42
T_AnalysisConfig_Tier0::m_doTaus
bool m_doTaus
Definition: T_AnalysisConfig_Tier0.h:1231
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
ChainString
Definition: ChainString.h:23
TIDATools.h
useful tool for the TrigInDetAnalysis class code
TrigTrackSelector
L2 tracks.
Definition: TrigTrackSelector.h:58
T_AnalysisConfig_Tier0::m_runPurity
bool m_runPurity
Definition: T_AnalysisConfig_Tier0.h:1244
ExpertMethods.h
T_AnalysisConfig< T >::getUseHighestPT
bool getUseHighestPT() const
Definition: T_AnalysisConfig.h:279
Filter_AcceptAll.h
T_AnalysisConfig.h
HLTResult.h
Associator_BestMatch.h
TIDA::Event
Definition: TIDAEvent.h:33
T_AnalysisConfig_Tier0::m_outputFileName
std::string m_outputFileName
Definition: T_AnalysisConfig_Tier0.h:1237
TIDA::Event::lumi_block
void lumi_block(unsigned lb)
Definition: TIDAEvent.h:44
GenParticle.h
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
T_AnalysisConfig_Tier0::m_doBjets
bool m_doBjets
Definition: T_AnalysisConfig_Tier0.h:1232
TIDA::Chain::addRoi
void addRoi(TIDA::Roi &roi)
add and roi by root dictionary class
Definition: TIDAChain.h:44
T_AnalysisConfig_Tier0::m_doTauThreeProng
bool m_doTauThreeProng
Definition: T_AnalysisConfig_Tier0.h:1234
PlotCalibFromCool.ie
ie
Definition: PlotCalibFromCool.py:420
covarianceTool.filter
filter
Definition: covarianceTool.py:514
Trig::FeatureContainer
Definition: FeatureContainer.h:54
Analysis_Tier0::execute
virtual void execute(const std::vector< TIDA::Track * > &referenceTracks, const std::vector< TIDA::Track * > &testTracks, TrackAssociator *associator)
Definition: Analysis_Tier0.cxx:553
TIDA::Chain::back
TIDA::Roi & back()
Definition: TIDAChain.h:60
T_AnalysisConfig_Tier0::T_AnalysisConfig_Tier0
T_AnalysisConfig_Tier0(const std::string &analysisInstanceName, const std::string &testChainName, const std::string &testType, const std::string &testKey, const std::string &referenceChainName, const std::string &referenceType, const std::string &referenceKey, TrackFilter *testFilter, TrackFilter *referenceFilter, TrackAssociator *associator, TrackAnalysis *analysis)
Definition: T_AnalysisConfig_Tier0.h:97
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
FilterPT
void FilterPT(std::vector< T * > &tracks, double pt)
Definition: TIDATools.h:41
TIDDirectory.h
class to keep a directory for each object in a root sort of way, but needed to keep the root objects ...
T_AnalysisConfig_Tier0::m_NRois
int m_NRois
output stats
Definition: T_AnalysisConfig_Tier0.h:1240
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
T_AnalysisConfig_Tier0::~T_AnalysisConfig_Tier0
virtual ~T_AnalysisConfig_Tier0()
Definition: T_AnalysisConfig_Tier0.h:151
T_AnalysisConfig_Tier0::loop
virtual void loop()
Definition: T_AnalysisConfig_Tier0.h:188
TIDA::Event::addChain
void addChain(const std::string &chainname)
methods to add and access chains
Definition: TIDAEvent.h:67
TIDA::Event::time_stamp
void time_stamp(unsigned t)
Definition: TIDAEvent.h:45
T_AnalysisConfig_Tier0::m_pTthreshold
double m_pTthreshold
Definition: T_AnalysisConfig_Tier0.h:1248
McEventCollection.h
TIDA::Event::back
TIDA::Chain & back()
get the last chain from the vector
Definition: TIDAEvent.h:89
lumiFormat.i
int i
Definition: lumiFormat.py:85
TIDA::Event::event_number
void event_number(unsigned long long e)
Definition: TIDAEvent.h:43
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
T_AnalysisConfig< T >::m_analysis
TrackAnalysis * m_analysis
Definition: T_AnalysisConfig.h:986
T_AnalysisConfig< T >::getVtxIndex
int getVtxIndex() const
Definition: T_AnalysisConfig.h:282
TrigInDetTrackTruthMap
Definition: TrigInDetTrackTruthMap.h:38
TrackAnalysis
Definition: TrackAnalysis.h:32
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
Filter_etaPT.h
HighestPTOnly
void HighestPTOnly(std::vector< T * > &tracks)
Definition: TIDATools.h:20
hist_file_dump.f
f
Definition: hist_file_dump.py:135
TauJetContainer.h
T_AnalysisConfig< T >::m_keepAllEvents
bool m_keepAllEvents
Definition: T_AnalysisConfig.h:995
VxContainer.h
T_AnalysisConfig_Tier0::m_doElectrons
bool m_doElectrons
Definition: T_AnalysisConfig_Tier0.h:1230
VxContainer
Definition: VxContainer.h:28
TrackAnalysis::setBeamRef
void setBeamRef(double x, double y, double z=0)
set the beamline positions
Definition: TrackAnalysis.h:109
Filter_True
default simple filter which accepts all tracks
Definition: Filters.h:26
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
T_AnalysisConfig_Tier0::m_event
TIDA::Event * m_event
Definition: T_AnalysisConfig_Tier0.h:1222
T_AnalysisConfig_Tier0::m_doOffline
bool m_doOffline
Definition: T_AnalysisConfig_Tier0.h:1228
VtxAnalysis.h
T_AnalysisConfig_Tier0::m_testType
std::string m_testType
Definition: T_AnalysisConfig_Tier0.h:1226
TIDA::Vertex
Definition: TIDAVertex.h:23
TrigTrackSelector::selectTrack
bool selectTrack(const TrigInDetTrack *track, const TrigInDetTrackTruthMap *truthMap=0)
neater code to make use of vector function also for a single ancestor pdgid, instead of the full code...
Definition: TrigTrackSelector.cxx:116
grepfile.ic
int ic
Definition: grepfile.py:33
xAOD::EventInfo_v1::averageInteractionsPerCrossing
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
Definition: EventInfo_v1.cxx:397
T_AnalysisConfig< T >::retrieve
StatusCode retrieve(Collection const *&collection, const std::string &key="")
Definition: T_AnalysisConfig.h:573
T_AnalysisConfig< T >::m_associator
TrackAssociator * m_associator
Definition: T_AnalysisConfig.h:985
TrackSelector::tracks
const std::vector< TIDA::Track * > & tracks() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:53
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
T_AnalysisConfig_Tier0::m_shifter
bool m_shifter
Definition: T_AnalysisConfig_Tier0.h:1246
T_AnalysisConfig_Tier0::book
virtual void book()
Definition: T_AnalysisConfig_Tier0.h:1192
ChainString.h
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:43
Filter_Combined
Definition: Filters.h:225
TIDA::Chain
Definition: TIDAChain.h:28
T_AnalysisConfig_Tier0::m_analyses
std::vector< Analysis_Tier0 * > m_analyses
Definition: T_AnalysisConfig_Tier0.h:1225
DataHandle
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
Definition: DataHandle.h:42
TIDARoiDescriptorBuilder
Definition: TIDARoiDescriptorBuilder.h:21
TIDA::Event::addVertex
void addVertex(const TIDA::Vertex &v)
Definition: TIDAEvent.h:71
EventInfo.h
TIDA::Event::clear
void clear()
clear the event
Definition: TIDAEvent.h:86
T_AnalysisConfig_Tier0::m_first
bool m_first
Definition: T_AnalysisConfig_Tier0.h:1250
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
Filter_Combined::containtracks
void containtracks(bool b=true)
set / unset the flag to determine whether tracks should be fully contained in the RoI or not
Definition: Filters.h:242
TrackAnalysis::setroi
void setroi(TIDARoiDescriptor *r)
Definition: TrackAnalysis.h:139
TIDA::Event::mu
void mu(double m)
Definition: TIDAEvent.h:47
python.copyTCTOutput.chains
chains
Definition: copyTCTOutput.py:81
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
T_AnalysisConfig_Tier0::useBeamCondSvc
void useBeamCondSvc(bool b)
Definition: T_AnalysisConfig_Tier0.h:157
TrackParticle.h
Filter_Combined::setRoi
void setRoi(TIDARoiDescriptor *r)
Definition: Filters.h:236
ChainString::head
const std::string & head() const
Definition: ChainString.h:33
T_AnalysisConfig_Tier0::m_NTestTracks
int m_NTestTracks
Definition: T_AnalysisConfig_Tier0.h:1242
T_AnalysisConfig_Tier0::m_tauEtCutOffline
bool m_tauEtCutOffline
Definition: T_AnalysisConfig_Tier0.h:1235
T_AnalysisConfig_Tier0::m_NRefTracks
int m_NRefTracks
Definition: T_AnalysisConfig_Tier0.h:1241
T_AnalysisConfig_Tier0::m_hasTruthMap
bool m_hasTruthMap
Definition: T_AnalysisConfig_Tier0.h:1233
DEBUG
#define DEBUG
Definition: page_access.h:11
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
TrigTrackSelector::setBeamline
void setBeamline(double x, double y, double z=0)
Definition: TrigTrackSelector.h:94
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
T_AnalysisConfig_Tier0::m_useBeamCondSvc
bool m_useBeamCondSvc
Definition: T_AnalysisConfig_Tier0.h:1220
T_AnalysisConfig_Tier0
Definition: T_AnalysisConfig_Tier0.h:87
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
T_AnalysisConfig< T >::filterOnRoi
bool filterOnRoi() const
Definition: T_AnalysisConfig.h:284
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TIDA::Associator::match
virtual void match(const std::vector< T * > &s1, const std::vector< S * > &s2)=0
python.StandardJetMods.vr
vr
Definition: StandardJetMods.py:305
TIDA::Event::bunch_crossing_id
void bunch_crossing_id(unsigned b)
Definition: TIDAEvent.h:46
Trk::x
@ x
Definition: ParamDefs.h:55
T_AnalysisConfig< T >::m_filters
std::vector< std::vector< TrackFilter * > > m_filters
Definition: T_AnalysisConfig.h:979
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
TIDA::Event::run_number
void run_number(unsigned r)
accessors
Definition: TIDAEvent.h:42
T_AnalysisConfig< T >::m_selectorTest
TrigTrackSelector * m_selectorTest
Definition: T_AnalysisConfig.h:982
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
T_AnalysisConfig_Tier0::containTracks
void containTracks(bool b)
Definition: T_AnalysisConfig_Tier0.h:159
T_AnalysisConfig< T >::name
const std::string & name() const
Definition: T_AnalysisConfig.h:235
T_AnalysisConfig_Tier0::m_doMuons
bool m_doMuons
Definition: T_AnalysisConfig_Tier0.h:1229
TrigRoiDescriptorCollection.h
T_AnalysisConfig_Tier0::_analysis
Analysis_Tier0 * _analysis
Definition: T_AnalysisConfig_Tier0.h:163
TrackParticleContainer.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
T_AnalysisConfig< T >::requireDecision
bool requireDecision() const
Definition: T_AnalysisConfig.h:288
T_AnalysisConfig
Definition: T_AnalysisConfig.h:59
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37