ATLAS Offline Software
TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGANALYSISHELPERS_FEATUREREQUESTDESCRIPTOR_H
6 #define TRIGANALYSISHELPERS_FEATUREREQUESTDESCRIPTOR_H
7 
8 /**********************************************************************************
9  * @Package: TrigAnalysisHelpers
10  * @class : FeatureRequestDescriptor
11  *
12  * @brief Helper class to encapsulate all possible configuration options when making a
13  * request for trigger chain features using the TrigDecisionTool's run 3 interface.
14  *
15  ***********************************************************************************/
16 #include <string>
17 #include <sstream>
18 #include <regex>
19 
20 #include "AsgMessaging/MsgStream.h"
23 
24 namespace Trig {
25 
26  class FeatureRequestDescriptor {
27 
28  public:
29 
35  FeatureRequestDescriptor(const std::string& chainGroupName = "",
36  const unsigned int condition = TrigDefs::Physics,
37  const std::string& containerSGKey = "",
38  const unsigned int featureCollectionMode = TrigDefs::lastFeatureOfType,
39  const std::string& navElementLinkKey = TrigCompositeUtils::featureString(),
40  const int restrictToLegIndex = -1);
41 
45  ~FeatureRequestDescriptor() = default;
46 
51 
56 
60  void reset();
61 
65  void print(MsgStream& msg, const MSG::Level level = MSG::INFO);
66 
72  FeatureRequestDescriptor& setChainGroup(const std::string& chainGroupName);
73 
82  FeatureRequestDescriptor& setCondition(const unsigned int condition);
83 
90  FeatureRequestDescriptor& setRequireSGKey(const std::string& containerSGKey);
91 
103 
110  FeatureRequestDescriptor& setLinkName(const std::string& navElementLinkKey);
111 
117  FeatureRequestDescriptor& setRestrictRequestToLeg(const int restrictToLegIndex);
118 
122  const std::string& chainGroup() const;
123 
127  unsigned int condition() const;
128 
132  const std::string& SGKey() const;
133 
137  const std::regex& SGKeyExpression() const;
138 
142  unsigned int featureCollectionMode() const;
143 
147  const std::string& linkName() const;
148 
152  int restrictRequestToLeg() const;
153 
154  private:
155 
156  std::string m_chainGroupName;
157  int m_condition;
158  std::string m_containerSGKey;
161  std::string m_navElementLinkKey;
163 
164  };
165 } // End of namespace
166 
167 #endif // TRIGANALYSISHELPERS_FEATUREREQUESTDESCRIPTOR_H
Trig::FeatureRequestDescriptor::setCondition
FeatureRequestDescriptor & setCondition(const unsigned int condition)
Set the Condition: TrigDefs::Physics - (default), only returns features from paths through the naviga...
Definition: FeatureRequestDescriptor.cxx:80
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtils.h:421
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
Trig::FeatureRequestDescriptor::featureCollectionMode
unsigned int featureCollectionMode() const
Definition: FeatureRequestDescriptor.cxx:140
Trig::FeatureRequestDescriptor::m_chainGroupName
std::string m_chainGroupName
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:170
Trig::FeatureRequestDescriptor::setChainGroup
FeatureRequestDescriptor & setChainGroup(const std::string &chainGroupName)
Set the desired Chain or Chain Group.
Definition: FeatureRequestDescriptor.cxx:74
Trig::FeatureRequestDescriptor::print
void print(MsgStream &msg, const MSG::Level level=MSG::INFO)
Print the configuration of the FeatureRequestDescriptor to the supplied message stream.
Definition: FeatureRequestDescriptor.cxx:35
Trig::FeatureRequestDescriptor::linkName
const std::string & linkName() const
Definition: FeatureRequestDescriptor.cxx:145
Conditions.h
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
Trig::FeatureRequestDescriptor::m_featureCollectionMode
int m_featureCollectionMode
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:174
Trig::FeatureRequestDescriptor::condition
unsigned int condition() const
Definition: FeatureRequestDescriptor.cxx:125
TrigCompositeUtils.h
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
Trig::FeatureRequestDescriptor::SGKeyExpression
const std::regex & SGKeyExpression() const
Definition: FeatureRequestDescriptor.cxx:135
Trig::FeatureRequestDescriptor::m_navElementLinkKey
std::string m_navElementLinkKey
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:175
Trig::FeatureRequestDescriptor::FeatureRequestDescriptor
FeatureRequestDescriptor(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)
Default Constructor supplying all properties except for the chain group.
Definition: FeatureRequestDescriptor.cxx:10
Trig::FeatureRequestDescriptor::reset
void reset()
Reset the FeatureRequestDescriptor to its default configuration.
Definition: FeatureRequestDescriptor.cxx:24
Trig::FeatureRequestDescriptor::chainGroup
const std::string & chainGroup() const
Definition: FeatureRequestDescriptor.cxx:117
Trig::FeatureRequestDescriptor::setRestrictRequestToLeg
FeatureRequestDescriptor & setRestrictRequestToLeg(const int restrictToLegIndex)
Set to -1 by default, indicating that all legs of multi-leg chains are searched.
Definition: FeatureRequestDescriptor.cxx:111
Trig::FeatureRequestDescriptor::m_containerSGKey
std::string m_containerSGKey
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:172
Trig::FeatureRequestDescriptor::setRequireSGKey
FeatureRequestDescriptor & setRequireSGKey(const std::string &containerSGKey)
Set the StoreGate key filter.
Definition: FeatureRequestDescriptor.cxx:89
Trig::FeatureRequestDescriptor::m_containerSGKeyExpression
std::regex m_containerSGKeyExpression
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:173
Trig::FeatureRequestDescriptor::setLinkName
FeatureRequestDescriptor & setLinkName(const std::string &navElementLinkKey)
Set the Link Name Key.
Definition: FeatureRequestDescriptor.cxx:105
Trig::FeatureRequestDescriptor::SGKey
const std::string & SGKey() const
Definition: FeatureRequestDescriptor.cxx:130
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
Trig::FeatureRequestDescriptor::~FeatureRequestDescriptor
~FeatureRequestDescriptor()=default
Default destructor.
Trig::FeatureRequestDescriptor::m_condition
int m_condition
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:171
Trig::FeatureRequestDescriptor::restrictRequestToLeg
int restrictRequestToLeg() const
Definition: FeatureRequestDescriptor.cxx:150
Trig::FeatureRequestDescriptor::m_restrictToLegIndex
int m_restrictToLegIndex
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:176
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trig::FeatureRequestDescriptor::setFeatureCollectionMode
FeatureRequestDescriptor & setFeatureCollectionMode(const unsigned int featureCollectionMode)
Set the Feature Collection Mode: TrigDefs::lastFeatureOfType - (default) stop exploring up each path ...
Definition: FeatureRequestDescriptor.cxx:96
MsgStream.h