ATLAS Offline Software
DecisionAccess.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TRIGGER_DECISION_TOOL_DecisionAccess_H
8 #define TRIGGER_DECISION_TOOL_DecisionAccess_H
9 
10 /**********************************************************************************
11  * @Project: TrigDecisionTool
12  * @Package: TrigDecisionTool
13  * @class : DecisionAccess
14  *
15  * @brief access to information about the trigger decision
16  *
17  * @author Michael Begel <michael.begel@cern.ch> - Brookhaven National Laboratory
18  * @author Nicolas Berger <Nicolas.Berger@cern.ch> - LAPP Annecy
19  * @author Tomasz Bold <Tomasz.Bold@cern.ch> - UC Irvine - AGH Krakow
20  *
21  ***********************************************************************************/
22 #include <string>
23 #include <sstream>
24 #include <vector>
25 
34 
36 
38 
39 namespace HLT {
40  class Chain;
41 }
42 namespace TrigConf {
43  class HLTChain;
44  class HLTTriggerElement;
45 }
46 
47 class LVL1_ROI;
48 
49 namespace Trig {
50 
51  class CacheGlobalMemory;
52 
53  class DecisionAccess : public virtual Logger {
54  public:
55 
57  virtual ~DecisionAccess();
58 
64  bool isPassed(const Trig::ChainGroup* chaingroup,
65  unsigned int condition = TrigDefs::Physics) const;
71  bool isPassed(const std::string& chain,
72  unsigned int condition) const;
73 
74  bool isPassed(const std::string& chain) const;
75 
81  std::vector<bool> isPassedForEach(const Trig::ChainGroup* chainGroup,
82  unsigned int condition = TrigDefs::Physics) const;
83 
89  std::vector<bool> isPassedForEach(const std::string& chain,
90  unsigned int condition = TrigDefs::Physics) const;
91 
109  unsigned int isPassedBits(const Trig::ChainGroup* chaingroup) const;
110  unsigned int isPassedBits(const std::string& chain) const;
111 
115  std::vector<unsigned int> isPassedBitsForEach(const Trig::ChainGroup* chaingroup) const;
116  std::vector<unsigned int> isPassedBitsForEach(const std::string& chain) const;
117 
118 
124  char getBGCode() const;
125 
130  unsigned int condition = TrigDefs::Physics) const;
131 
135  FeatureContainer features(const std::string& chainName = "EF_.*",
136  unsigned int condition = TrigDefs::Physics) const;
137 
140 
146  template<class CONTAINER>
147  std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >
148  features(const Trig::FeatureRequestDescriptor& featureRequest) const;
149 
160  template<class CONTAINER>
161  std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >
163  const unsigned int condition = TrigDefs::Physics,
164  const std::string& containerSGKey = "",
165  const unsigned int featureCollectionMode = TrigDefs::lastFeatureOfType,
166  const std::string& navElementLinkKey = TrigCompositeUtils::featureString(),
167  const int restrictToLegIndex = -1) const;
168 
179  template<class CONTAINER>
180  std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >
181  features(const std::string& chainGroupName,
182  const unsigned int condition = TrigDefs::Physics,
183  const std::string& containerSGKey = "",
184  const unsigned int featureCollectionMode = TrigDefs::lastFeatureOfType,
185  const std::string& navElementLinkKey = TrigCompositeUtils::featureString(),
186  const int restrictToLegIndex = -1) const;
187 
196  template<class CONTAINER, class FEATURE_CONTAINER>
197  std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator >
200  const std::string& roiName = TrigCompositeUtils::roiString()) const;
201 
210  template<class CONTAINER>
211  std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator >
213  const TrigCompositeUtils::Decision* decisionObject,
214  const std::string& roiName = TrigCompositeUtils::roiString()) const;
215 
223  template<class CONTAINER>
224  std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator >
226  const ElementLink<TrigRoiDescriptorCollection>& matchROI) const;
227 
241  template<class CONTAINER>
242  std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator >
244  const uint32_t matchIndex,
245  const uint32_t matchKey = 0,
246  const bool isFullscan = false) const;
247 
249 
255  template<class T>
256  Feature<T> ancestor(const HLT::TriggerElement* te, std::string label = "") const;
257 
264  template<class T>
265  std::vector<Trig::Feature<T> > ancestors(const HLT::TriggerElement* te, std::string label = "", unsigned int condition=TrigDefs::Physics, const std::string& teName = "") const;
266 
267  protected:
268 
269  friend class Combination;
270 
271 
272  private:
273 
274  virtual Trig::CacheGlobalMemory* cgm() = 0;
275  virtual const Trig::CacheGlobalMemory* cgm() const = 0;
276 
277  // template<class T>
278  // const T* getL1RoI(const std::vector<T>& rois, unsigned int id) const;
279 
280 
281  //unsigned int initRoIWord(const HLT::TriggerElement* te) const;
282 
283  };
284 } // End of namespace
285 
286 #include "DecisionAccess.icc"
287 
288 #endif
Trig::FeatureRequestDescriptor
Definition: FeatureRequestDescriptor.h:37
Trig::Feature
Definition: Feature.h:112
Combination.h
Trig::DecisionAccess::isPassedBitsForEach
std::vector< unsigned int > isPassedBitsForEach(const Trig::ChainGroup *chaingroup) const
Return the result of isPassedBits for each chain in the group.
Definition: DecisionAccess.cxx:79
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
FeatureContainer.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Trig::DecisionAccess
Definition: DecisionAccess.h:53
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
Trig::Logger
Logging adaptor to provide interfaces required for ATH_MSG macros.
Definition: Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h:24
Trig::DecisionAccess::features
std::vector< TrigCompositeUtils::LinkInfo< CONTAINER > > features(const Trig::FeatureRequestDescriptor &featureRequest) const
Runs 3+.
Feature.h
Trig::DecisionAccess::getBGCode
char getBGCode() const
get the bunch group code bit X=1: BG X fired (X=0..7) use: bool BGXfired = BGCode & (0x1<<X)
Definition: DecisionAccess.cxx:103
navigation2dot.teName
def teName(teid)
Definition: navigation2dot.py:59
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
Trig::DecisionAccess::ancestors
std::vector< Trig::Feature< T > > ancestors(const HLT::TriggerElement *te, std::string label="", unsigned int condition=TrigDefs::Physics, const std::string &teName="") const
gives back features matching (by seeding relation) - will also flatten containers if necessary
Trig::CacheGlobalMemory
Definition: CacheGlobalMemory.h:67
ChainGroup.h
Trig::DecisionAccess::associateToEventView
std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator > associateToEventView(typename SG::ReadHandle< CONTAINER > &inViewContainer, const ElementLink< TrigRoiDescriptorCollection > &matchROI) const
Runs 3+.
trigbs_dumpPrescaleBits.HLTChain
HLTChain
Definition: trigbs_dumpPrescaleBits.py:41
Trig::DecisionAccess::isPassed
bool isPassed(const Trig::ChainGroup *chaingroup, unsigned int condition=TrigDefs::Physics) const
true if given group of chains passed
Definition: DecisionAccess.cxx:34
Trig::DecisionAccess::associateToEventView
std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator > associateToEventView(typename SG::ReadHandle< CONTAINER > &inViewContainer, const TrigCompositeUtils::Decision *decisionObject, const std::string &roiName=TrigCompositeUtils::roiString()) const
Runs 3+.
Trig::FeatureContainer
Definition: FeatureContainer.h:54
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
Trig::DecisionAccess::cgm
virtual const Trig::CacheGlobalMemory * cgm() const =0
TrigCompositeUtils.h
Trig::DecisionAccess::associateToEventView
std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator > associateToEventView(typename SG::ReadHandle< CONTAINER > &inViewContainer, const uint32_t matchIndex, const uint32_t matchKey=0, const bool isFullscan=false) const
Runs 3+.
Trig::DecisionAccess::~DecisionAccess
virtual ~DecisionAccess()
Definition: DecisionAccess.cxx:31
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
Trig::DecisionAccess::features
FeatureContainer features(const Trig::ChainGroup *group, unsigned int condition=TrigDefs::Physics) const
Runs 1, 2.
Definition: DecisionAccess.cxx:92
Trig::Combination
Definition: Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Combination.h:55
HLT::TriggerElement
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:27
TriggerElement.h
DecisionAccess.icc
Logger.h
Trig::DecisionAccess::features
std::vector< TrigCompositeUtils::LinkInfo< CONTAINER > > features(const std::string &chainGroupName, const unsigned int condition=TrigDefs::Physics, const std::string &containerSGKey="", const unsigned int featureCollectionMode=TrigDefs::lastFeatureOfType, const std::string &navElementLinkKey=TrigCompositeUtils::featureString(), const int restrictToLegIndex=-1) const
Runs 3+.
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
Trig::ChainGroup
Definition: ChainGroup.h:51
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
Trig::DecisionAccess::cgm
virtual Trig::CacheGlobalMemory * cgm()=0
ReadHandle.h
Handle class for reading from StoreGate.
Trig::DecisionAccess::isPassedBits
unsigned int isPassedBits(const Trig::ChainGroup *chaingroup) const
Return expert-level information about the various trigger flags as a bit mask.
Definition: DecisionAccess.cxx:67
Conditions.h
TrigCompositeUtils::LinkInfo
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Definition: LinkInfo.h:28
Trig::DecisionAccess::DecisionAccess
DecisionAccess()
Definition: DecisionAccess.cxx:29
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:876
Trig::DecisionAccess::ancestor
Feature< T > ancestor(const HLT::TriggerElement *te, std::string label="") const
gives back feature matching (by seeding relation)
FeatureRequestDescriptor.h
Trig::DecisionAccess::isPassedForEach
std::vector< bool > isPassedForEach(const Trig::ChainGroup *chainGroup, unsigned int condition=TrigDefs::Physics) const
return decision for each chain in group
Definition: DecisionAccess.cxx:53
Trig::DecisionAccess::associateToEventView
std::pair< typename CONTAINER::const_iterator, typename CONTAINER::const_iterator > associateToEventView(typename SG::ReadHandle< CONTAINER > &inViewContainer, const TrigCompositeUtils::LinkInfo< FEATURE_CONTAINER > linkInfo, const std::string &roiName=TrigCompositeUtils::roiString()) const
Runs 3+.
Trig::DecisionAccess::features
std::vector< TrigCompositeUtils::LinkInfo< CONTAINER > > features(const Trig::ChainGroup *group, const unsigned int condition=TrigDefs::Physics, const std::string &containerSGKey="", const unsigned int featureCollectionMode=TrigDefs::lastFeatureOfType, const std::string &navElementLinkKey=TrigCompositeUtils::featureString(), const int restrictToLegIndex=-1) const
Runs 3+.