ATLAS Offline Software
T_AnalysisConfigR3_Tier0.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
23 #ifndef TrigInDetAnalysisExample_T_AnalysisConfigR3_Tier0_H
24 #define TrigInDetAnalysisExample_T_AnalysisConfigR3_Tier0_H
25 
31 
36 
37 #include "TTree.h"
38 #include "TFile.h"
39 
40 #include "GaudiKernel/ToolHandle.h"
42 
43 
44 // McParticleEvent includes
46 
48 #include "AtlasHepMC/GenEvent.h"
49 #include "AtlasHepMC/GenVertex.h"
50 #include "AtlasHepMC/GenParticle.h"
51 
53 
54 
55 
57 
59 
65 
66 
67 
68 #include "VxVertex/VxContainer.h"
69 
71 
73 
75 
76 
79 
80 // #include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
81 
84 
86 
87 
88 template<typename T>
89 std::ostream& operator<<( std::ostream& s, const std::vector<T>& v) {
90  for ( size_t i=0 ; i<v.size() ; i++ ) s << " " << v[i];
91  return s;
92 }
93 
94 
95 template<typename T, typename A=AnalysisR3_Tier0>
97 
98 public:
99 
100  // Full constructor: test/reference/selection
101  // - analysisInstanceName: the name of the analysis chain being created
102  // - xxxChainName: the name of the chain to be used as test/reference/selection; must be "StoreGate" in case of direct access to SG containers
103  // - xxxType: the type of tracks to be retrieved from the test/reference/selection chain or container
104  // - xxxKey: the key for tracks to be retrieved from the test/reference/selection chain or container
105  // - roiInfo: in case the test chain is a real chain, this is used to specify RoI widths; in case the test chain is a fake chain, this is used for RoI position too
106  // - all standard operations are performed in loops over 0=test 1=reference 2=selection
107  T_AnalysisConfigR3_Tier0(const std::string& analysisInstanceName,
108  const std::string& testChainName, const std::string& testType, const std::string& testKey,
109  const std::string& referenceChainName, const std::string& referenceType, const std::string& referenceKey,
110  TrackFilter* testFilter, TrackFilter* referenceFilter,
111  TrackAssociator* associator,
113  TagNProbe* TnP_tool = 0) :
114  T_AnalysisConfig<T>( analysisInstanceName,
115  testChainName, testType, testKey,
116  referenceChainName, referenceType, referenceKey,
117  testFilter, referenceFilter,
118  associator,
119  analysis),
120  m_useBeamCondSvc(false),
121  m_doOffline(true),
122  m_doMuons(false),
123  m_doElectrons(false),
124  m_doTaus(false),
125  m_doBjets(false),
126  m_pdgID(0),
127  m_parent_pdgID(0),
128  m_NRois(0),
129  m_NRefTracks(0),
130  m_NTestTracks(0),
131  m_runPurity(false),
132  m_shifter(false),
133  m_pTthreshold(0),
134  m_first(true),
135  m_containTracks(false),
136  m_tnp_flag(false),
137  m_invmass(0),
138  m_invmass_obj(0)
139  {
140 
143 
144  m_chainNames.push_back(testChainName);
145 
147 
148  m_TnP_tool = TnP_tool;
149 
150 #if 0
151  ChainString& chain = m_chainNames.back();
153 
154  std::cout << "\nT_AnalysisConfigR3_Tier0::name: " << name() << "\t" << this << std::endl;
155  std::cout << "T_AnalysisConfigR3_Tier0::chain specification: " << testChainName << " -> " << chain << "\t" << chain.raw() << std::endl;
156  std::cout << "\tchain: " << chain.head() << std::endl;
157  std::cout << "\tkey: " << chain.tail() << std::endl;
158  std::cout << "\troi: " << chain.roi() << std::endl;
159  std::cout << "\tvtx: " << chain.vtx() << std::endl;
160  std::cout << "\tte: " << chain.element() << std::endl;
161  std::cout << "\textra: " << chain.extra() << std::endl;
162 
163  std::cout << "\tpost: " << chain.post() << std::endl;
164  std::cout << "\tpt: " << chain.postvalue("pt") << std::endl;
165 
166  std::cout << "\tcontainTracks: " << m_containTracks << std::endl;
167 
168 #endif
169 
170  m_testType = testType;
171 
172  if ( m_TnP_tool ) m_tnp_flag = true;
173 
174  }
175 
176 
178  if ( m_TnP_tool ) delete m_TnP_tool;
179  if ( m_invmass ) delete m_invmass;
180  if ( m_invmass_obj ) delete m_invmass_obj;
181  }
182 
183 
184  void initialise() {
185 
186  if ( m_tnp_flag ) {
187  if ( m_invmass==0 ) m_invmass = new TIDA::Histogram<float>( monTool(), "invmass" );
188  if ( m_invmass_obj==0 ) m_invmass_obj = new TIDA::Histogram<float>( monTool(), "invmass_obj" );
189  }
190 
191  for ( size_t it=0 ; it<m_types.size() ; it++ ) {
192  if ( m_types[it]=="" ) m_offline_types.push_back( "InDetTrackParticles" );
193  else m_offline_types.push_back( m_types[it] );
194  }
195 
196  if ( m_offline_types.empty() ) m_offline_types.push_back( "InDetTrackParticles" );
197 
198  }
199 
200 
201  void setRunPurity( bool b ) { m_runPurity=b; }
202 
203  void setShifter( bool b ) { m_shifter=b; }
204 
205  void useBeamCondSvc( bool b ) { m_useBeamCondSvc = b; }
206 
207  void containTracks( bool b ) { m_containTracks = b; }
208 
209  void setPdgID( int i=0 ) { m_pdgID=i; }
210 
211  void setParentPdgID( int i=0 ) { m_parent_pdgID=i; }
212 
213  void setMCTruthRef( bool b ) { m_mcTruth=b; }
214 
215  void setOfflineRef( bool b ) { m_doOffline=b; }
216 
217  void setTypes( const std::vector<std::string>& t ) { m_types=t; }
218 
219  void set_monTool( ToolHandle<GenericMonitoringTool>* m ) { m_monTool=m; }
220 
221  ToolHandle<GenericMonitoringTool>* monTool() { return m_monTool; }
222 
223 public:
224 
226 
228 
229 protected:
230 
234 
236 
241 
242  virtual void loop() {
243 
244  const TagNProbe* pTnP_tool = m_TnP_tool;
245 
246  if( m_provider->msg().level() <= MSG::VERBOSE) {
247  m_provider->msg(MSG::VERBOSE) << "AnalysisConfigR3_Tier0::loop() for " << T_AnalysisConfig<T>::m_analysisInstanceName << endmsg;
248  }
249 
251  // get (offline) beam position
252  // double xbeam = 0;
253  // double ybeam = 0;
254 
255 #if 0
256 
257  if ( m_first ) {
258 
259  m_first = false;
260 
261  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
262  m_provider->msg(MSG::VERBOSE) << " using beam position\tx=" << xbeam << "\ty=" << ybeam << endmsg;
263 
264  std::vector<std::string> configuredChains = (*(m_tdt))->getListOfTriggers("L2_.*, EF_.*, HLT_.*");
265 
266  for ( unsigned i=0 ; i<configuredChains.size() ; i++ ) {
268  // std::cout << "Configured chain " << configuredChains[i] << std::endl;
269  m_provider->msg(MSG::VERBOSE) << "Chain " << configuredChains[i] << endmsg;
270  }
271  }
272 
273  // std::cout << "\tloop() analyse chains " << m_chainNames.size() << std::endl;
274 
275  }
276 
277 #endif
278 
280 
281  Filter_etaPT filter_etaPT( 5, 200 );
282  Filter_Combined filter_truth( &filter_etaPT, &filter_etaPT);
283 
285  // Filter_Combined filterRef (&filter_offline, &filter_vertex);
286 
287  int iRefFilter = 1;
288  int iTestFilter = 0;
289 
290  if ( m_runPurity ) {
291  iRefFilter = 0;
292  iTestFilter = 1;
293  }
294 
295 
296  TrackFilter* rfilter = m_filters[iRefFilter][0];
297  TrackFilter* tfilter = m_filters[iTestFilter][0];
298 
299  Filter_Combined filterRef( rfilter, &filter );
300  Filter_Combined filterTest( tfilter, &filter );
301 
302  TrigTrackSelector selectorTruth( &filter_truth, m_pdgID, m_parent_pdgID );
303 
304  TrigTrackSelector selectorRef( &filterRef );
305  TrigTrackSelector* pselectorRef = &selectorRef;
306 
307  TrigTrackSelector selectorTest( &filterTest );
308  TrigTrackSelector* pselectorTest = &selectorTest;
309 
311  if ( m_mcTruth ) pselectorRef = &selectorTruth;
312 
318 
320 
322  TIDA::Event* eventp = &event;
323 
324  double beamline[4] = { 0, 0, 0, 0 };
325 
326  // clear the ntuple TIDA::Event class
327  eventp->clear();
328 
330 
331  const xAOD::EventInfo* pEventInfo = 0;
332 
333  unsigned run_number = 0;
334  unsigned long long event_number = 0;
335  unsigned lumi_block = 0;
336  unsigned bunch_crossing_id = 0;
337  unsigned time_stamp = 0;
338  double mu_val = 0;
339 
341  // std::cout << "\tloop() get EventInfo" << std::endl;
342 
343  if ( this->template retrieve( pEventInfo, "EventInfo" ).isFailure() ) {
344  m_provider->msg(MSG::WARNING) << "Failed to get EventInfo " << endmsg;
345  } else {
346 
347  run_number = pEventInfo->runNumber();
348  event_number = pEventInfo->eventNumber();
349  lumi_block = pEventInfo->lumiBlock();
350  time_stamp = pEventInfo->timeStamp();
351  bunch_crossing_id = pEventInfo->bcid();
352  mu_val = pEventInfo->averageInteractionsPerCrossing();
353  }
354 
355  if(m_provider->msg().level() <= MSG::VERBOSE){
356  m_provider->msg(MSG::VERBOSE) << "run " << run_number
357  << "\tevent " << event_number
358  << "\tlb " << lumi_block << endmsg;
359  }
360 
361  // clear the ntuple TIDA::Event class
362  eventp->clear();
363 
364  eventp->run_number(run_number);
365  eventp->event_number(event_number);
366  eventp->lumi_block(lumi_block);
367  eventp->time_stamp(time_stamp);
368  eventp->bunch_crossing_id(bunch_crossing_id);
369  eventp->mu(mu_val);
370 
373 
374  bool analyse = false;
375 
376  // Check HLTResult
377 
378  for ( unsigned ichain=0 ; ichain<m_chainNames.size() ; ichain++ ) {
379 
380  const std::string& chainname = m_chainNames[ichain].head();
381 
382  if ( chainname == "" ) analyse = true;
383  else {
384 
385  //Only for trigger chains
386  if ( chainname.find("L2") == std::string::npos &&
387  chainname.find("EF") == std::string::npos &&
388  chainname.find("HLT") == std::string::npos ) continue;
389 
390  if ( m_provider->msg().level() <= MSG::DEBUG ) {
391  m_provider->msg(MSG::DEBUG) << "Chain " << chainname
392  << "\tpass " << (*m_tdt)->isPassed(chainname)
393  << "\tpres " << (*m_tdt)->getPrescale(chainname) << endmsg;
394  }
395 
397  // std::cout << "\tChain " << chainname << "\tpass " << (*m_tdt)->isPassed(chainname)
398  // << "\tpres " << (*m_tdt)->getPrescale(chainname) << std::endl;
399 
400  if ( (*(m_tdt))->isPassed(chainname) ) analyse = true;
401 
402  }
403 
404  }
405 
406 
407  if ( !this->m_keepAllEvents && !analyse ) {
408  if(m_provider->msg().level() <= MSG::VERBOSE) {
409  m_provider->msg(MSG::VERBOSE) << "No chains passed unprescaled - not processing this event" << endmsg;
410  }
411  return;
412  }
413 
414 
416 
417  selectorTruth.clear();
418 
419  if(m_provider->msg().level() <= MSG::VERBOSE)
420  m_provider->msg(MSG::VERBOSE) << "MC Truth flag " << m_mcTruth << endmsg;
421 
423 
424  std::vector<TIDA::Vertex> vertices;
425  std::vector<TIDA::Vertex> vertices_rec;
426 
427  std::vector<double> refbeamspot;
428  std::vector<double> testbeamspot;
429 
431 
432  m_provider->msg(MSG::VERBOSE) << "fetching AOD Primary vertex container" << endmsg;
433 
434  if ( !this->select( vertices, "PrimaryVertices" ) ) {
435  m_provider->msg(MSG::VERBOSE) << "could not retrieve the 'PrimaryVertices' vertex collection" << std::endl;
436  }
437 
439 
440  if ( m_mcTruth ) {
441  eventp->addChain( "Truth" );
442  eventp->back().addRoi(TIDARoiDescriptor());
443  eventp->back().back().addTracks(selectorTruth.tracks());
444  }
445 
447 
448  if ( m_doOffline ) {
449  for ( unsigned i=0 ; i<vertices.size() ; i++ ) {
450  if(m_provider->msg().level() <= MSG::VERBOSE)
451  m_provider->msg(MSG::VERBOSE) << "vertex " << i << " " << vertices[i] << endmsg;
452  eventp->addVertex(vertices[i]);
453  }
454  }
455 
456 
457 
459 
460  std::vector<TIDA::Track*> offline_tracks;
461  std::vector<TIDA::Track*> electron_tracks;
462  std::vector<TIDA::Track*> muon_tracks;
463 
464  std::vector<TIDA::Track*> ref_tracks;
465  std::vector<TIDA::Track*> test_tracks;
466 
467  offline_tracks.clear();
468  electron_tracks.clear();
469  muon_tracks.clear();
470 
471  ref_tracks.clear();
472  test_tracks.clear();
473 
474  // offline track retrieval now done once for each chain rather than each roi
475  if ( m_provider->msg().level() <= MSG::VERBOSE )
476  m_provider->msg(MSG::VERBOSE) << "MC Truth flag " << m_mcTruth << endmsg;
477 
478  bool foundTruth = false;
479 
481 
482  if ( m_mcTruth ) {
483 
484  filter_truth.setRoi( 0 ); // don't filter on RoI yet (or until needed)
485 
486  selectorTruth.clear();
487 
488  if ( m_provider->msg().level() <= MSG::VERBOSE )
489  m_provider->msg(MSG::VERBOSE) << "getting Truth" << endmsg;
490 
491  if ( m_provider->evtStore()->template contains<TruthParticleContainer>("INav4MomTruthEvent") ) {
492  //ESD
493  this->template selectTracks<TruthParticleContainer>( &selectorTruth, "INav4MomTruthEvent" );
494  foundTruth = true;
495  }
496  else if ( m_provider->evtStore()->template contains<TruthParticleContainer>("SpclMC") ) {
498  this->template selectTracks<TruthParticleContainer>( &selectorTruth, "SpclMC");
499  foundTruth = true;
500  }
501  else if ( m_provider->evtStore()->template contains<xAOD::TruthParticleContainer>("TruthParticles") ) {
503  this->template selectTracks<xAOD::TruthParticleContainer>( &selectorTruth, "TruthParticles");
504  foundTruth = true;
505  }
506  else if ( m_provider->evtStore()->template contains<TruthParticleContainer>("") ) {
508  this->template selectTracks<TruthParticleContainer>( &selectorTruth, "");
509  foundTruth = true;
510  }
511  else
512  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
513  m_provider->msg(MSG::VERBOSE) << "Truth not found - none whatsoever!" << endmsg;
514  }
515  }
516 
517  if ( m_mcTruth && !foundTruth ) {
518 
519  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
520  m_provider->msg(MSG::VERBOSE) << "getting Truth" << endmsg;
521  }
522 
524 
525  const McEventCollection* mcevent = nullptr;
526 
528 
529  std::string keys[4] = { "GEN_AOD", "TruthEvent", "", "G4Truth" };
530 
531  std::string key = "";
532 
533  bool foundcollection = false;
534 
535  for ( int ik=0 ; ik<4 ; ik++ ) {
536 
537  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
538  m_provider->msg(MSG::VERBOSE) << "Try McEventCollection: " << keys[ik] << endmsg;
539  }
540 
541  if ( !m_provider->evtStore()->template contains<McEventCollection>(keys[ik]) ) {
542  if( m_provider->msg().level() <= MSG::VERBOSE )
543  m_provider->msg(MSG::VERBOSE) << "No McEventCollection: " << keys[ik] << endmsg;
544  continue;
545  }
546 
547  if ( m_provider->msg().level() <= MSG::VERBOSE )
548  m_provider->msg(MSG::VERBOSE) << "evtStore()->retrieve( mcevent, " << keys[ik] << " )" << endmsg;
549 
550  if ( this->template retrieve( mcevent, keys[ik] ).isFailure() ) {
551  if ( m_provider->msg().level() <= MSG::VERBOSE )
552  m_provider->msg(MSG::VERBOSE) << "Failed to get McEventCollection: " << keys[ik] << endmsg;
553  }
554  else {
556  key = keys[ik];
557  if(m_provider->msg().level() <= MSG::VERBOSE)
558  m_provider->msg(MSG::VERBOSE) << "Found McEventCollection: " << key << endmsg;
559  foundcollection = true;
560  break;
561  }
562  }
563 
565  if ( !foundcollection ) {
566  if(m_provider->msg().level() <= MSG::VERBOSE)
567  m_provider->msg(MSG::WARNING) << "No MC Truth Collections of any sort, whatsoever!!!" << endmsg;
568 
569  // m_tree->Fill();
570  // return StatusCode::FAILURE;
571 
572  return;
573  }
574 
575  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
576  m_provider->msg(MSG::VERBOSE) << "Found McEventCollection: " << key << "\tNevents " << mcevent->size() << endmsg;
577  }
578 
579  McEventCollection::const_iterator evitr = mcevent->begin();
580  McEventCollection::const_iterator evend = mcevent->end();
581 
582  unsigned ie = 0;
583  unsigned ip = 0;
584 
585  unsigned ie_ip = 0;
586 
587  while ( evitr!=evend ) {
588 
589  int ipc = 0;
590 
591  int pid = HepMC::signal_process_id((*evitr));
592 
593  //The logic should be clarified here
594  if ( pid!=0 ) {
595 
596  // For HepMC2-based builds the following two functions return
597  // GenEvent::particle_const_iterator
598  // while for HepMC3-based builds they return
599  // std::vector<HepMC3::ConstGenParticlePtr>::const_iterator
600  // see AtlasHepMC/GenEvent.h for function definitions.
601  auto pitr(HepMC::begin(**evitr));
602  const auto pend(HepMC::end(**evitr));
603 
604  while ( pitr!=pend ) {
605 
606  selectorTruth.selectTrack( *pitr++ );
607 
608  ++ipc;
609 
610  }
611 
612  }
613  ++ie;
614  ++evitr;
615 
616  if ( ipc>0 ) {
618  // m_provider->msg(MSG::VERBOSE) << "Found " << ie << "\tpid " << pid << "\t with " << ip << " TruthParticles (GenParticles)" << endmsg;
619  ++ie_ip;
620  ip += ipc;
621  }
622  }
623 
624  if(m_provider->msg().level() <= MSG::VERBOSE){
625  m_provider->msg(MSG::VERBOSE) << "Found " << ip << " TruthParticles (GenParticles) in " << ie_ip << " GenEvents out of " << ie << endmsg;
626  m_provider->msg(MSG::VERBOSE) << "selected " << selectorTruth.size() << " TruthParticles (GenParticles)" << endmsg;
627  }
628 
629  if(selectorTruth.size() > 0) foundTruth = true;
630 
631  if ( !(ip>0) ) {
632  if (m_provider->msg().level() <= MSG::VERBOSE) m_provider->msg(MSG::WARNING) << "NO TRUTH PARTICLES - returning" << endmsg;
633  return;
634  }
635 
636  }
637 
638  if ( m_doOffline && !m_mcTruth) {
639 
640  bool found_offline = false;
641 
642  for ( size_t it=0 ; it<m_offline_types.size() ; it++ ) {
643  if ( m_provider->evtStore()->template contains<xAOD::TrackParticleContainer>( m_offline_types[it] ) ) {
644  this->template selectTracks<xAOD::TrackParticleContainer>( pselectorRef, m_offline_types[it] );
645  refbeamspot = this->template getBeamspot<xAOD::TrackParticleContainer>( m_offline_types[it] );
646  found_offline = true;
647  }
648  else {
649  m_provider->msg(MSG::WARNING) << "Offline tracks not found: " << m_offline_types[it] << endmsg;
650  }
651  }
652 
653  if ( !found_offline ) {
654  if (m_provider->evtStore()->template contains<Rec::TrackParticleContainer>("TrackParticleCandidate") ) {
656  this->template selectTracks<Rec::TrackParticleContainer>( pselectorRef, "TrackParticleCandidate" );
657  }
658  else {
659  m_provider->msg(MSG::WARNING) << "Offline tracks not found: " << "TrackParticleCandidate" << endmsg;
660  }
661  }
662 
663  }
664 
666 
667  TrackAssociator* associator = m_associator->clone();
668 
669  // std::cout << "\tloop() loop over chains proper ..." << std::endl;
670 
672  for ( unsigned ichain=0 ; ichain<m_chainNames.size() ; ichain++ ) {
673 
675 
676  // std::string& chainname = chains[ichain];
677  const std::string& chainname = m_chainNames[ichain].head();
678  const std::string& key = m_chainNames[ichain].tail();
679  const std::string& vtx_name = m_chainNames[ichain].vtx();
680 
681  // Not used left just in case
682  // const std::string& roi_name = m_chainNames[ichain].roi();
683  // const std::string& te_name = m_chainNames[ichain].element();
684  m_pTthreshold = 0;
685 
686  if ( m_chainNames[ichain].postcount() ) {
687  std::string ptvalue = m_chainNames[ichain].postvalue("pt");
688  if ( ptvalue!="" ) m_pTthreshold = std::stod(ptvalue);
689  }
690 
691 
692  unsigned decisiontype = TrigDefs::Physics;
693 
694  if ( !m_chainNames[ichain].passed() ) decisiontype = TrigDefs::includeFailedDecisions;
695 
697  // if ( decisiontype==TrigDefs::requireDecision ) std::cout << "\tSUTT TrigDefs::requireDecision " << decisiontype << std::endl;
698  // if ( decisiontype==TrigDefs::Physics ) std::cout << "\tSUTT TrigDefs::Physics " << decisiontype << std::endl;
699 
700  if ( chainname!="" && m_provider->msg().level() <= MSG::VERBOSE ) {
701 
702  m_provider->msg(MSG::VERBOSE) << "status for chain " << chainname
703  << "\tpass " << (*m_tdt)->isPassed(chainname)
704  << "\tprescale " << (*m_tdt)->getPrescale(chainname) << endmsg;
705 
706  m_provider->msg(MSG::VERBOSE) << "fetching features for chain " << chainname << endmsg;
707 
708  m_provider->msg(MSG::VERBOSE) << chainname << "\tpassed: " << (*m_tdt)->isPassed( chainname ) << endmsg;
709  }
710 
712  // std::cout << "\tstatus for chain " << chainname
713  // << "\tpass " << (*m_tdt)->isPassed( chainname )
714  // << "\tpassdt " << (*m_tdt)->isPassed( chainname, decisiontype )
715  // << "\tprescale " << (*m_tdt)->getPrescale( chainname ) << std::endl;
716 
717 
718  // m_provider->msg(MSG::INFO) << chainname << "\tpassed: " << (*m_tdt)->isPassed( chainname ) << "\t" << m_chainNames[ichain] << "\trun " << run_number << "\tevent " << event_number << endmsg;
719 
720 
721  if ( chainname!="" && !this->m_keepAllEvents && !(*m_tdt)->isPassed( chainname, decisiontype ) ) continue;
722 
725  // Trig::FeatureContainer f = (*m_tdt)->features( chainname, TrigDefs::alsoDeactivateTEs);
726 
729 
730  // tag and probe analysis processes multiple chains passed in the tag and probe tool at once so loop over vector of chains
731  std::vector<std::string> chainNames ;
732 
733  if ( !m_tnp_flag ) {
734  chainNames.push_back(m_chainNames[ichain].raw()) ;
735  }
736  else {
737  chainNames.push_back(pTnP_tool->tag());
738  chainNames.push_back(pTnP_tool->probe());
739  }
740 
741  // loop over new chainNames vector but doing the same stuff
742  for ( size_t i=0 ; i<chainNames.size() ; i++ ) {
743 
744  ChainString chainConfig = chainNames[i] ;
745  std::string chainName = chainConfig.head();
746 
747  eventp->addChain( chainNames[i] );
748 
749  TIDA::Chain& chain = eventp->back();
750 
751  if ( chainName == "" ) {
752 
754 
755  pselectorTest->clear();
756 
758 
759  // TIDARoiDescriptor roifs(true);
760 
761  // chain.addRoi( roifs );
762 
763  chain.addRoi( TIDARoiDescriptor(true) );
764 
765  if ( m_provider->evtStore()->template contains<xAOD::TrackParticleContainer>(key) ) {
766  this->template selectTracks<xAOD::TrackParticleContainer>( pselectorTest, key );
767  refbeamspot = this->template getBeamspot<xAOD::TrackParticleContainer>( key );
768  }
769 
770  const std::vector<TIDA::Track*>& testtracks = pselectorTest->tracks();
771 
772  chain.back().addTracks(testtracks);
773 
774  if ( vtx_name!="" ) {
775 
777 
778  m_provider->msg(MSG::VERBOSE) << "\tFetch xAOD::VertexContainer with key " << vtx_name << endmsg;
779 
780  std::vector<TIDA::Vertex> tidavertices;
781 
782  if ( this->select( tidavertices, vtx_name ) ) chain.back().addVertices( tidavertices );
783  }
784 
785 
786  // if ( roiInfo ) delete roiInfo;
787 
788  }
789  else {
790 
792 
793  //std::string roi_key = m_chainNames[ichain].roi();
794 
795  std::string roi_key = chainConfig.roi();
796 
797  unsigned feature_type =TrigDefs::lastFeatureOfType;
798 
799  if ( roi_key!="" ) feature_type= TrigDefs::allFeaturesOfType;
800 
802 
803  int leg = -1;
804 
805  if ( chainConfig.element()!="" ) {
806  leg = std::atoi(chainConfig.element().c_str());
807  }
808 
809  std::string rgex = roi_key;
810 
811  std::vector< TrigCompositeUtils::LinkInfo<TrigRoiDescriptorCollection> > rois =
812  (*m_tdt)->template features<TrigRoiDescriptorCollection>( Trig::FeatureRequestDescriptor( chainName,
813  decisiontype,
814  rgex,
815  feature_type,
816  "roi",
817  leg ) );
818 
821 
822  if ( rois.empty() ) {
823  if ( !rgex.empty() ) {
824  rgex += "_probe";
825  rois = (*m_tdt)->template features<TrigRoiDescriptorCollection>( Trig::FeatureRequestDescriptor( chainName,
826  decisiontype,
827  rgex,
828  feature_type,
829  "roi",
830  leg ) );
831  }
832  }
833 
834  int iroi = 0;
835 
837 
838  iroi++;
839 
843 
844  if ( roi_key=="SuperRoi" && iroi>1 ) continue;
845 
846  // std::cout << "\troi: get link " << roi_key << " ..." << std::endl;
847 
848  const ElementLink<TrigRoiDescriptorCollection> roi_link = roi_info.link;
849 
851  if ( roi_key!="" && roi_link.dataID()!=rgex ) continue;
852 
854  if ( !roi_link.isValid() ) continue;
855 
856  const TrigRoiDescriptor* const* roiptr = roi_link.cptr();
857 
858  if ( roiptr == 0 ) continue;
859 
860 
862  // std::cout << "\troi: link deref ..." << *roiptr << std::endl;
863 
864  if (m_provider->msg().level() <= MSG::VERBOSE) {
865  m_provider->msg(MSG::VERBOSE) << " RoI descriptor for seeded chain " << chainname << " " << **roiptr << endmsg;
866  }
867 
869 
870  // if ( dbg ) std::cout << "\troi " << iroi << " " << *roiInfo << std::endl;
871 
873 
874  pselectorTest->clear();
875 
876  if ( this->template selectTracks<xAOD::TrackParticleContainer>( pselectorTest, roi_link, key ) ) { }
877 
878  // beamspot stuff not needed for xAOD::TrackParticles
879 
881 
882  chain.addRoi( *roiInfo );
883 
885 
886  const std::vector<TIDA::Track*>& testtracks = pselectorTest->tracks();
887 
888  chain.back().addTracks(testtracks);
889 
890 
892 
893  if ( vtx_name!="" ) {
894 
895  std::vector<TIDA::Vertex> tidavertices;
896 
897  this->select( tidavertices, roi_link, vtx_name );
898 
899  chain.back().addVertices( tidavertices );
900 
901  }
902 
903 
904 #if 0
905  if ( dbg ) {
906  std::cout << "\tTIDA analysis for chain: " << chainname << "\t key: " << key << "\t" << **roiptr << std::endl;
907  std::cout << "\tcollections: " << chain.back() << std::endl;
908  }
909 #endif
910 
911  if ( roiInfo ) delete roiInfo;
912 
913  }
914 
915 
916  }
917 
918  } // end of loop chainNames vector loop
919 
920 
921  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
922  m_provider->msg(MSG::VERBOSE) << "event: " << *eventp << endmsg;
923  }
924 
925  }
926 
927  // close previous loop over chains and open new one
928 
929  for ( unsigned ichain=0 ; ichain<eventp->size() ; ichain++ ) {
930 
931  TIDA::Chain& chain = (*eventp)[ichain];
932  ChainString chainConfig(chain.name());
933  const std::string& vtx_name = chainConfig.vtx();
934 
935  // skip tag chains to avoid performing standard analysis on them (done for tnp at the same time as probes)
936  if ( m_tnp_flag && chainConfig.extra().find("_tag")!=std::string::npos ) continue ;
937 
938  std::vector<TIDA::Roi*> rois ;
939 
940  if (m_tnp_flag) {
941  // needs to be done AFTER retrieving offline tracks as pselectorRef passed as arguement, hence restructuring
942  rois = pTnP_tool->GetRois( eventp->chains(), pselectorRef, &filterRef, m_invmass, m_invmass_obj );
943  }
944  else {
945  rois.reserve( chain.size() );
946  for ( size_t ir=0 ; ir<chain.size() ; ir++ ) {
947  rois.push_back( &(chain.rois()[ir]) );
948  }
949  }
950 
951  // now loop over the rois (again)
952 
953  for ( unsigned iroi=0 ; iroi<rois.size() ; iroi++ ) {
954 
955  if ( this->filterOnRoi() ) {
956  filterRef.setRoi( &(rois.at(iroi)->roi() ) );
957  filterRef.containtracks( m_containTracks );
958  }
959  else filterRef.setRoi( 0 );
960 
961  test_tracks.clear();
962 
963  // this block is before the track retrieval in the original, is it working the same here?
964 
978 
979  if ( m_provider->msg().level() <= MSG::VERBOSE )
980  m_provider->msg(MSG::VERBOSE) << "MC Truth flag " << m_mcTruth << endmsg;
981 
982  if ( m_mcTruth ) {
983  if ( this->filterOnRoi() ) filter_truth.setRoi( &(rois.at(iroi)->roi() ) );
984  ref_tracks = pselectorRef->tracks(&filter_truth);
985  }
986  else { // ie. if ( m_doOffline )
987  ref_tracks = pselectorRef->tracks(&filterRef) ;
988  }
989 
990  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
991  m_provider->msg(MSG::VERBOSE) << "ref tracks.size() " << pselectorRef->tracks().size() << endmsg;
992  for ( int ii=pselectorRef->tracks().size() ; ii-- ; ) {
993  m_provider->msg(MSG::VERBOSE) << " ref track " << ii << " " << *pselectorRef->tracks()[ii] << endmsg;
994  }
995  }
996 
997  test_tracks.clear();
998 
999 
1000  for ( unsigned itrk=0 ; itrk<rois.at(iroi)->tracks().size() ; itrk++ ) {
1001  test_tracks.push_back(&(rois.at(iroi)->tracks().at(itrk)));
1002  }
1003 
1005  // std::cout << "sutt track multiplicities: offline " << offline_tracks.size() << "\ttest " << test_tracks.size() << std::endl;
1006 
1008 
1009  beamline[0] = pselectorTest->getBeamX();
1010  beamline[1] = pselectorTest->getBeamY();
1011  beamline[2] = pselectorTest->getBeamZ();
1012 
1013  beamline[3] = vertices.size();
1014 
1022  // m_manalysis->setvertices( vertices.size() ); /// what is this for ??? /// is this thread safe ???
1023 
1026 
1027  if ( m_runPurity ) {
1028 
1029  if ( this->getUseHighestPT() ) HighestPTOnly( test_tracks );
1030 
1031  if ( m_pTthreshold>0 ) FilterPT( test_tracks, m_pTthreshold );
1032 
1034  m_NRois++;
1035  m_NRefTracks += test_tracks.size();
1036  m_NTestTracks += ref_tracks.size();
1037 
1039  associator->match( test_tracks, ref_tracks );
1040 
1041  m_manalysis->execute( test_tracks, ref_tracks, associator, eventp, beamline );
1042 
1043  }
1044  else {
1045 
1047  if ( this->getUseHighestPT() ) HighestPTOnly( ref_tracks );
1048 
1050 
1051  if ( m_pTthreshold>0 ) FilterPT( ref_tracks, m_pTthreshold );
1052 
1055  // if ( ref_tracks.size()==0 ) continue;
1056 
1058  m_NRois++;
1059  m_NRefTracks += ref_tracks.size();
1060  m_NTestTracks += test_tracks.size();
1061 
1063  associator->match( ref_tracks, test_tracks );
1064 
1069  // m_manalysis->setroi( &rois.at(iroi)->roi() );
1070  m_manalysis->execute( ref_tracks, test_tracks, associator, eventp, beamline, &(rois.at(iroi)->roi()) );
1071 
1072  if ( vtx_name!="" ) {
1074  std::vector<TIDA::Vertex> vr = rois.at(iroi)->vertices();
1075  std::vector<TIDA::Vertex*> vtx_rec;
1076  for ( unsigned iv=0 ; iv<vr.size() ; iv++ ) vtx_rec.push_back( &vr[iv] );
1077 
1078  std::vector<TIDA::Vertex*> vtx;
1079  if ( this->getVtxIndex()<0 ) {
1080  for ( unsigned iv=0 ; iv<vertices.size() ; iv++ ) vtx.push_back( &vertices[iv] );
1081  }
1082  else {
1083  if ( vertices.size()>unsigned(this->getVtxIndex()) ) vtx.push_back( &vertices[this->getVtxIndex()] );
1084  }
1085 
1086  m_manalysis->execute_vtx( vtx, vtx_rec, eventp );
1087  }
1088 
1089  }
1090 
1091  if ( m_manalysis->debug() ) {
1092  m_provider->msg(MSG::INFO) << "Missing track for " << m_chainNames[ichain]
1093  << "\trun " << run_number
1094  << "\tevent " << event_number
1095  << "\tlb " << lumi_block << endmsg;
1096  }
1097 
1098  }
1099 
1100  }
1101 
1102  delete associator;
1103 
1104  if ( m_provider->msg().level() <= MSG::VERBOSE ) {
1105  m_provider->msg(MSG::VERBOSE) << "\n\nEvent " << *eventp << endmsg;
1106  }
1107 
1108  }
1109 
1110 
1111 
1112  virtual void book() {
1113 
1114  if(m_provider->msg().level() <= MSG::VERBOSE)
1115  m_provider->msg(MSG::VERBOSE) << "AnalysisConfigR3_Tier0::book() " << name() << endmsg;
1116 
1117  // get the TriggerDecisionTool
1118 
1119  if( m_tdt->retrieve().isFailure() ) {
1120  if(m_provider->msg().level() <= MSG::ERROR)
1121  m_provider->msg(MSG::ERROR) << " Unable to retrieve the TrigDecisionTool: Please check job options file" << endmsg;
1122  return;
1123  }
1124 
1125  if(m_provider->msg().level() <= MSG::VERBOSE) {
1126  m_provider->msg(MSG::VERBOSE) << " Successfully retrived the TrigDecisionTool" << endmsg;
1127  }
1128 
1129 
1131  if (m_provider->msg().level() <= MSG::VERBOSE) {
1132  std::vector<std::string> configuredChains = (*(m_tdt))->getListOfTriggers("L2_.*, EF_.*, HLT_.*");
1133 
1134  m_provider->msg(MSG::VERBOSE) << "Configured chains" << endmsg;
1135  for ( unsigned i=0 ; i<configuredChains.size() ; i++ ) {
1136  if( m_provider->msg().level() <= MSG::VERBOSE)
1137  m_provider->msg(MSG::VERBOSE) << " Chain " << configuredChains[i] << endmsg;
1138  }
1139  }
1140 
1141 
1142  for ( unsigned ic=0 ; ic<m_chainNames.size() ; ic++ ) {
1143 
1144  if ( ic>0 ) {
1145  m_provider->msg(MSG::WARNING) << "more than one chain configured for this analysis - skipping " << m_chainNames[ic] << endmsg;
1146  continue;
1147  }
1148 
1149  m_provider->msg(MSG::VERBOSE) << "Analyse chain " << m_chainNames[ic] << endmsg;
1150 
1151  // m_provider->msg(MSG::VERBOSE) << "--------------------------------------------------" << endmsg;
1152 
1153  std::string folder_name = "";
1154 
1155  if ( name()!="" ) folder_name = name();
1156  else folder_name = "HLT/TRIDT/IDMon";
1157 
1159  if( m_testType != "" ) folder_name = folder_name + "/" + m_testType;
1160 
1161  std::string mongroup;
1162 
1163 #if 0
1164 
1167  if ( name().find("Shifter")!=std::string::npos || m_shifter ) {
1169  if ( m_chainNames.at(ic).tail().find("_FTF") != std::string::npos ) mongroup = folder_name + "/FTF";
1170  else if ( m_chainNames.at(ic).tail().find("_IDTrig") != std::string::npos ||
1171  m_chainNames.at(ic).tail().find("_EFID") != std::string::npos ) mongroup = folder_name + "/EFID";
1172  else if ( m_chainNames.at(ic).tail().find("InDetTrigParticle") != std::string::npos ) mongroup = folder_name + "/EFID_RUN1";
1173  else if ( m_chainNames.at(ic).tail().find("_GSF") != std::string::npos ) mongroup = folder_name + "/GSF";
1174  else mongroup = folder_name + "/Unknown";
1175 
1176  if ( m_chainNames.at(ic).vtx()!="" ) mongroup += "/" + m_chainNames.at(ic).vtx();
1177 
1178  }
1179 #endif
1180  // else {
1182 
1183  if ( m_chainNames[ic].head() == "" ) mongroup = folder_name + "/Fullscan";
1184  else mongroup = folder_name + "/" + m_chainNames[ic].head();
1185 
1186  std::string track_collection = "";
1187 
1188  if ( m_chainNames.at(ic).tail()!="" ) {
1189  track_collection = "/" + m_chainNames.at(ic).tail();
1190  if ( m_chainNames.at(ic).extra()!="" ) track_collection += "_" + m_chainNames.at(ic).extra();
1191  }
1192 
1193  if ( m_chainNames.at(ic).roi()!="" ) {
1194  if ( track_collection!="" ) track_collection += "_" + m_chainNames[ic].roi();
1195  else track_collection = "/" + m_chainNames[ic].roi();
1196  }
1197 
1198  if ( m_chainNames.at(ic).vtx()!="" ) {
1199  if ( track_collection!="" ) track_collection += "_" + m_chainNames[ic].vtx();
1200  else track_collection = "/" + m_chainNames[ic].vtx();
1201  }
1202 
1204  if ( m_chainNames.at(ic).element()!="" ) {
1205  if ( track_collection!="" ) track_collection += "_" + m_chainNames[ic].element();
1206  else track_collection = "/" + m_chainNames[ic].element();
1207  }
1208 
1209  if ( track_collection!="" ) mongroup += track_collection;
1210 
1211  if ( !m_chainNames.at(ic).passed() ) mongroup += "/DTE";
1212 
1213  // }
1214 
1215  m_provider->msg(MSG::VERBOSE) << " book mongroup " << mongroup << endmsg;
1216 
1217  m_manalysis = dynamic_cast<A*>(m_analysis);
1218 
1219  if ( monTool() ) m_manalysis->set_monTool( monTool() );
1220 
1222 
1223  if(m_provider->msg().level() <= MSG::VERBOSE) {
1224  m_provider->msg(MSG::VERBOSE) << "AnalysisConfigR3_Tier0::book() done" << endmsg;
1225  }
1226  }
1227 
1228  }
1229 
1230 
1231 
1232  virtual void finalize() {
1233 
1234  if(m_provider->msg().level() <= MSG::VERBOSE){
1235  m_provider->msg(MSG::VERBOSE) << "AnalysisConfigR3_Tier0::finalise() " << m_provider->name() << endmsg;
1236  }
1237 
1238  m_analysis->finalise();
1239 
1240  m_provider->msg(MSG::INFO) << m_provider->name() << " " << m_chainNames[0] << " \tNRois processed: " << m_NRois << "\tRef tracks: " << m_NRefTracks << "\tTestTracks: " << m_NTestTracks << endmsg;
1241 
1242  if(m_provider->msg().level() <= MSG::VERBOSE) {
1243  m_provider->msg(MSG::VERBOSE) << m_provider->name() << " finalised" << endmsg;
1244  }
1245  }
1246 
1247 
1248 protected:
1249 
1251 
1252  std::vector<ChainString> m_chainNames;
1253  std::vector<A*> m_analyses;
1254  std::string m_testType;
1255 
1259  bool m_doTaus;
1263 
1264  std::vector<std::string> m_offline_types;
1265  std::vector<std::string> m_types;
1266 
1267  std::string m_outputFileName;
1268 
1269  int m_pdgID;
1271 
1273  int m_NRois;
1276 
1278 
1280 
1282 
1283  bool m_first;
1284 
1286 
1288 
1290 
1291  ToolHandle<GenericMonitoringTool>* m_monTool;
1292 
1295 
1296 };
1297 
1298 
1299 
1300 #endif // TrigInDetAnalysisExample_T_AnalysisConfigR3_Tier0_H
1301 
T_AnalysisConfigR3_Tier0::m_doMuons
bool m_doMuons
Definition: T_AnalysisConfigR3_Tier0.h:1257
T_AnalysisConfigR3_Tier0::m_useBeamCondSvc
bool m_useBeamCondSvc
Definition: T_AnalysisConfigR3_Tier0.h:1250
TrackAnalysis::initialise
virtual void initialise()=0
standard operation interface
Trig::FeatureRequestDescriptor
Definition: FeatureRequestDescriptor.h:37
T_AnalysisConfigR3_Tier0::m_invmass_obj
TIDA::Histogram< float > * m_invmass_obj
Definition: T_AnalysisConfigR3_Tier0.h:1294
TIDA::Associator
Definition: TIDAAssociator.h:24
TIDARoiDescriptorBuilder.h
T_AnalysisConfigR3_Tier0::m_tnp_flag
bool m_tnp_flag
Definition: T_AnalysisConfigR3_Tier0.h:1289
T_AnalysisConfigR3_Tier0::m_chainNames
std::vector< ChainString > m_chainNames
Definition: T_AnalysisConfigR3_Tier0.h:1252
T_AnalysisConfigR3_Tier0::containTracks
void containTracks(bool b)
Definition: T_AnalysisConfigR3_Tier0.h:207
T_AnalysisConfig< T >::m_mcTruth
bool m_mcTruth
Definition: T_AnalysisConfig.h:986
T_AnalysisConfigR3_Tier0::m_offline_types
std::vector< std::string > m_offline_types
Definition: T_AnalysisConfigR3_Tier0.h:1264
Filter_RoiSelector.h
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
GenEvent.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
plotting.plot_kinematics.run_number
run_number
Definition: plot_kinematics.py:29
ElectronContainer.h
T_AnalysisConfigR3_Tier0::m_analyses
std::vector< A * > m_analyses
Definition: T_AnalysisConfigR3_Tier0.h:1253
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
operator<<
std::ostream & operator<<(std::ostream &s, const std::vector< T > &v)
Definition: T_AnalysisConfigR3_Tier0.h:89
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
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:955
TrigTrackSelector::clear
virtual void clear() override
Definition: TrigTrackSelector.h:102
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
TrigCompositeUtils.h
TrackAnalysis::finalise
virtual void finalise()=0
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:957
TIDAEvent.h
Basic event class to contain a vector of chains for trigger analysis
TruthParticleContainer.h
TrackFilter
Definition: TrackFilter.h:26
HepMC::signal_process_id
int signal_process_id(const GenEvent &e)
Definition: GenEvent.h:513
TrackSelector::size
unsigned size() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:63
Filter_etaPT
Definition: Filter_etaPT.h:27
GenVertex.h
TIDA::Event::size
unsigned size() const
vertex multiplicity ?
Definition: TIDAEvent.h:64
TIDAVertex.h
ChainString::head
std::string head() const
Definition: ChainString.h:33
MuonContainer.h
Filters.h
skel.it
it
Definition: skel.GENtoEVGEN.py:423
T_AnalysisConfigR3_Tier0::m_NRefTracks
int m_NRefTracks
Definition: T_AnalysisConfigR3_Tier0.h:1274
T_AnalysisConfig< T >::analysis
const TrackAnalysis * analysis() const
Definition: T_AnalysisConfig.h:256
T_AnalysisConfigR3_Tier0::setTypes
void setTypes(const std::vector< std::string > &t)
Definition: T_AnalysisConfigR3_Tier0.h:217
T_AnalysisConfigR3_Tier0::m_pdgID
int m_pdgID
Definition: T_AnalysisConfigR3_Tier0.h:1269
TIDARoiDescriptor
Describes the Region of Ineterest geometry It has basically 8 parameters.
Definition: TIDARoiDescriptor.h:42
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
ExpertMethods.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
T_AnalysisConfig< T >::getUseHighestPT
bool getUseHighestPT() const
Definition: T_AnalysisConfig.h:277
Filter_AcceptAll.h
T_AnalysisConfig.h
HLTResult.h
Associator_BestMatch.h
TIDA::Event
Definition: TIDAEvent.h:33
TIDA::Event::lumi_block
void lumi_block(unsigned lb)
Definition: TIDAEvent.h:44
ChainString::roi
std::string roi() const
Definition: ChainString.h:35
T_AnalysisConfigR3_Tier0::loop
virtual void loop()
Definition: T_AnalysisConfigR3_Tier0.h:242
T_AnalysisConfigR3_Tier0::setPdgID
void setPdgID(int i=0)
Definition: T_AnalysisConfigR3_Tier0.h:209
GenParticle.h
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
TIDA::Histogram< float >
T_AnalysisConfigR3_Tier0::m_NTestTracks
int m_NTestTracks
Definition: T_AnalysisConfigR3_Tier0.h:1275
TIDA::Associator::clone
virtual Associator * clone()=0
T_AnalysisConfigR3_Tier0::m_testType
std::string m_testType
Definition: T_AnalysisConfigR3_Tier0.h:1254
TIDA::Event::chains
const std::vector< TIDA::Chain > & chains() const
Definition: TIDAEvent.h:76
TIDA::Chain::addRoi
void addRoi(TIDA::Roi &roi)
add and roi by root dictionary class
Definition: TIDAChain.h:44
PlotCalibFromCool.ie
ie
Definition: PlotCalibFromCool.py:420
dbg
bool dbg
Definition: listroot.cxx:36
covarianceTool.filter
filter
Definition: covarianceTool.py:514
dqt_zlumi_alleff_HIST.A
A
Definition: dqt_zlumi_alleff_HIST.py:110
HepMC::end
GenEvent::particle_iterator end(HepMC::GenEvent &e)
Definition: GenEvent.h:499
ChainString::extra
std::string extra() const
Definition: ChainString.h:38
TrigTrackSelector::getBeamX
double getBeamX() const
Definition: TrigTrackSelector.h:96
T_AnalysisConfigR3_Tier0::finalize
virtual void finalize()
Definition: T_AnalysisConfigR3_Tier0.h:1232
TIDA::Chain::back
TIDA::Roi & back()
Definition: TIDAChain.h:60
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 ...
TagNProbe
Definition: TagNProbe.h:28
GenericMonitoringTool.h
T_AnalysisConfigR3_Tier0::m_doElectrons
bool m_doElectrons
Definition: T_AnalysisConfigR3_Tier0.h:1258
TagNProbe.h
emacs: this is -*- c++ -*-
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
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
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:92
TIDA::Event::event_number
void event_number(unsigned long long e)
Definition: TIDAEvent.h:43
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TagNProbe::tag
void tag(const std::string &chainName)
getters and setters
Definition: TagNProbe.h:45
TrackSelector.h
T_AnalysisConfigR3_Tier0::T_AnalysisConfigR3_Tier0
T_AnalysisConfigR3_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, TagNProbe *TnP_tool=0)
Definition: T_AnalysisConfigR3_Tier0.h:107
T_AnalysisConfig< T >::m_analysis
TrackAnalysis * m_analysis
Definition: T_AnalysisConfig.h:984
T_AnalysisConfigR3_Tier0::initialise
void initialise()
Definition: T_AnalysisConfigR3_Tier0.h:184
T_AnalysisConfig< T >::getVtxIndex
int getVtxIndex() const
Definition: T_AnalysisConfig.h:280
T_AnalysisConfigR3_Tier0::m_first
bool m_first
Definition: T_AnalysisConfigR3_Tier0.h:1283
T_AnalysisConfigR3_Tier0::m_containTracks
bool m_containTracks
Definition: T_AnalysisConfigR3_Tier0.h:1285
T_AnalysisConfigR3_Tier0::m_invmass
TIDA::Histogram< float > * m_invmass
Definition: T_AnalysisConfigR3_Tier0.h:1293
TrackAnalysis
Definition: TrackAnalysis.h:32
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
T_AnalysisConfigR3_Tier0::book
virtual void book()
Definition: T_AnalysisConfigR3_Tier0.h:1112
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
compute_lumi.leg
leg
Definition: compute_lumi.py:95
Filter_etaPT.h
HighestPTOnly
void HighestPTOnly(std::vector< T * > &tracks)
Definition: TIDATools.h:20
TauJetContainer.h
T_AnalysisConfig< T >::m_keepAllEvents
bool m_keepAllEvents
Definition: T_AnalysisConfig.h:993
VxContainer.h
T_AnalysisConfigR3_Tier0::m_monTool
ToolHandle< GenericMonitoringTool > * m_monTool
Definition: T_AnalysisConfigR3_Tier0.h:1291
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
Filter_True
default simple filter which accepts all tracks
Definition: Filters.h:26
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
VtxAnalysis.h
T_AnalysisConfigR3_Tier0::m_shifter
bool m_shifter
Definition: T_AnalysisConfigR3_Tier0.h:1279
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
T_AnalysisConfigR3_Tier0::m_outputFileName
std::string m_outputFileName
Definition: T_AnalysisConfigR3_Tier0.h:1267
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
head
std::string head(std::string s, const std::string &pattern)
head of a string
Definition: computils.cxx:310
ChainString::element
std::string element() const
Definition: ChainString.h:37
T_AnalysisConfig< T >::retrieve
StatusCode retrieve(Collection const *&collection, const std::string &key="")
Definition: T_AnalysisConfig.h:571
T_AnalysisConfigR3_Tier0::m_doOffline
bool m_doOffline
Definition: T_AnalysisConfigR3_Tier0.h:1256
T_AnalysisConfig< T >::m_associator
TrackAssociator * m_associator
Definition: T_AnalysisConfig.h:983
TrackSelector::tracks
const std::vector< TIDA::Track * > & tracks() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/TrackSelector.h:53
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
ChainString.h
Filter_Combined
Definition: Filters.h:225
TIDA::Chain
Definition: TIDAChain.h:28
T_AnalysisConfigR3_Tier0::m_runPurity
bool m_runPurity
Definition: T_AnalysisConfigR3_Tier0.h:1277
T_AnalysisConfigR3_Tier0
Definition: T_AnalysisConfigR3_Tier0.h:96
T_AnalysisConfigR3_Tier0::~T_AnalysisConfigR3_Tier0
virtual ~T_AnalysisConfigR3_Tier0()
Definition: T_AnalysisConfigR3_Tier0.h:177
T_AnalysisConfigR3_Tier0::set_monTool
void set_monTool(ToolHandle< GenericMonitoringTool > *m)
Definition: T_AnalysisConfigR3_Tier0.h:219
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
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
TIDA::Event::mu
void mu(double m)
Definition: TIDAEvent.h:47
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
TrackParticle.h
python.PyAthena.v
v
Definition: PyAthena.py:157
Filter_Combined::setRoi
void setRoi(TIDARoiDescriptor *r)
Definition: Filters.h:236
TagNProbe::GetRois
std::vector< TIDA::Roi * > GetRois(std::vector< TIDA::Chain > &chains, const TrackSelector *selector, TrackFilter *filter, T *hmass, T *hmass_obj, TrigObjectMatcher *tom=0) const
Definition: TagNProbe.h:60
TrigCompositeUtils::LinkInfo
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Definition: LinkInfo.h:28
T_AnalysisConfigR3_Tier0::setMCTruthRef
void setMCTruthRef(bool b)
Definition: T_AnalysisConfigR3_Tier0.h:213
AnalysisR3_Tier0.h
T_AnalysisConfigR3_Tier0::m_NRois
int m_NRois
output stats
Definition: T_AnalysisConfigR3_Tier0.h:1273
T_AnalysisConfigR3_Tier0::m_doTauThreeProng
bool m_doTauThreeProng
Definition: T_AnalysisConfigR3_Tier0.h:1261
T_AnalysisConfigR3_Tier0::setOfflineRef
void setOfflineRef(bool b)
Definition: T_AnalysisConfigR3_Tier0.h:215
T_AnalysisConfigR3_Tier0::setRunPurity
void setRunPurity(bool b)
Definition: T_AnalysisConfigR3_Tier0.h:201
ChainString::vtx
std::string vtx() const
Definition: ChainString.h:36
T_AnalysisConfigR3_Tier0::m_tauEtCutOffline
bool m_tauEtCutOffline
Definition: T_AnalysisConfigR3_Tier0.h:1262
T_AnalysisConfigR3_Tier0::useBeamCondSvc
void useBeamCondSvc(bool b)
Definition: T_AnalysisConfigR3_Tier0.h:205
DEBUG
#define DEBUG
Definition: page_access.h:11
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:353
TriggerTest.rois
rois
Definition: TriggerTest.py:23
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
TrigTrackSelector::getBeamZ
double getBeamZ() const
Definition: TrigTrackSelector.h:98
HepMC::begin
GenEvent::particle_iterator begin(HepMC::GenEvent &e)
Definition: GenEvent.h:498
TrigTrackSelector::getBeamY
double getBeamY() const
Definition: TrigTrackSelector.h:97
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:282
T_AnalysisConfigR3_Tier0::setShifter
void setShifter(bool b)
Definition: T_AnalysisConfigR3_Tier0.h:203
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
T_AnalysisConfig< T >::name
const std::string name() const
Definition: T_AnalysisConfig.h:233
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
T_AnalysisConfigR3_Tier0::m_TnP_tool
TagNProbe * m_TnP_tool
Definition: T_AnalysisConfigR3_Tier0.h:1287
TIDA::Associator::match
virtual void match(const std::vector< T * > &s1, const std::vector< S * > &s2)=0
python.StandardJetMods.vr
vr
Definition: StandardJetMods.py:276
TIDA::Event::bunch_crossing_id
void bunch_crossing_id(unsigned b)
Definition: TIDAEvent.h:46
T_AnalysisConfig< T >::m_filters
std::vector< std::vector< TrackFilter * > > m_filters
Definition: T_AnalysisConfig.h:977
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_AnalysisConfigR3_Tier0::m_parent_pdgID
int m_parent_pdgID
Definition: T_AnalysisConfigR3_Tier0.h:1270
T_AnalysisConfigR3_Tier0::setParentPdgID
void setParentPdgID(int i=0)
Definition: T_AnalysisConfigR3_Tier0.h:211
T_AnalysisConfigR3_Tier0::m_pTthreshold
double m_pTthreshold
Definition: T_AnalysisConfigR3_Tier0.h:1281
T_AnalysisConfigR3_Tier0::m_doBjets
bool m_doBjets
Definition: T_AnalysisConfigR3_Tier0.h:1260
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
T_AnalysisConfigR3_Tier0::monTool
ToolHandle< GenericMonitoringTool > * monTool()
Definition: T_AnalysisConfigR3_Tier0.h:221
TrackParticleContainer.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
T_AnalysisConfigR3_Tier0::m_manalysis
A * m_manalysis
Definition: T_AnalysisConfigR3_Tier0.h:225
TagNProbe::probe
void probe(const std::string &chainName)
Definition: TagNProbe.h:46
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
T_AnalysisConfigR3_Tier0::m_types
std::vector< std::string > m_types
Definition: T_AnalysisConfigR3_Tier0.h:1265
T_AnalysisConfig< T >::select
bool select(std::vector< TIDA::Vertex > &vertices, xAOD::VertexContainer::const_iterator vtx_start, xAOD::VertexContainer::const_iterator vtx_end)
Definition: T_AnalysisConfig.h:340
T_AnalysisConfig
Definition: T_AnalysisConfig.h:59
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
T_AnalysisConfigR3_Tier0::m_doTaus
bool m_doTaus
Definition: T_AnalysisConfigR3_Tier0.h:1259