ATLAS Offline Software
Loading...
Searching...
No Matches
FeatureRequestDescriptor.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace Trig {
8
9
10 FeatureRequestDescriptor::FeatureRequestDescriptor(const std::string& chainGroupName,
11 const unsigned int condition,
12 const std::string& containerSGKey,
13 const unsigned int featureCollectionMode,
14 const std::string& navElementLinkKey,
15 const int restrictToLegIndex) {
16 setChainGroup(chainGroupName);
18 setRequireSGKey(containerSGKey);
20 setLinkName(navElementLinkKey);
21 setRestrictRequestToLeg(restrictToLegIndex);
22 }
23
33
34
35 void FeatureRequestDescriptor::print(MsgStream& msg, const MSG::Level level) {
36 msg << level << "Feature Request Descriptor configuration:" << endmsg;
37 msg << level << "-- Chain Group name:'" << chainGroup() << "'." << endmsg;
38 if (chainGroup().empty()) {
39 msg << MSG::ERROR << "Empty chain group name " << endmsg;
40 }
43 msg << level << "-- Condition: TrigDefs::Physics, only paths which accepted chains in the ChainGroup will be explored." << endmsg;
45 msg << level << "-- Condition: TrigDefs::includeFailedDecisions, passed and failed paths for chains in the ChainGroup will be explored." << endmsg;
46 } else {
47 msg << MSG::ERROR << "-- Unknown condition: " << condition() << endmsg;
48 }
50 if (SGKey().empty()) {
51 msg << level << "-- No filtering on Container StoreGate Key" << endmsg;
52 } else {
53 msg << level << "-- Container StoreGate Key: ElementLinks must regex match the container name '" << SGKey() << "'." << endmsg;
54 }
57 msg << level << "-- Feature Collection Mode: TrigDefs::lastFeatureOfType, only one (final) matching ElementLink will be returned on each path through the navigation." << endmsg;
59 msg << level << "-- Condition: TrigDefs::includeFailedDecisions, all matching ElementLinks will be returned on each path through the navigation." << endmsg;
60 } else {
61 msg << MSG::ERROR << "-- Unknown feature collection mode: " << featureCollectionMode() << "." << endmsg;
62 }
64 msg << level << "-- Link Name: ElementLinks referenced by graph edges named '" << linkName() << "' will be returned." << endmsg;
66 if (restrictRequestToLeg() == -1) {
67 msg << level << "-- Restrict Request To Leg: ElementLinks will be collected from all legs of any multi-leg chains in the ChainGroup." << endmsg;
68 } else {
69 msg << level << "-- Restrict Request To Leg: ElementLinks will be collected only from leg #" << restrictRequestToLeg() << " of all chains in the ChainGroup." << endmsg;
70 }
71 }
72
73
75 m_chainGroupName = chainGroupName;
76 return *this;
77 }
78
79
82 throw std::runtime_error("Invalid option supplied to FeatureRequestDescriptor::setCondition. Must be Physics or includeFailedDecisions.");
83 }
85 return *this;
86 }
87
88
90 m_containerSGKey = containerSGKey;
91 m_containerSGKeyExpression = std::regex(containerSGKey);
92 return *this;
93 }
94
95
98 throw std::runtime_error("Invalid option supplied to FeatureRequestDescriptor::featureCollectionMode. Must be lastFeatureOfType or allFeaturesOfType.");
99 }
101 return *this;
102 }
103
104
106 m_navElementLinkKey = navElementLinkKey;
107 return *this;
108 }
109
110
112 m_restrictToLegIndex = restrictToLegIndex;
113 return *this;
114 }
115
116
117 const std::string& FeatureRequestDescriptor::chainGroup() const {
118 if (m_chainGroupName.empty()) {
119 throw std::runtime_error("FeatureRequestDescriptor::chainGroup() No chain group string was supplied to this FeatureRequestDescriptor.");
120 }
121 return m_chainGroupName;
122 }
123
124
126 return m_condition;
127 }
128
129
130 const std::string& FeatureRequestDescriptor::SGKey() const {
131 return m_containerSGKey;
132 }
133
134
137 }
138
139
143
144
145 const std::string& FeatureRequestDescriptor::linkName() const {
146 return m_navElementLinkKey;
147 }
148
149
153
154
155}
#define endmsg
static const Attributes_t empty
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.
FeatureRequestDescriptor & setCondition(const unsigned int condition)
Set the Condition: TrigDefs::Physics - (default), only returns features from paths through the naviga...
void reset()
Reset the FeatureRequestDescriptor to its default configuration.
FeatureRequestDescriptor & setLinkName(const std::string &navElementLinkKey)
Set the Link Name Key.
FeatureRequestDescriptor & setFeatureCollectionMode(const unsigned int featureCollectionMode)
Set the Feature Collection Mode: TrigDefs::lastFeatureOfType - (default) stop exploring up each path ...
FeatureRequestDescriptor & setChainGroup(const std::string &chainGroupName)
Set the desired Chain or Chain Group.
const std::regex & SGKeyExpression() const
FeatureRequestDescriptor & setRestrictRequestToLeg(const int restrictToLegIndex)
Set to -1 by default, indicating that all legs of multi-leg chains are searched.
FeatureRequestDescriptor & setRequireSGKey(const std::string &containerSGKey)
Set the StoreGate key filter.
void print(MsgStream &msg, const MSG::Level level=MSG::INFO)
Print the configuration of the FeatureRequestDescriptor to the supplied message stream.
const std::string & featureString()
static const unsigned int includeFailedDecisions
Run3 synonym of alsoDeactivateTEs.
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
static const unsigned int allFeaturesOfType
Run 3 "enum". Return all features along legs (still with type and container checks)
The common trigger namespace for trigger analysis tools.
MsgStream & msg
Definition testRead.cxx:32