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

#include <cTauRoIThresholdsTool.h>

Inheritance diagram for cTauRoIThresholdsTool:
Collaboration diagram for cTauRoIThresholdsTool:

Public Types

using ThrVec
using ThrVecRef
using ExtraInfoRef

Public Member Functions

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

Private Attributes

SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainerm_jTauLinkKey

Detailed Description

Definition at line 12 of file cTauRoIThresholdsTool.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

◆ cTauRoIThresholdsTool()

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

Definition at line 14 of file cTauRoIThresholdsTool.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 cTauRoIThresholdsTool::getPattern ( const EventContext & ctx,
const xAOD::eFexTauRoI & eTau,
const ThrVec & menuThresholds,
const TrigConf::L1ThrExtraInfoBase & menuExtraInfo ) const
overridevirtual

Definition at line 19 of file cTauRoIThresholdsTool.cxx.

22 {
23
24 // Get the jTau matched to the eTau
25 using jTauLink_t = ElementLink<xAOD::jFexTauRoIContainer>;
26 SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, jTauLink_t> jTauLinkAcc{m_jTauLinkKey, ctx};
27 if (not jTauLinkAcc.isPresent()) {
28 ATH_MSG_ERROR("Decoration " << m_jTauLinkKey.key() << " is missing, cannot create cTau threshold pattern");
29 throw SG::ExcNullReadHandle(m_jTauLinkKey.clid(), m_jTauLinkKey.key(), m_jTauLinkKey.storeHandle().name());
30 }
31 jTauLink_t jTauLink = jTauLinkAcc(eTau);
32 bool matched{jTauLink.isValid()};
33
34 if (matched) {
35 const xAOD::jFexTauRoI* jTau = *jTauLink;
36
37 ATH_MSG_DEBUG("eFex tau eta,phi = " << eTau.iEta() << ", " << eTau.iPhi()
38 << ", jFex tau eta,phi = " << jTau->globalEta() << ", " << jTau->globalPhi()
39 << ", eFex et (100 MeV/counts) = " << eTau.etTOB() << ", jFex et (200 MeV/counts) = " << jTau->tobEt() << ", jFex iso (200 MeV/counts) = " << jTau->tobIso()
40 << ", eFex rCore/BDT = " << eTau.tauOneThresholds() << ", eFex rHad = " << eTau.tauTwoThresholds());
41 } else {
42 ATH_MSG_DEBUG("eFex tau eta,phi = " << eTau.iEta() << ", " << eTau.iPhi()
43 << ", eFex et (100 MeV/counts) = " << eTau.etTOB() << ", no matching jTau found"
44 << ", eFex rCore/BDT = " << eTau.tauOneThresholds() << ", eFex rHad = " << eTau.tauTwoThresholds());
45 }
46
47
48 uint64_t thresholdMask{0};
49
50 // Iterate through thresholds and see which ones are passed
51 for (const std::shared_ptr<TrigConf::L1Threshold>& thrBase : menuThresholds) {
52 auto thr = static_cast<TrigConf::L1Threshold_cTAU*>(thrBase.get());
53
54 // Check isolation threshold - unmatched eTau treated as perfectly isolated, ATR-25927
55 // The core and isolation E_T values are multiplied by 2 to normalise to 100 MeV/counts units
56 bool passIso = matched ? TCS::cTauMultiplicity::checkIsolationWP(eTau, **jTauLink, *thr) : true;
57
58 // Check eTAU rCore/BDT and rHad thresholds
59 bool passeTAUWP = TCS::cTauMultiplicity::checkeTAUWP(eTau, *thr);
60
61 // Check et threshold - using iEta coordinate for the eFEX ensures a 0.1 granularity of the eta coordinate,
62 // as expected from the menu method thrValue100MeV
63 bool passEt = eTau.etTOB() > thr->thrValue100MeV(eTau.iEta());
64
65 if (passIso && passeTAUWP && passEt) {
66 thresholdMask |= (1_u64<<thr->mapping());
67 }
68
69 } // loop over thr
70
71 return thresholdMask;
72}
#define ATH_MSG_DEBUG(x)
bool isPresent() const
Is the referenced container present in SG?
static bool checkeTAUWP(const xAOD::eFexTauRoI &eTau, const TrigConf::L1Threshold_cTAU &thr)
static bool checkIsolationWP(const xAOD::eFexTauRoI &eTau, const xAOD::jFexTauRoI &jTau, const TrigConf::L1Threshold_cTAU &thr)
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainer > m_jTauLinkKey
int iPhi() const
Setter for the above.
int iEta() const
setter for the above
unsigned int tauOneThresholds() const
Tau Condition 1 (generic) results.
unsigned int etTOB() const
Cluster ET (TOB ET scale, 100 MeV/count)
unsigned int tauTwoThresholds() const
Tau Condition 2 (generic) results.
uint globalPhi() const
int globalEta() const
uint16_t tobIso() const
uint16_t tobEt() const
jFexTauRoI_v1 jFexTauRoI
Define the latest version of the jFexSRJetRoI class.
Definition jFexTauRoI.h:13

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

StatusCode cTauRoIThresholdsTool::initialize ( )
overridevirtual

Reimplemented from RoIThresholdsTool< T_RoI, T_RoIContainer, ContainerName, ThresholdType >.

Definition at line 13 of file cTauRoIThresholdsTool.cxx.

13 {
15 ATH_CHECK(m_jTauLinkKey.initialize());
16 return StatusCode::SUCCESS;
17}
virtual StatusCode initialize() override

Member Data Documentation

◆ m_jTauLinkKey

SG::ReadDecorHandleKey<xAOD::eFexTauRoIContainer> cTauRoIThresholdsTool::m_jTauLinkKey
private
Initial value:
{
this, "jTauLinkKey", "L1_cTauRoI.jTauLink",
"Decoration for the link from eTau to the matching jTau"}

Definition at line 26 of file cTauRoIThresholdsTool.h.

26 {
27 this, "jTauLinkKey", "L1_cTauRoI.jTauLink",
28 "Decoration for the link from eTau to the matching jTau"};

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