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

#include <jFexTauRoIThresholdsTool.h>

Inheritance diagram for jFexTauRoIThresholdsTool:
Collaboration diagram for jFexTauRoIThresholdsTool:

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

 jFexTauRoIThresholdsTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual uint64_t getPattern (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 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
 

Detailed Description

Definition at line 11 of file jFexTauRoIThresholdsTool.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

◆ jFexTauRoIThresholdsTool()

jFexTauRoIThresholdsTool::jFexTauRoIThresholdsTool ( 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 jFexTauRoIThresholdsTool::getPattern ( const xAOD::jFexTauRoI roi,
const ThrVec menuThresholds,
const TrigConf::L1ThrExtraInfoBase menuExtraInfo 
) const
overridevirtual

Definition at line 9 of file jFexTauRoIThresholdsTool.cxx.

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

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

Reimplemented in cTauRoIThresholdsTool.

Definition at line 31 of file IRoIThresholdsTool.h.

31  {
34  return StatusCode::SUCCESS;
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
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
TrigConf::Selection::WP::LOOSE
@ LOOSE
et
Extra patterns decribing particle interation process.
TrigConf::L1ThrExtraInfo::thrExtraInfo
const L1ThrExtraInfoBase & thrExtraInfo(const std::string &thrTypeName) const
Definition: L1ThrExtraInfo.cxx:193
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TrigConf::L1Threshold_jTAU
Definition: L1Threshold.h:234
TrigConf::L1Menu::thrExtraInfo
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition: L1Menu.cxx:307
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.
xAOD::jFexTauRoI_v1::et
unsigned int et() const
Methods that require combining results or applying scales.
Definition: jFexTauRoI_v1.cxx:114
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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:100
calibdata.exception
exception
Definition: calibdata.py:496
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
HLTSeedingRoIToolDefs::jFexTau::ThresholdBaseClass
RoIThresholdsTool< T_RoI, T_RoIContainer, ContainerName, ThresholdType > ThresholdBaseClass
Definition: HLTSeedingRoIToolDefs.h:75
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
python.handimod.extra
int extra
Definition: handimod.py:522
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigConf::L1ThrExtraInfo_jTAU
Definition: L1ThrExtraInfo.h:296
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
TrigConf::Selection::WP::MEDIUM
@ MEDIUM
xAOD::jFexTauRoI_v1::iso
unsigned int iso() const
Iso on TOB scale.
Definition: jFexTauRoI_v1.cxx:120
TrigConf::Selection::WP::TIGHT
@ TIGHT
RoIThresholdsTool::getMenuThresholdExtraInfo
virtual std::optional< ExtraInfoRef > getMenuThresholdExtraInfo(const TrigConf::L1Menu &l1Menu) const
Definition: IRoIThresholdsTool.h:50
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RoIThresholdsTool::m_thresholdPatternsKey
SG::WriteDecorHandleKey< T_RoIContainer > m_thresholdPatternsKey
Definition: IRoIThresholdsTool.h:97