ATLAS Offline Software
Loading...
Searching...
No Matches
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.
 ~FeatureRequestDescriptor ()=default
 Default destructor.
 FeatureRequestDescriptor (FeatureRequestDescriptor &&)=default
 Default move constructor.
 FeatureRequestDescriptor (const FeatureRequestDescriptor &)=default
 Default copy constructor.
void reset ()
 Reset the FeatureRequestDescriptor to its default configuration.
void print (MsgStream &msg, const MSG::Level level=MSG::INFO)
 Print the configuration of the FeatureRequestDescriptor to the supplied message stream.
FeatureRequestDescriptorsetChainGroup (const std::string &chainGroupName)
 Set the desired Chain or Chain Group.
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.
FeatureRequestDescriptorsetRequireSGKey (const std::string &containerSGKey)
 Set the StoreGate key filter.
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.
FeatureRequestDescriptorsetLinkName (const std::string &navElementLinkKey)
 Set the Link Name Key.
FeatureRequestDescriptorsetRestrictRequestToLeg (const int restrictToLegIndex)
 Set to -1 by default, indicating that all legs of multi-leg chains are searched.
const std::string & chainGroup () const
unsigned int condition () const
const std::string & SGKey () const
const std::regex & SGKeyExpression () 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
std::regex m_containerSGKeyExpression
int m_featureCollectionMode
std::string m_navElementLinkKey
int m_restrictToLegIndex

Detailed Description

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 for chainGroupName 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 & setCondition(const unsigned int condition)
Set the Condition: TrigDefs::Physics - (default), only returns features from paths through the naviga...
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.
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.

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

117 {
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 }

◆ condition()

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

◆ featureCollectionMode()

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

Definition at line 140 of file FeatureRequestDescriptor.cxx.

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

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

35 {
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 }
#define endmsg
static const Attributes_t empty
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)
MsgStream & msg
Definition testRead.cxx:32

◆ reset()

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

150 {
152 }

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

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

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

80 {
82 throw std::runtime_error("Invalid option supplied to FeatureRequestDescriptor::setCondition. Must be Physics or includeFailedDecisions.");
83 }
85 return *this;
86 }

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

96 {
98 throw std::runtime_error("Invalid option supplied to FeatureRequestDescriptor::featureCollectionMode. Must be lastFeatureOfType or allFeaturesOfType.");
99 }
101 return *this;
102 }

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

105 {
106 m_navElementLinkKey = navElementLinkKey;
107 return *this;
108 }

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

89 {
90 m_containerSGKey = containerSGKey;
91 m_containerSGKeyExpression = std::regex(containerSGKey);
92 return *this;
93 }

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

111 {
112 m_restrictToLegIndex = restrictToLegIndex;
113 return *this;
114 }

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

130 {
131 return m_containerSGKey;
132 }

◆ SGKeyExpression()

const std::regex & Trig::FeatureRequestDescriptor::SGKeyExpression ( ) const
Returns
The regex compiled StoreGate key filter.

Definition at line 135 of file FeatureRequestDescriptor.cxx.

135 {
137 }

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_containerSGKeyExpression

std::regex Trig::FeatureRequestDescriptor::m_containerSGKeyExpression
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: