ATLAS Offline Software
Loading...
Searching...
No Matches
jFexTauRoIThresholdsTool Class Referenceabstract

#include <jFexTauRoIThresholdsTool.h>

Inheritance diagram for jFexTauRoIThresholdsTool:
Collaboration diagram for jFexTauRoIThresholdsTool:

Public Types

using ThrVec
using ThrVecRef
using ExtraInfoRef

Public Member Functions

 jFexTauRoIThresholdsTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual uint64_t getPattern (const EventContext &ctx, const xAOD::jFexTauRoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const override
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

Definition at line 11 of file jFexTauRoIThresholdsTool.h.

Member Typedef Documentation

◆ ExtraInfoRef

using RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::ExtraInfoRef
inherited

Definition at line 26 of file IRoIThresholdsTool.h.

◆ ThrVec

using RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::ThrVec
inherited

Definition at line 24 of file IRoIThresholdsTool.h.

◆ ThrVecRef

using RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::ThrVecRef
inherited

Definition at line 25 of file IRoIThresholdsTool.h.

Constructor & Destructor Documentation

◆ jFexTauRoIThresholdsTool()

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

Definition at line 13 of file jFexTauRoIThresholdsTool.h.

RoIThresholdsTool< T_RoI, T_RoIContainer, ContainerName, ThresholdType > ThresholdBaseClass

Member Function Documentation

◆ decorateThresholds()

virtual StatusCode RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::decorateThresholds ( const EventContext & eventContext) const
inlineoverridevirtualinherited

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)
virtual std::optional< ThrVecRef > getMenuThresholds(const TrigConf::L1Menu &l1Menu) const
virtual std::optional< ExtraInfoRef > getMenuThresholdExtraInfo(const TrigConf::L1Menu &l1Menu) const
virtual uint64_t getPattern(const EventContext &ctx, const T_RoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ getMenuThresholdExtraInfo()

virtual std::optional< ExtraInfoRef > RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::getMenuThresholdExtraInfo ( const TrigConf::L1Menu & l1Menu) const
inlinevirtualinherited

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()

virtual std::optional< ThrVecRef > RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::getMenuThresholds ( const TrigConf::L1Menu & l1Menu) const
inlinevirtualinherited

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 }

◆ getPattern() [1/2]

uint64_t jFexTauRoIThresholdsTool::getPattern ( const EventContext & ctx,
const xAOD::jFexTauRoI & roi,
const ThrVec & menuThresholds,
const TrigConf::L1ThrExtraInfoBase & menuExtraInfo ) const
overridevirtual

Definition at line 11 of file jFexTauRoIThresholdsTool.cxx.

14 {
15
16 // Get RoI properties (once, rather than for every threshold in the menu)
17 unsigned int et = roi.et();
18 unsigned int iso = roi.iso();
19 int ieta = roi.globalEta(); //Note: possible this may need to replaced by: std::abs(TSU::toTopoEta( roi.eta() ))/4;
20 uint64_t thresholdMask = 0;
21
22 // calculate the isolation bit from the thresholds
23 const TrigConf::L1ThrExtraInfo_jTAU& extra = static_cast<const TrigConf::L1ThrExtraInfo_jTAU&>(menuExtraInfo);
24 int loose = extra.isolation(TrigConf::Selection::WP::LOOSE,0).isolation_fw();
25 int medium = extra.isolation(TrigConf::Selection::WP::MEDIUM,0).isolation_fw();
26 int tight = extra.isolation(TrigConf::Selection::WP::TIGHT,0).isolation_fw();
27 unsigned int isobit = 0;
28 if ( iso*1024 < et*loose ) isobit = 1;
29 if ( iso*1024 < et*medium ) isobit = 2;
30 if ( iso*1024 < et*tight ) isobit = 3;
31
32 // Iterate through thresholds and see which ones are passed
33 for (const std::shared_ptr<TrigConf::L1Threshold>& thrBase : menuThresholds) {
34 auto thr = static_cast<TrigConf::L1Threshold_jTAU*>(thrBase.get());
35
36
37 // Checking et and isolation thresholds
38 if (et > thr->thrValueMeV(ieta) && isobit >= static_cast<unsigned int>(thr->isolation()) ) {
39 thresholdMask |= (1_u64<<thr->mapping());
40 }
41
42 ATH_MSG_DEBUG("jFEX Taus HLT seeding for ("<< thr->name() <<"): et=" << et << " > "<<thr->thrValueMeV(ieta) << " and iso="<<iso << " >= "<<static_cast<unsigned int>(thr->isolation()));
43 }
44 return thresholdMask;
45
46}
#define ATH_MSG_DEBUG(x)
float et(const xAOD::jFexSRJetRoI *j)
int globalEta() const
unsigned int iso() const
Iso on TOB scale.
unsigned int et() const
Methods that require combining results or applying scales.

◆ getPattern() [2/2]

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 virtualinherited

To be implemented by each template instance.

◆ initialize()

virtual StatusCode RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::initialize ( )
inlineoverridevirtualinherited

Reimplemented in cTauRoIThresholdsTool.

Definition at line 31 of file IRoIThresholdsTool.h.

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

Member Data Documentation

◆ m_l1MenuKey

SG::ReadHandleKey<TrigConf::L1Menu> RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::m_l1MenuKey
protectedinherited

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

SG::WriteDecorHandleKey<T_RoIContainer> RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >::m_thresholdPatternsKey
protectedinherited

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 files: