ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | Private Attributes | List of all members
cTauRoIThresholdsTool Class Referenceabstract

#include <cTauRoIThresholdsTool.h>

Inheritance diagram for cTauRoIThresholdsTool:
Collaboration diagram for cTauRoIThresholdsTool:

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

 cTauRoIThresholdsTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual uint64_t getPattern (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 T_RoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const =0
 To be implemented by each template instance. More...
 

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

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>
inherited

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> >
inherited

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

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
inlineoverridevirtualinherited

Definition at line 63 of file IRoIThresholdsTool.h.

63  {
64  // Retrieve the L1 menu configuration
66  ATH_CHECK(l1Menu.isValid());
67  std::optional<ThrVecRef> menuThresholds = getMenuThresholds(*l1Menu);
68  ATH_CHECK(menuThresholds.has_value());
69  std::optional<ExtraInfoRef> menuExtraInfo = getMenuThresholdExtraInfo(*l1Menu);
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(*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());
80  return StatusCode::FAILURE;
81  }
82  }
83 
84  return StatusCode::SUCCESS;
85  }

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

Definition at line 50 of file IRoIThresholdsTool.h.

50  {
51  // Retrieve the thresholds vector from L1 menu configuration
52  std::optional<ExtraInfoRef> menuExtraInfo;
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  }

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

Definition at line 37 of file IRoIThresholdsTool.h.

37  {
38  // Retrieve the thresholds vector from L1 menu configuration
39  std::optional<ThrVecRef> menuThresholds;
40  try {
41  menuThresholds = ThrVecRef(l1Menu.thresholds(N_ThresholdType));
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]

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 T_RoI &  roi,
const ThrVec menuThresholds,
const TrigConf::L1ThrExtraInfoBase menuExtraInfo 
) const
pure virtualinherited

To be implemented by each template instance.

◆ getPattern() [2/2]

uint64_t cTauRoIThresholdsTool::getPattern ( const xAOD::eFexTauRoI eTau,
const ThrVec menuThresholds,
const TrigConf::L1ThrExtraInfoBase menuExtraInfo 
) const
overridevirtual

Definition at line 17 of file cTauRoIThresholdsTool.cxx.

19  {
20 
21  // Get the jTau matched to the eTau
22  using jTauLink_t = ElementLink<xAOD::jFexTauRoIContainer>;
23  SG::ReadDecorHandle<xAOD::eFexTauRoIContainer, jTauLink_t> jTauLinkAcc{m_jTauLinkKey, Gaudi::Hive::currentContext()};
24  if (not jTauLinkAcc.isPresent()) {
25  ATH_MSG_ERROR("Decoration " << m_jTauLinkKey.key() << " is missing, cannot create cTau threshold pattern");
26  throw SG::ExcNullReadHandle(m_jTauLinkKey.clid(), m_jTauLinkKey.key(), m_jTauLinkKey.storeHandle().name());
27  }
28  jTauLink_t jTauLink = jTauLinkAcc(eTau);
29  bool matched{jTauLink.isValid()};
30 
31  if (matched) {
32  const xAOD::jFexTauRoI* jTau = *jTauLink;
33 
34  ATH_MSG_DEBUG("eFex tau eta,phi = " << eTau.iEta() << ", " << eTau.iPhi()
35  << ", jFex tau eta,phi = " << jTau->globalEta() << ", " << jTau->globalPhi()
36  << ", eFex et (100 MeV/counts) = " << eTau.etTOB() << ", jFex et (200 MeV/counts) = " << jTau->tobEt() << ", jFex iso (200 MeV/counts) = " << jTau->tobIso()
37  << ", eFex rCore/BDT = " << eTau.tauOneThresholds() << ", eFex rHad = " << eTau.tauTwoThresholds());
38  } else {
39  ATH_MSG_DEBUG("eFex tau eta,phi = " << eTau.iEta() << ", " << eTau.iPhi()
40  << ", eFex et (100 MeV/counts) = " << eTau.etTOB() << ", no matching jTau found"
41  << ", eFex rCore/BDT = " << eTau.tauOneThresholds() << ", eFex rHad = " << eTau.tauTwoThresholds());
42  }
43 
44 
45  uint64_t thresholdMask{0};
46 
47  // Iterate through thresholds and see which ones are passed
48  for (const std::shared_ptr<TrigConf::L1Threshold>& thrBase : menuThresholds) {
49  std::shared_ptr<TrigConf::L1Threshold_cTAU> thr = std::static_pointer_cast<TrigConf::L1Threshold_cTAU>(thrBase);
50 
51  // Check isolation threshold - unmatched eTau treated as perfectly isolated, ATR-25927
52  // The core and isolation E_T values are multiplied by 2 to normalise to 100 MeV/counts units
53  bool passIso = matched ? TCS::cTauMultiplicity::checkIsolationWP(eTau, **jTauLink, *thr) : true;
54 
55  // Check eTAU rCore/BDT and rHad thresholds
56  bool passeTAUWP = TCS::cTauMultiplicity::checkeTAUWP(eTau, *thr);
57 
58  // Check et threshold - using iEta coordinate for the eFEX ensures a 0.1 granularity of the eta coordinate,
59  // as expected from the menu method thrValue100MeV
60  bool passEt = eTau.etTOB() > thr->thrValue100MeV(eTau.iEta());
61 
62  if (passIso && passeTAUWP && passEt) {
63  thresholdMask |= (1<<thr->mapping());
64  }
65 
66  } // loop over thr
67 
68  return thresholdMask;
69 }

◆ initialize()

StatusCode cTauRoIThresholdsTool::initialize ( )
overridevirtual

Reimplemented from RoIThresholdsTool< T_RoI, T_RoIContainer, N_RoIContainer, N_ThresholdType >.

Definition at line 11 of file cTauRoIThresholdsTool.cxx.

11  {
13  ATH_CHECK(m_jTauLinkKey.initialize());
14  return StatusCode::SUCCESS;
15 }

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 25 of file cTauRoIThresholdsTool.h.

◆ 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
protectedinherited
Initial value:
{
this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu",
"Name of the L1Menu object to read configuration from"}

Definition at line 93 of file IRoIThresholdsTool.h.

◆ 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
protectedinherited
Initial value:
{
this, "ThresholdPatternsDecorKey", std::string(N_RoIContainer)+".thresholdPatterns",
"Decoration for the threshold patterns"}

Definition at line 97 of file IRoIThresholdsTool.h.


The documentation for this class was generated from the following files:
HLTSeedingRoIToolDefs::eFexEM::T_RoI
xAOD::eFexEMRoI T_RoI
Definition: HLTSeedingRoIToolDefs.h:40
xAOD::jFexTauRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexTauRoI_v1.h:22
TrigConf::L1Threshold::mapping
unsigned int mapping() const
Accessor to the mapping number The mapping is unique within a type.
Definition: L1ThresholdBase.h:163
TrigConf::L1ThrExtraInfo::thrExtraInfo
const L1ThrExtraInfoBase & thrExtraInfo(const std::string &thrTypeName) const
Definition: L1ThrExtraInfo.cxx:193
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::eFexTauRoI_v1::tauTwoThresholds
unsigned int tauTwoThresholds() const
Tau Condition 2 (generic) results.
Definition: eFexTauRoI_v1.cxx:205
TrigConf::L1Menu::thrExtraInfo
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition: L1Menu.cxx:307
xAOD::jFexTauRoI_v1::globalPhi
uint globalPhi() const
xAOD::jFexTauRoI_v1::tobIso
uint16_t tobIso() const
xAOD::jFexTauRoI_v1::globalEta
int globalEta() const
RoIThresholdsTool::getPattern
virtual uint64_t getPattern(const T_RoI &roi, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const =0
To be implemented by each template instance.
HLTSeedingRoIToolDefs::cTau::ThresholdBaseClass
RoIThresholdsTool< T_RoI, T_RoIContainer, ContainerName, ThresholdType > ThresholdBaseClass
Definition: HLTSeedingRoIToolDefs.h:85
SG::ExcNullReadHandle
Exception — Deference of read handle failed.
Definition: Control/StoreGate/StoreGate/exceptions.h:184
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TrigConf::L1Threshold_Calo::thrValue100MeV
virtual unsigned int thrValue100MeV(int eta=0) const
as above above but in 100 MeV
Definition: L1ThresholdBase.cxx:284
xAOD::eFexTauRoI_v1::tauOneThresholds
unsigned int tauOneThresholds() const
Tau Condition 1 (generic) results.
Definition: eFexTauRoI_v1.cxx:201
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
xAOD::jFexTauRoI_v1::tobEt
uint16_t tobEt() const
RoIThresholdsTool::m_l1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Definition: IRoIThresholdsTool.h:93
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
calibdata.exception
exception
Definition: calibdata.py:496
TCS::cTauMultiplicity::checkIsolationWP
static bool checkIsolationWP(const xAOD::eFexTauRoI &eTau, const xAOD::jFexTauRoI &jTau, const TrigConf::L1Threshold_cTAU &thr)
Definition: L1Topo/L1TopoAlgorithms/Root/cTauMultiplicity.cxx:271
TrigConf::L1Menu::thresholds
std::vector< std::shared_ptr< TrigConf::L1Threshold > > thresholds() const
Access to list of all L1Thresholds.
Definition: L1Menu.cxx:267
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::eFexTauRoI_v1::iPhi
int iPhi() const
Setter for the above.
Definition: eFexTauRoI_v1.cxx:245
TCS::cTauMultiplicity::checkeTAUWP
static bool checkeTAUWP(const xAOD::eFexTauRoI &eTau, const TrigConf::L1Threshold_cTAU &thr)
Definition: L1Topo/L1TopoAlgorithms/Root/cTauMultiplicity.cxx:278
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
RoIThresholdsTool::initialize
virtual StatusCode initialize() override
Definition: IRoIThresholdsTool.h:31
python.ElectronD3PDObject.matched
matched
Definition: ElectronD3PDObject.py:138
cTauRoIThresholdsTool::m_jTauLinkKey
SG::ReadDecorHandleKey< xAOD::eFexTauRoIContainer > m_jTauLinkKey
Definition: cTauRoIThresholdsTool.h:25
RoIThresholdsTool::getMenuThresholds
virtual std::optional< ThrVecRef > getMenuThresholds(const TrigConf::L1Menu &l1Menu) const
Definition: IRoIThresholdsTool.h:37
RoIThresholdsTool::ExtraInfoRef
std::reference_wrapper< const TrigConf::L1ThrExtraInfoBase > ExtraInfoRef
Definition: IRoIThresholdsTool.h:26
RoIThresholdsTool::ThrVecRef
std::reference_wrapper< const ThrVec > ThrVecRef
Definition: IRoIThresholdsTool.h:25
xAOD::eFexTauRoI_v1::etTOB
unsigned int etTOB() const
Cluster ET (TOB ET scale, 100 MeV/count)
Definition: eFexTauRoI_v1.cxx:155
RoIThresholdsTool::getMenuThresholdExtraInfo
virtual std::optional< ExtraInfoRef > getMenuThresholdExtraInfo(const TrigConf::L1Menu &l1Menu) const
Definition: IRoIThresholdsTool.h:50
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::eFexTauRoI_v1::iEta
int iEta() const
setter for the above
Definition: eFexTauRoI_v1.cxx:261
RoIThresholdsTool::m_thresholdPatternsKey
SG::WriteDecorHandleKey< T_RoIContainer > m_thresholdPatternsKey
Definition: IRoIThresholdsTool.h:97