ATLAS Offline Software
Loading...
Searching...
No Matches
StaticPEBInfoWriterTool Class Reference

Tool writing a configurable constant list of ROBs and SubDetectors for use in PEBInfoWriterAlg. More...

#include <StaticPEBInfoWriterTool.h>

Inheritance diagram for StaticPEBInfoWriterTool:
Collaboration diagram for StaticPEBInfoWriterTool:

Public Member Functions

 StaticPEBInfoWriterTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
virtual ~StaticPEBInfoWriterTool ()
 Standard destructor.
virtual StatusCode initialize () override
 Implementation of AthAlgTool::initialize()
StatusCode decide (const EventContext &ctx, std::vector< Input > &inputs) const
 Adds a pass-through decision with attached PEB information created by createPEBInfo for each input.
HLT::Identifier id () const
 Returns the decision id.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static std::string robListKey ()
 Returns the key used to record/retrieve the ROB list.
static std::string subDetListKey ()
 Returns the key used to record/retrieve the SubDet list.

Protected Member Functions

virtual PEBInfoWriterToolBase::PEBInfo createPEBInfo (const EventContext &ctx, const PEBInfoWriterToolBase::Input &input) const override
 Implementation of PEBInfoWriterToolBase::createPEBInfo.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

Gaudi::Property< int > m_maxRoIs
 MaxRoIs property.
Gaudi::Property< std::vector< unsigned int > > m_matchTriggerType

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::vector< uint32_t > > m_robList
 The list of ROBs added to the PEB Info.
Gaudi::Property< std::vector< uint32_t > > m_subDetList
 The list of SubDets added to the PEB Info.
PEBInfoWriterToolBase::PEBInfo m_pebi
 Static PEB Info built at initialize and added in every event.
HLT::Identifier m_decisionId
 The decision id of the tool instance.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Tool writing a configurable constant list of ROBs and SubDetectors for use in PEBInfoWriterAlg.

Definition at line 13 of file StaticPEBInfoWriterTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ StaticPEBInfoWriterTool()

StaticPEBInfoWriterTool::StaticPEBInfoWriterTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard constructor.

Definition at line 9 of file StaticPEBInfoWriterTool.cxx.

10: PEBInfoWriterToolBase(type,name,parent) {}
PEBInfoWriterToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.

◆ ~StaticPEBInfoWriterTool()

StaticPEBInfoWriterTool::~StaticPEBInfoWriterTool ( )
virtual

Standard destructor.

Definition at line 14 of file StaticPEBInfoWriterTool.cxx.

14{}

Member Function Documentation

◆ createPEBInfo()

PEBInfoWriterToolBase::PEBInfo StaticPEBInfoWriterTool::createPEBInfo ( const EventContext & ctx,
const PEBInfoWriterToolBase::Input & input ) const
overrideprotectedvirtual

Implementation of PEBInfoWriterToolBase::createPEBInfo.

Implements PEBInfoWriterToolBase.

Definition at line 27 of file StaticPEBInfoWriterTool.cxx.

27 {
28 ATH_MSG_DEBUG("Returning static PEBInfo configured in initialize()");
29 return m_pebi;
30}
#define ATH_MSG_DEBUG(x)
PEBInfoWriterToolBase::PEBInfo m_pebi
Static PEB Info built at initialize and added in every event.

◆ decide()

StatusCode PEBInfoWriterToolBase::decide ( const EventContext & ctx,
std::vector< Input > & inputs ) const
inherited

Adds a pass-through decision with attached PEB information created by createPEBInfo for each input.

Definition at line 30 of file PEBInfoWriterToolBase.cxx.

30 {
31 std::set<ElementLink<TrigRoiDescriptorCollection>> uniqueRoIs;
32 for (Input& input : inputs) {
33 // Skip if previous step for this chain didn't pass
34 if (not TrigCompositeUtils::passed(m_decisionId.numeric(), input.previousDecisionIDs)) {
35 ATH_MSG_DEBUG("Skipping chain because previous step didn't pass");
36 continue;
37 }
38
39 if (!m_matchTriggerType.empty()) {
40 if (std::none_of(
41 m_matchTriggerType.begin(),
43 [&input](uint8_t test_tt) { return (test_tt & input.tt) == test_tt; }
44 )){
45 continue;
46 }
47 }
48
49 // Count unique RoIs
50 bool isUnique = uniqueRoIs.insert(input.roiEL).second;
51 ATH_MSG_DEBUG("RoI eta/phi = " << (*input.roiEL)->eta() << "/" << (*input.roiEL)->phi() << " has "
52 << (isUnique ? "not yet" : "already") << " been processed. So far seen "
53 << uniqueRoIs.size() << " unique RoIs including this one");
54
55 // Skip processing if max RoIs limit reached
56 bool maxRoIsReached{false};
57 if (m_maxRoIs>=0 && static_cast<int>(uniqueRoIs.size()) > m_maxRoIs) {
58 ATH_MSG_DEBUG("Will attach empty PEB Info to this decision because the number of "
59 << "processed RoIs reached MaxRoIs (" << m_maxRoIs.value() << ")");
60 maxRoIsReached = true;
61 }
62
63 // Create new PEB Info for this input (empty if max RoIs limit is reached)
64 PEBInfo pebInfo = maxRoIsReached ? PEBInfo{} : createPEBInfo(ctx, input);
65
66 // Merge with previous ROBs
67 std::vector<uint32_t> previousRobs;
68 ATH_CHECK(input.decision->getDetail(robListKey(), previousRobs));
69 pebInfo.robs.insert(previousRobs.begin(), previousRobs.end());
70
71 // Merge with previous SubDets
72 std::vector<uint32_t> previousSubDets;
73 ATH_CHECK(input.decision->getDetail(subDetListKey(), previousSubDets));
74 pebInfo.subdets.insert(previousSubDets.begin(), previousSubDets.end());
75
76 // Attach the PEB Info to the decision
77 std::vector<uint32_t> robVec(pebInfo.robs.begin(), pebInfo.robs.end());
78 if (not input.decision->setDetail(robListKey(), robVec)) {
79 ATH_MSG_ERROR("Failed to attach the detail " << robListKey() << " to the decision");
80 return StatusCode::FAILURE;
81 }
82 std::vector<uint32_t> subDetVec(pebInfo.subdets.begin(), pebInfo.subdets.end());
83 if (not input.decision->setDetail(subDetListKey(), subDetVec)) {
84 ATH_MSG_ERROR("Failed to attach the detail " << subDetListKey() << " to the decision");
85 return StatusCode::FAILURE;
86 }
87
88 ATH_MSG_DEBUG("Attached PEB Info with " << robVec.size() << " ROBs and "
89 << subDetVec.size() << " SubDets to the decision object.");
90 ATH_MSG_DEBUG("PEBInfo: " << pebInfo);
91
92 // Make an accept decision
94 }
95 return StatusCode::SUCCESS;
96}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
virtual PEBInfo createPEBInfo(const EventContext &ctx, const Input &input) const =0
Creates the PEBInfo which is attached to the decision in decide. Has to be implemented by the derived...
Gaudi::Property< std::vector< unsigned int > > m_matchTriggerType
HLT::Identifier m_decisionId
The decision id of the tool instance.
static std::string robListKey()
Returns the key used to record/retrieve the ROB list.
static std::string subDetListKey()
Returns the key used to record/retrieve the SubDet list.
Gaudi::Property< int > m_maxRoIs
MaxRoIs property.
bool uniqueRoIs(const std::vector< LinkInfo< xAOD::IParticleContainer > > &links)
Helper function that returns true if no objects share a final RoI.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Input to the tool's decide method.
Structure holding the list of ROBs and SubDets.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ id()

HLT::Identifier PEBInfoWriterToolBase::id ( ) const
inlineinherited

Returns the decision id.

Definition at line 59 of file PEBInfoWriterToolBase.h.

59{return m_decisionId;}

◆ initialize()

StatusCode StaticPEBInfoWriterTool::initialize ( )
overridevirtual

Implementation of AthAlgTool::initialize()

Definition at line 18 of file StaticPEBInfoWriterTool.cxx.

18 {
19 m_pebi.robs.insert(m_robList.begin(), m_robList.end());
20 m_pebi.subdets.insert(m_subDetList.begin(), m_subDetList.end());
21 ATH_MSG_DEBUG("Configured static PEBInfo: " << m_pebi);
22 return StatusCode::SUCCESS;
23}
Gaudi::Property< std::vector< uint32_t > > m_subDetList
The list of SubDets added to the PEB Info.
Gaudi::Property< std::vector< uint32_t > > m_robList
The list of ROBs added to the PEB Info.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ robListKey()

std::string PEBInfoWriterToolBase::robListKey ( )
inlinestaticinherited

Returns the key used to record/retrieve the ROB list.

Definition at line 61 of file PEBInfoWriterToolBase.h.

61{return "PEBROBList";}

◆ subDetListKey()

std::string PEBInfoWriterToolBase::subDetListKey ( )
inlinestaticinherited

Returns the key used to record/retrieve the SubDet list.

Definition at line 63 of file PEBInfoWriterToolBase.h.

63{return "PEBSubDetList";}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_decisionId

HLT::Identifier PEBInfoWriterToolBase::m_decisionId
privateinherited

The decision id of the tool instance.

Definition at line 79 of file PEBInfoWriterToolBase.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_matchTriggerType

Gaudi::Property<std::vector<unsigned int> > PEBInfoWriterToolBase::m_matchTriggerType
protectedinherited
Initial value:
{
this, "MatchTriggerType", {}, "L1 trigger type to match"
}

Definition at line 73 of file PEBInfoWriterToolBase.h.

73 {
74 this, "MatchTriggerType", {}, "L1 trigger type to match"
75 };

◆ m_maxRoIs

Gaudi::Property<int> PEBInfoWriterToolBase::m_maxRoIs
protectedinherited
Initial value:
{
this, "MaxRoIs", -1, "Create PEB list only for the first N RoIs from input decisions (<0 means no limit)"
}

MaxRoIs property.

Definition at line 69 of file PEBInfoWriterToolBase.h.

69 {
70 this, "MaxRoIs", -1, "Create PEB list only for the first N RoIs from input decisions (<0 means no limit)"
71 };

◆ m_pebi

PEBInfoWriterToolBase::PEBInfo StaticPEBInfoWriterTool::m_pebi
private

Static PEB Info built at initialize and added in every event.

Definition at line 38 of file StaticPEBInfoWriterTool.h.

◆ m_robList

Gaudi::Property<std::vector<uint32_t> > StaticPEBInfoWriterTool::m_robList
private
Initial value:
{
this, "ROBList", {},
"The list of ROBs to add for partial event building in each event where the chain passes"
}

The list of ROBs added to the PEB Info.

Definition at line 28 of file StaticPEBInfoWriterTool.h.

28 {
29 this, "ROBList", {},
30 "The list of ROBs to add for partial event building in each event where the chain passes"
31 };

◆ m_subDetList

Gaudi::Property<std::vector<uint32_t> > StaticPEBInfoWriterTool::m_subDetList
private
Initial value:
{
this, "SubDetList", {},
"The list of SubDets to add for partial event building in each event where the chain passes"
}

The list of SubDets added to the PEB Info.

Definition at line 33 of file StaticPEBInfoWriterTool.h.

33 {
34 this, "SubDetList", {},
35 "The list of SubDets to add for partial event building in each event where the chain passes"
36 };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: