ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trig::FeatureRequestDescriptor Class Reference

#include <FeatureRequestDescriptor.h>

Collaboration diagram for Trig::FeatureRequestDescriptor:

Public Member Functions

 FeatureRequestDescriptor (const std::string &chainGroupName="HLT_.*", 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. More...
 
 FeatureRequestDescriptor (const std::string &chainGroupName)
 Constructor for a specific Chain or Chain Group, supplied by name. More...
 
 ~FeatureRequestDescriptor ()=default
 Default destructor. More...
 
 FeatureRequestDescriptor (FeatureRequestDescriptor &&)=default
 Default move constructor. More...
 
 FeatureRequestDescriptor (const FeatureRequestDescriptor &)=default
 Default copy constructor. More...
 
void reset ()
 Reset the FeatureRequestDescriptor to its default configuration. More...
 
void print (MsgStream &msg, const MSG::Level level=MSG::INFO)
 Print the configuration of the FeatureRequestDescriptor to the supplied message stream. More...
 
FeatureRequestDescriptorsetChainGroup (const std::string &chainGroupName)
 Set the desired Chain or Chain Group. More...
 
FeatureRequestDescriptorsetCondition (const unsigned int condition)
 Set the Condition: TrigDefs::Physics - (default), only returns features from paths through the navigation which accepted the event for at least one of the chains in the ChainGroup. More...
 
FeatureRequestDescriptorsetRequireSGKey (const std::string &containerSGKey)
 Set the StoreGate key filter. More...
 
FeatureRequestDescriptorsetFeatureCollectionMode (const unsigned int featureCollectionMode)
 Set the Feature Collection Mode: TrigDefs::lastFeatureOfType - (default) stop exploring up each path through the navigation as soon as one ElementLink has been collected along the path. More...
 
FeatureRequestDescriptorsetLinkName (const std::string &navElementLinkKey)
 Set the Link Name Key. More...
 
FeatureRequestDescriptorsetRestrictRequestToLeg (const int restrictToLegIndex)
 Set to -1 by default, indicating that all legs of multi-leg chains are searched. More...
 
const std::string & chainGroup () const
 
unsigned int condition () const
 
const std::string & SGKey () const
 
unsigned int featureCollectionMode () const
 
const std::string & linkName () const
 
int restrictRequestToLeg () const
 

Private Attributes

std::string m_chainGroupName
 
int m_condition
 
std::string m_containerSGKey
 
int m_featureCollectionMode
 
std::string m_navElementLinkKey
 
int m_restrictToLegIndex
 

Detailed Description

Definition at line 37 of file FeatureRequestDescriptor.h.

Constructor & Destructor Documentation

◆ FeatureRequestDescriptor() [1/4]

Trig::FeatureRequestDescriptor::FeatureRequestDescriptor ( const std::string &  chainGroupName = "HLT_.*",
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.

See below for individual property descriptions.

Definition at line 10 of file FeatureRequestDescriptor.cxx.

15  {
16  setChainGroup(chainGroupName);
18  setRequireSGKey(containerSGKey);
20  setLinkName(navElementLinkKey);
21  setRestrictRequestToLeg(restrictToLegIndex);
22  }

◆ FeatureRequestDescriptor() [2/4]

Trig::FeatureRequestDescriptor::FeatureRequestDescriptor ( const std::string &  chainGroupName)

Constructor for a specific Chain or Chain Group, supplied by name.

Regex supported.

Definition at line 25 of file FeatureRequestDescriptor.cxx.

25  {
26  reset();
27  setChainGroup(chainGroupName);
28  }

◆ ~FeatureRequestDescriptor()

Trig::FeatureRequestDescriptor::~FeatureRequestDescriptor ( )
default

Default destructor.

No heap allocations.

◆ FeatureRequestDescriptor() [3/4]

Trig::FeatureRequestDescriptor::FeatureRequestDescriptor ( FeatureRequestDescriptor &&  )
default

Default move constructor.

◆ FeatureRequestDescriptor() [4/4]

Trig::FeatureRequestDescriptor::FeatureRequestDescriptor ( const FeatureRequestDescriptor )
default

Default copy constructor.

Member Function Documentation

◆ chainGroup()

const std::string & Trig::FeatureRequestDescriptor::chainGroup ( ) const
Returns
String corresponding to the chain group. Will be mapped to an actual ChainGroup by the TrigDecisionTool.

Definition at line 119 of file FeatureRequestDescriptor.cxx.

119  {
120  return m_chainGroupName;
121  }

◆ condition()

unsigned int Trig::FeatureRequestDescriptor::condition ( ) const
Returns
The Condition, TrigDefs::Physics or TrigDefs::includeFailedDecisions

Definition at line 124 of file FeatureRequestDescriptor.cxx.

124  {
125  return m_condition;
126  }

◆ featureCollectionMode()

unsigned int Trig::FeatureRequestDescriptor::featureCollectionMode ( ) const
Returns
The feature collection mode, TrigDefs::lastFeatureOfType or TrigDefs::allFeatureOfType

Definition at line 134 of file FeatureRequestDescriptor.cxx.

134  {
136  }

◆ linkName()

const std::string & Trig::FeatureRequestDescriptor::linkName ( ) const
Returns
The name of the edges in the navigation graph which will be collected and returned.

Definition at line 139 of file FeatureRequestDescriptor.cxx.

139  {
140  return m_navElementLinkKey;
141  }

◆ print()

void Trig::FeatureRequestDescriptor::print ( MsgStream &  msg,
const MSG::Level  level = MSG::INFO 
)

Print the configuration of the FeatureRequestDescriptor to the supplied message stream.

Definition at line 41 of file FeatureRequestDescriptor.cxx.

41  {
42  msg << level << "Feature Request Descriptor configuration:" << endmsg;
43  msg << level << "-- Chain Group name:'" << chainGroup() << "'." << endmsg;
45  if (condition() == TrigDefs::Physics) {
46  msg << level << "-- Condition: TrigDefs::Physics, only paths which accepted chains in the ChainGroup will be explored." << endmsg;
47  } else if (condition() == TrigDefs::includeFailedDecisions) {
48  msg << level << "-- Condition: TrigDefs::includeFailedDecisions, passed and failed paths for chains in the ChainGroup will be explored." << endmsg;
49  } else {
50  msg << MSG::ERROR << "-- Unknown condition: " << condition() << endmsg;
51  }
53  if (SGKey().empty()) {
54  msg << level << "-- No filtering on Container StoreGate Key" << endmsg;
55  } else {
56  msg << level << "-- Container StoreGate Key: ElementLinks must regex match the container name '" << SGKey() << "'." << endmsg;
57  }
59  if (featureCollectionMode() == TrigDefs::lastFeatureOfType) {
60  msg << level << "-- Feature Collection Mode: TrigDefs::lastFeatureOfType, only one (final) matching ElementLink will be returned on each path through the navigation." << endmsg;
61  } else if (featureCollectionMode() == TrigDefs::allFeaturesOfType) {
62  msg << level << "-- Condition: TrigDefs::includeFailedDecisions, all matching ElementLinks will be returned on each path through the navigation." << endmsg;
63  } else {
64  msg << MSG::ERROR << "-- Unknown feature collection mode: " << featureCollectionMode() << "." << endmsg;
65  }
67  msg << level << "-- Link Name: ElementLinks referenced by graph edges named '" << linkName() << "' will be returned." << endmsg;
69  if (restrictRequestToLeg() == -1) {
70  msg << level << "-- Restrict Request To Leg: ElementLinks will be collected from all legs of any multi-leg chains in the ChainGroup." << endmsg;
71  } else {
72  msg << level << "-- Restrict Request To Leg: ElementLinks will be collected only from leg #" << restrictRequestToLeg() << " of all chains in the ChainGroup." << endmsg;
73  }
74  }

◆ reset()

void Trig::FeatureRequestDescriptor::reset ( )

Reset the FeatureRequestDescriptor to its default configuration.

Definition at line 31 of file FeatureRequestDescriptor.cxx.

31  {
32  m_chainGroupName = "HLT_.*";
33  m_condition = TrigDefs::Physics;
34  m_containerSGKey = "";
35  m_featureCollectionMode = TrigDefs::lastFeatureOfType;
38  }

◆ restrictRequestToLeg()

int Trig::FeatureRequestDescriptor::restrictRequestToLeg ( ) const
Returns
The chain-leg which the request is restricted to follow. -1 indicates no leg-specific filtering.

Definition at line 144 of file FeatureRequestDescriptor.cxx.

144  {
145  return m_restrictToLegIndex;
146  }

◆ setChainGroup()

FeatureRequestDescriptor & Trig::FeatureRequestDescriptor::setChainGroup ( const std::string &  chainGroupName)

Set the desired Chain or Chain Group.

Regex supported.

Returns
reference to self, allows chaining.

Definition at line 77 of file FeatureRequestDescriptor.cxx.

77  {
78  m_chainGroupName = chainGroupName;
79  return *this;
80  }

◆ setCondition()

FeatureRequestDescriptor & Trig::FeatureRequestDescriptor::setCondition ( const unsigned int  condition)

Set the Condition: TrigDefs::Physics - (default), only returns features from paths through the navigation which accepted the event for at least one of the chains in the ChainGroup.

TrigDefs::includeFailedDecisions - follows more paths through the navigation, the paths which were active for at least one of the chains in the ChainGroup, but which failed for all of these chains by some non-final Step.

Returns
reference to self, allows chaining.

Definition at line 83 of file FeatureRequestDescriptor.cxx.

83  {
84  if (condition != TrigDefs::Physics and condition != TrigDefs::includeFailedDecisions) {
85  throw std::runtime_error("Invalid option supplied to FeatureRequestDescriptor::setCondition. Must be Physics or includeFailedDecisions.");
86  }
88  return *this;
89  }

◆ setFeatureCollectionMode()

FeatureRequestDescriptor & Trig::FeatureRequestDescriptor::setFeatureCollectionMode ( const unsigned int  featureCollectionMode)

Set the Feature Collection Mode: TrigDefs::lastFeatureOfType - (default) stop exploring up each path through the navigation as soon as one ElementLink has been collected along the path.

As all paths are explored from their last step backwards, this equates to collecting the "final" feature along each path (after accounting for all other filtering options). TrigDefs::allFeatureOfType - does not stop once an ElementLink is collected when exploring paths through the navigation, instead keeps exploring always back to the L1 node. Potentially returns many features along each path, corresponding to intermediate physics objects as well as the "final" physics object.

Returns
reference to self, allows chaining.

Definition at line 98 of file FeatureRequestDescriptor.cxx.

98  {
99  if (featureCollectionMode != TrigDefs::lastFeatureOfType and featureCollectionMode != TrigDefs::allFeaturesOfType) {
100  throw std::runtime_error("Invalid option supplied to FeatureRequestDescriptor::featureCollectionMode. Must be lastFeatureOfType or allFeaturesOfType.");
101  }
103  return *this;
104  }

◆ setLinkName()

FeatureRequestDescriptor & Trig::FeatureRequestDescriptor::setLinkName ( const std::string &  navElementLinkKey)

Set the Link Name Key.

Sets which named-edges in the navigation graph are returned by the call. By default the TrigDecisionTool looks for edges named "feature", however "roi", "initialRoI" or slice-specific custom-named edges can be alternatively used here.

Returns
reference to self, allows chaining.

Definition at line 107 of file FeatureRequestDescriptor.cxx.

107  {
108  m_navElementLinkKey = navElementLinkKey;
109  return *this;
110  }

◆ setRequireSGKey()

FeatureRequestDescriptor & Trig::FeatureRequestDescriptor::setRequireSGKey ( const std::string &  containerSGKey)

Set the StoreGate key filter.

ElementLinks will have their StoreGate collection key checked against this filter, it must match for the ElementLink to be collected. Regex supported. Set to an empty string (default) to disable the filter.

Returns
reference to self, allows chaining.

Definition at line 92 of file FeatureRequestDescriptor.cxx.

92  {
93  m_containerSGKey = containerSGKey;
94  return *this;
95  }

◆ setRestrictRequestToLeg()

FeatureRequestDescriptor & Trig::FeatureRequestDescriptor::setRestrictRequestToLeg ( const int  restrictToLegIndex)

Set to -1 by default, indicating that all legs of multi-leg chains are searched.

If set to an integer >= 0, the search will be restricted to the single specified leg for all chains in the ChainGroup.

Returns
reference to self, allows chaining.

Definition at line 113 of file FeatureRequestDescriptor.cxx.

113  {
114  m_restrictToLegIndex = restrictToLegIndex;
115  return *this;
116  }

◆ SGKey()

const std::string & Trig::FeatureRequestDescriptor::SGKey ( ) const
Returns
The StoreGate key filter (regex). Or an empty string if no filtering is requested.

Definition at line 129 of file FeatureRequestDescriptor.cxx.

129  {
130  return m_containerSGKey;
131  }

Member Data Documentation

◆ m_chainGroupName

std::string Trig::FeatureRequestDescriptor::m_chainGroupName
private

Definition at line 173 of file FeatureRequestDescriptor.h.

◆ m_condition

int Trig::FeatureRequestDescriptor::m_condition
private

Definition at line 174 of file FeatureRequestDescriptor.h.

◆ m_containerSGKey

std::string Trig::FeatureRequestDescriptor::m_containerSGKey
private

Definition at line 175 of file FeatureRequestDescriptor.h.

◆ m_featureCollectionMode

int Trig::FeatureRequestDescriptor::m_featureCollectionMode
private

Definition at line 176 of file FeatureRequestDescriptor.h.

◆ m_navElementLinkKey

std::string Trig::FeatureRequestDescriptor::m_navElementLinkKey
private

Definition at line 177 of file FeatureRequestDescriptor.h.

◆ m_restrictToLegIndex

int Trig::FeatureRequestDescriptor::m_restrictToLegIndex
private

Definition at line 178 of file FeatureRequestDescriptor.h.


The documentation for this class was generated from the following files:
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:83
Trig::FeatureRequestDescriptor::featureCollectionMode
unsigned int featureCollectionMode() const
Definition: FeatureRequestDescriptor.cxx:134
Trig::FeatureRequestDescriptor::m_chainGroupName
std::string m_chainGroupName
Definition: FeatureRequestDescriptor.h:173
Trig::FeatureRequestDescriptor::setChainGroup
FeatureRequestDescriptor & setChainGroup(const std::string &chainGroupName)
Set the desired Chain or Chain Group.
Definition: FeatureRequestDescriptor.cxx:77
Trig::FeatureRequestDescriptor::linkName
const std::string & linkName() const
Definition: FeatureRequestDescriptor.cxx:139
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
Trig::FeatureRequestDescriptor::m_featureCollectionMode
int m_featureCollectionMode
Definition: FeatureRequestDescriptor.h:176
Trig::FeatureRequestDescriptor::condition
unsigned int condition() const
Definition: FeatureRequestDescriptor.cxx:124
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Trig::FeatureRequestDescriptor::m_navElementLinkKey
std::string m_navElementLinkKey
Definition: FeatureRequestDescriptor.h:177
Trig::FeatureRequestDescriptor::reset
void reset()
Reset the FeatureRequestDescriptor to its default configuration.
Definition: FeatureRequestDescriptor.cxx:31
Trig::FeatureRequestDescriptor::chainGroup
const std::string & chainGroup() const
Definition: FeatureRequestDescriptor.cxx:119
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:113
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
Trig::FeatureRequestDescriptor::m_containerSGKey
std::string m_containerSGKey
Definition: FeatureRequestDescriptor.h:175
Trig::FeatureRequestDescriptor::setRequireSGKey
FeatureRequestDescriptor & setRequireSGKey(const std::string &containerSGKey)
Set the StoreGate key filter.
Definition: FeatureRequestDescriptor.cxx:92
Trig::FeatureRequestDescriptor::setLinkName
FeatureRequestDescriptor & setLinkName(const std::string &navElementLinkKey)
Set the Link Name Key.
Definition: FeatureRequestDescriptor.cxx:107
Trig::FeatureRequestDescriptor::SGKey
const std::string & SGKey() const
Definition: FeatureRequestDescriptor.cxx:129
Trig::FeatureRequestDescriptor::m_condition
int m_condition
Definition: FeatureRequestDescriptor.h:174
Trig::FeatureRequestDescriptor::restrictRequestToLeg
int restrictRequestToLeg() const
Definition: FeatureRequestDescriptor.cxx:144
Trig::FeatureRequestDescriptor::m_restrictToLegIndex
int m_restrictToLegIndex
Definition: FeatureRequestDescriptor.h:178
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:98