ATLAS Offline Software
Loading...
Searching...
No Matches
RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType > Class Template Referenceabstract

#include <IRoIThresholdsTool.h>

Inheritance diagram for RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >:
Collaboration diagram for RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >:

Public Types

using ThrVec = std::vector<std::shared_ptr<TrigConf::L1Threshold>>
using ThrVecRef = std::reference_wrapper<const ThrVec>
using ExtraInfoRef = std::reference_wrapper<const TrigConf::L1ThrExtraInfoBase>

Public Member Functions

 RoIThresholdsTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual std::optional< ThrVecRefgetMenuThresholds (const TrigConf::L1Menu &l1Menu) const
virtual std::optional< ExtraInfoRefgetMenuThresholdExtraInfo (const TrigConf::L1Menu &l1Menu) const
virtual StatusCode decorateThresholds (const EventContext &eventContext) const override
virtual uint64_t getPattern (const EventContext &ctx, const T_RoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const =0
 To be implemented by each template instance.

Protected Attributes

SG::ReadHandleKey< TrigConf::L1Menum_l1MenuKey
SG::WriteDecorHandleKey< T_RoIContainer > m_thresholdPatternsKey

Detailed Description

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
class RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >

Definition at line 22 of file IRoIThresholdsTool.h.

Member Typedef Documentation

◆ ExtraInfoRef

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
using RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::ExtraInfoRef = std::reference_wrapper<const TrigConf::L1ThrExtraInfoBase>

Definition at line 26 of file IRoIThresholdsTool.h.

◆ ThrVec

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
using RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::ThrVec = std::vector<std::shared_ptr<TrigConf::L1Threshold>>

Definition at line 24 of file IRoIThresholdsTool.h.

◆ ThrVecRef

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
using RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::ThrVecRef = std::reference_wrapper<const ThrVec>

Definition at line 25 of file IRoIThresholdsTool.h.

Constructor & Destructor Documentation

◆ RoIThresholdsTool()

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::RoIThresholdsTool ( const std::string & type,
const std::string & name,
const IInterface * parent )
inline

Definition at line 28 of file IRoIThresholdsTool.h.

Member Function Documentation

◆ decorateThresholds()

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
virtual StatusCode RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::decorateThresholds ( const EventContext & eventContext) const
inlineoverridevirtual

Definition at line 63 of file IRoIThresholdsTool.h.

63 {
64 // Retrieve the L1 menu configuration
66 ATH_CHECK(l1Menu.isValid());
68 ATH_CHECK(menuThresholds.has_value());
70 ATH_CHECK(menuExtraInfo.has_value());
71
72 // Decorate the RoI objects with threshold patterns
74 for (const T_RoI* roi: *thresholdPatterns) {
75 try {
76 thresholdPatterns(*roi) = getPattern(eventContext, *roi, menuThresholds.value().get(), menuExtraInfo.value().get());
77 }
78 catch (const std::exception& ex) {
79 ATH_MSG_ERROR("getPattern() for " << N_RoIContainer << " failed with exception: " << ex.what());
81 }
82 }
83
85 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
SG::WriteDecorHandleKey< T_RoIContainer > m_thresholdPatternsKey
virtual std::optional< ThrVecRef > getMenuThresholds(const TrigConf::L1Menu &l1Menu) const
virtual std::optional< ExtraInfoRef > getMenuThresholdExtraInfo(const TrigConf::L1Menu &l1Menu) const
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
virtual uint64_t getPattern(const EventContext &ctx, const T_RoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const =0
To be implemented by each template instance.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ getMenuThresholdExtraInfo()

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
virtual std::optional< ExtraInfoRef > RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::getMenuThresholdExtraInfo ( const TrigConf::L1Menu & l1Menu) const
inlinevirtual

Definition at line 50 of file IRoIThresholdsTool.h.

50 {
51 // Retrieve the thresholds vector from L1 menu configuration
53 try {
54 menuExtraInfo = ExtraInfoRef(l1Menu.thrExtraInfo().thrExtraInfo(N_ThresholdType));
55 }
56 catch (const std::exception& ex) {
57 ATH_MSG_ERROR("Failed to retrieve " << N_ThresholdType << " threshold extra info from L1 menu. Exception:" << ex.what());
58 return {};
59 }
60 return menuExtraInfo;
61 }
std::reference_wrapper< const TrigConf::L1ThrExtraInfoBase > ExtraInfoRef

◆ getMenuThresholds()

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
virtual std::optional< ThrVecRef > RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::getMenuThresholds ( const TrigConf::L1Menu & l1Menu) const
inlinevirtual

Definition at line 37 of file IRoIThresholdsTool.h.

37 {
38 // Retrieve the thresholds vector from L1 menu configuration
40 try {
42 }
43 catch (const std::exception& ex) {
44 ATH_MSG_ERROR("Failed to retrieve " << N_ThresholdType << " thresholds from L1 menu. Exception:" << ex.what());
45 return {};
46 }
47 return menuThresholds;
48 }
std::reference_wrapper< const ThrVec > ThrVecRef

◆ getPattern()

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
virtual uint64_t RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::getPattern ( const EventContext & ctx,
const T_RoI & roi,
const ThrVec & menuThresholds,
const TrigConf::L1ThrExtraInfoBase & menuExtraInfo ) const
pure virtual

To be implemented by each template instance.

◆ initialize()

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
virtual StatusCode RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::initialize ( )
inlineoverridevirtual

Reimplemented in cTauRoIThresholdsTool.

Definition at line 31 of file IRoIThresholdsTool.h.

31 {
32 ATH_CHECK(m_l1MenuKey.initialize());
35 }

Member Data Documentation

◆ m_l1MenuKey

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
SG::ReadHandleKey<TrigConf::L1Menu> RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::m_l1MenuKey
protected
Initial value:
{
this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu",
"Name of the L1Menu object to read configuration from"}

Definition at line 94 of file IRoIThresholdsTool.h.

94 {
95 this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu",
96 "Name of the L1Menu object to read configuration from"};

◆ m_thresholdPatternsKey

template<typename T_RoI, typename T_RoIContainer, const char * N_RoIContainer, const char * N_ThresholdType>
SG::WriteDecorHandleKey<T_RoIContainer> RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::m_thresholdPatternsKey
protected
Initial value:
{
this, "ThresholdPatternsDecorKey", std::string(N_RoIContainer)+".thresholdPatterns",
"Decoration for the threshold patterns"}

Definition at line 98 of file IRoIThresholdsTool.h.

98 {
99 this, "ThresholdPatternsDecorKey", std::string(N_RoIContainer)+".thresholdPatterns",
100 "Decoration for the threshold patterns"};

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