ATLAS Offline Software
Loading...
Searching...
No Matches
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
18std::ostream & Trig::operator<<(std::ostream & o, const Trig::TypelessFeature & feat) {
19 o << "Feature accessible by : " << feat.accessHelper();
20 return o;
21}
22
23namespace Trig{
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
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
TriggerElement::FeatureAccessHelper getFeature(const TriggerElement *te, class_id_type clid, const index_or_label_type &index_or_label) const
typeless feature access metod
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const
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 ...
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
bool getActiveState() const
get state of the TriggerElement
Feature class, holding information on Feature attached to navigation.
const HLT::TriggerElement::FeatureAccessHelper & accessHelper() const
std::string label(const std::string &format, int i)
Definition label.h:19
This is the implementation of the Feature collection for Athena.
HLT::TriggerElement::FeatureAccessHelper getTypelessBits(const HLT::TriggerElement *te, const HLT::TrigNavStructure *navigation)
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)
The common trigger namespace for trigger analysis tools.
std::ostream & operator<<(std::ostream &, const Trig::TypelessFeature &)