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="", 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. 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 32 of file TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h.

Constructor & Destructor Documentation

◆ FeatureRequestDescriptor() [1/3]

Trig::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.

See below for individual property descriptions.

Parameters
[in]chainGroupNameChain or Chain Group, supplied by name. Regex supported with TrigDecisionTool. Only one exact individual chain name is supported in TrigDecisionToolLite.

Definition at line 10 of file FeatureRequestDescriptor.cxx.

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

◆ ~FeatureRequestDescriptor()

Trig::FeatureRequestDescriptor::~FeatureRequestDescriptor ( )
default

Default destructor.

No heap allocations.

◆ FeatureRequestDescriptor() [2/3]

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

Default move constructor.

◆ FeatureRequestDescriptor() [3/3]

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 115 of file FeatureRequestDescriptor.cxx.

115  {
116  if (m_chainGroupName.empty()) {
117  throw std::runtime_error("FeatureRequestDescriptor::chainGroup() No chain group string was supplied to this FeatureRequestDescriptor.");
118  }
119  return m_chainGroupName;
120  }

◆ condition()

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

Definition at line 123 of file FeatureRequestDescriptor.cxx.

123  {
124  return m_condition;
125  }

◆ featureCollectionMode()

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

Definition at line 133 of file FeatureRequestDescriptor.cxx.

133  {
135  }

◆ 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 138 of file FeatureRequestDescriptor.cxx.

138  {
139  return m_navElementLinkKey;
140  }

◆ 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 34 of file FeatureRequestDescriptor.cxx.

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

◆ reset()

void Trig::FeatureRequestDescriptor::reset ( )

Reset the FeatureRequestDescriptor to its default configuration.

Definition at line 24 of file FeatureRequestDescriptor.cxx.

24  {
25  m_chainGroupName = "";
26  m_condition = TrigDefs::Physics;
27  m_containerSGKey = "";
28  m_featureCollectionMode = TrigDefs::lastFeatureOfType;
31  }

◆ 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 143 of file FeatureRequestDescriptor.cxx.

143  {
144  return m_restrictToLegIndex;
145  }

◆ setChainGroup()

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

Set the desired Chain or Chain Group.

Regex supported with TrigDecisionTool. Only one exact individual chain name is supported in TrigDecisionToolLite.

Returns
reference to self, allows chaining.

Definition at line 73 of file FeatureRequestDescriptor.cxx.

73  {
74  m_chainGroupName = chainGroupName;
75  return *this;
76  }

◆ 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 79 of file FeatureRequestDescriptor.cxx.

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

◆ 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 94 of file FeatureRequestDescriptor.cxx.

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

◆ 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 103 of file FeatureRequestDescriptor.cxx.

103  {
104  m_navElementLinkKey = navElementLinkKey;
105  return *this;
106  }

◆ 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 88 of file FeatureRequestDescriptor.cxx.

88  {
89  m_containerSGKey = containerSGKey;
90  return *this;
91  }

◆ 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 109 of file FeatureRequestDescriptor.cxx.

109  {
110  m_restrictToLegIndex = restrictToLegIndex;
111  return *this;
112  }

◆ 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 128 of file FeatureRequestDescriptor.cxx.

128  {
129  return m_containerSGKey;
130  }

Member Data Documentation

◆ m_chainGroupName

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

◆ m_condition

int Trig::FeatureRequestDescriptor::m_condition
private

◆ m_containerSGKey

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

◆ m_featureCollectionMode

int Trig::FeatureRequestDescriptor::m_featureCollectionMode
private

◆ m_navElementLinkKey

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

◆ m_restrictToLegIndex

int Trig::FeatureRequestDescriptor::m_restrictToLegIndex
private

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:79
Trig::FeatureRequestDescriptor::featureCollectionMode
unsigned int featureCollectionMode() const
Definition: FeatureRequestDescriptor.cxx:133
Trig::FeatureRequestDescriptor::m_chainGroupName
std::string m_chainGroupName
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:164
Trig::FeatureRequestDescriptor::setChainGroup
FeatureRequestDescriptor & setChainGroup(const std::string &chainGroupName)
Set the desired Chain or Chain Group.
Definition: FeatureRequestDescriptor.cxx:73
Trig::FeatureRequestDescriptor::linkName
const std::string & linkName() const
Definition: FeatureRequestDescriptor.cxx:138
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
Trig::FeatureRequestDescriptor::m_featureCollectionMode
int m_featureCollectionMode
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:167
Trig::FeatureRequestDescriptor::condition
unsigned int condition() const
Definition: FeatureRequestDescriptor.cxx:123
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Trig::FeatureRequestDescriptor::m_navElementLinkKey
std::string m_navElementLinkKey
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:168
Trig::FeatureRequestDescriptor::chainGroup
const std::string & chainGroup() const
Definition: FeatureRequestDescriptor.cxx:115
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:109
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:898
Trig::FeatureRequestDescriptor::m_containerSGKey
std::string m_containerSGKey
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:166
Trig::FeatureRequestDescriptor::setRequireSGKey
FeatureRequestDescriptor & setRequireSGKey(const std::string &containerSGKey)
Set the StoreGate key filter.
Definition: FeatureRequestDescriptor.cxx:88
Trig::FeatureRequestDescriptor::setLinkName
FeatureRequestDescriptor & setLinkName(const std::string &navElementLinkKey)
Set the Link Name Key.
Definition: FeatureRequestDescriptor.cxx:103
Trig::FeatureRequestDescriptor::SGKey
const std::string & SGKey() const
Definition: FeatureRequestDescriptor.cxx:128
columnar::empty
bool empty() const noexcept
Definition: ObjectRange.h:163
Trig::FeatureRequestDescriptor::m_condition
int m_condition
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:165
Trig::FeatureRequestDescriptor::restrictRequestToLeg
int restrictRequestToLeg() const
Definition: FeatureRequestDescriptor.cxx:143
Trig::FeatureRequestDescriptor::m_restrictToLegIndex
int m_restrictToLegIndex
Definition: TrigAnalysisHelpers/TrigAnalysisHelpers/FeatureRequestDescriptor.h:169
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:94