ATLAS Offline Software
FeatureCollectStandalone.cxx
Go to the documentation of this file.
1 // Emacs -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
9 
12 
14 
15 
16 
17 //pretty printing a TypelessFeature object
18 std::ostream & Trig::operator<<(std::ostream & o, const Trig::TypelessFeature & feat) {
19  o << "Feature accessible by : " << feat.accessHelper();
20  return o;
21 }
22 
23 namespace Trig{
24  namespace FeatureAccessImpl {
25 
27 
28  //completely disabled for now. should be reenabled once we have more recent TNS tag in Athena
30  #ifndef XAOD_STANDALONE
31  answer = navigation->getFeature(te,ClassID_traits<TrigPassBits>::ID(),"passbits");
32  #else
33  (void)te;
34  (void)navigation;
35  #endif
36 
37 
38  if(answer.valid()){
39 #ifdef XAOD_STANDALONE // AnalysisBase
40  // In AnalysisBase we can't access TrigPassBits. So warn the user about
41  // this, and pretend that no TrigPassBits is available for this element.
42  static bool warningPrinted = false;
43  if( ! warningPrinted ) {
44  std::cerr << "FeatureAccessImpl::getTypelessBits WARNING "
45  << "Retrieving a container that has TrigPassBits attached "
46  << "to it" << std::endl;
47  std::cerr << "FeatureAccessImpl::getTypelessBits WARNING "
48  << "But it's not possible to use TrigPassBits in "
49  << "standalone mode" << std::endl;
50  std::cerr << "FeatureAccessImpl::getTypelessBits WARNING "
51  << "So, keep in mind that some of the returned objects "
52  << "didn't actually pass the required chain"
53  << std::endl;
54  warningPrinted = true;
55  }
57 #else
58  return answer;
59 #endif // XAOD_STANDALONE
60  }
62  }
63 
64 
66  std::vector<Trig::TypelessFeature>& data,
67  const std::string& label, unsigned int condition,
68  const HLT::TrigNavStructure* navigation ){
69  //collect recursively features for this trigger element
70  if (condition == TrigDefs::Physics && !te->getActiveState() ) return;
71 
72  const HLT::TriggerElement* source = 0;
73  HLT::TriggerElement::FeatureAccessHelper answer = navigation->getFeatureRecursively(te,clid,label,source);
74  if(!answer.valid() && source){
75  //source was set but answer invalid -> bifurcation
76  for(auto& predecessor : navigation->getDirectPredecessors(source)){
77  typelessCollect(predecessor,clid,data,label,condition,navigation);
78  }
79  }
80  if(answer.valid()){
81  auto typelessholder = navigation->getHolder(answer);
82  if(!typelessholder){
83  //this can happen, because features were thinned away (which deletes the Holders, but doesn't touch the TE structure)
84  //so we'll let this slip silently
85  return;
86  }
87  data.push_back(Trig::TypelessFeature(answer,source,typelessholder->label()));
88  }
89  }
90  } // EOF namespace FeatureAccessImpl
91 } // EOF namespace Trig
92 
Trig::FeatureAccessImpl::getTypelessBits
HLT::TriggerElement::FeatureAccessHelper getTypelessBits(const HLT::TriggerElement *te, const HLT::TrigNavStructure *navigation)
Definition: FeatureCollectStandalone.cxx:26
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Trig
The common trigger namespace for trigger analysis tools.
Definition: CaloTowerVecMon.h:44
TrigNavStructure.h
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
HLT::TriggerElement::getActiveState
bool getActiveState() const
get state of the TriggerElement
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:48
FeatureCollectStandalone.h
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
HLT::TrigNavStructure
Definition: TrigNavStructure.h:40
Trig::operator<<
std::ostream & operator<<(std::ostream &, const Trig::TypelessFeature &)
Definition: FeatureCollectStandalone.cxx:18
Trig::TypelessFeature
Feature class, holding information on Feature attached to navigation.
Definition: TypelessFeature.h:20
HLT::TrigNavStructure::getDirectPredecessors
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
Definition: TrigNavStructure.cxx:120
HLT::TriggerElement
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:27
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
HLT::class_id_type
uint32_t class_id_type
Definition: Trigger/TrigEvent/TrigNavStructure/Root/Types.h:11
HLT::TrigNavStructure::getFeature
TriggerElement::FeatureAccessHelper getFeature(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label) const
typeless feature access metod
Definition: TrigNavStructure.cxx:783
HLT::TrigNavStructure::getFeatureRecursively
TriggerElement::FeatureAccessHelper getFeatureRecursively(const TriggerElement *startTE, class_id_type clid, const index_or_label_type &index_or_label, const TriggerElement *&sourceTE) const
recursive search for features the function is similar to the above butif th features is not found at ...
Definition: TrigNavStructure.cxx:797
HLT::TriggerElement::FeatureAccessHelper
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:192
HLT::TriggerElement::FeatureAccessHelper::valid
bool valid() const
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:226
TypelessFeature.h
TrigPassBits.h
HLT::TrigNavStructure::getHolder
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const
Definition: TrigNavStructure.cxx:923
Trig::FeatureAccessImpl::typelessCollect
void typelessCollect(const HLT::TriggerElement *te, HLT::class_id_type clid, std::vector< Trig::TypelessFeature > &data, const std::string &label, unsigned int condition, const HLT::TrigNavStructure *navigation)
Definition: FeatureCollectStandalone.cxx:65
Trig::TypelessFeature::accessHelper
const HLT::TriggerElement::FeatureAccessHelper accessHelper() const
Definition: TypelessFeature.h:24