ATLAS Offline Software
cTauRoIThresholdsTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
6 #include "StoreGate/exceptions.h"
7 #include "GaudiKernel/ThreadLocalContext.h"
9 
10 
13  ATH_CHECK(m_jTauLinkKey.initialize());
14  return StatusCode::SUCCESS;
15 }
16 
18  const RoIThresholdsTool::ThrVec& menuThresholds,
19  const TrigConf::L1ThrExtraInfoBase& /*menuExtraInfo*/) const {
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 }
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
xAOD::eFexTauRoI_v1::tauTwoThresholds
unsigned int tauTwoThresholds() const
Tau Condition 2 (generic) results.
Definition: eFexTauRoI_v1.cxx:205
xAOD::jFexTauRoI_v1::globalPhi
uint globalPhi() const
xAOD::jFexTauRoI_v1::tobIso
uint16_t tobIso() const
xAOD::jFexTauRoI_v1::globalEta
int globalEta() const
TrigConf::L1ThrExtraInfoBase
L1 extra information for certain threshold types.
Definition: L1ThresholdBase.h:72
SG::ExcNullReadHandle
Exception — Deference of read handle failed.
Definition: Control/StoreGate/StoreGate/exceptions.h:184
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
exceptions.h
Exceptions that can be thrown from StoreGate.
xAOD::jFexTauRoI_v1::tobEt
uint16_t tobEt() const
xAOD::eFexTauRoI_v1
Class describing a LVL1 eFEX tau region of interest.
Definition: eFexTauRoI_v1.h:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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
cTauRoIThresholdsTool::getPattern
virtual uint64_t getPattern(const xAOD::eFexTauRoI &eTau, const ThrVec &menuThresholds, const TrigConf::L1ThrExtraInfoBase &menuExtraInfo) const override
Definition: cTauRoIThresholdsTool.cxx:17
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
cTauMultiplicity.h
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
RoIThresholdsTool::ThrVec
std::vector< std::shared_ptr< TrigConf::L1Threshold > > ThrVec
Definition: IRoIThresholdsTool.h:24
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
xAOD::eFexTauRoI_v1::etTOB
unsigned int etTOB() const
Cluster ET (TOB ET scale, 100 MeV/count)
Definition: eFexTauRoI_v1.cxx:155
cTauRoIThresholdsTool.h
xAOD::eFexTauRoI_v1::iEta
int iEta() const
setter for the above
Definition: eFexTauRoI_v1.cxx:261
cTauRoIThresholdsTool::initialize
virtual StatusCode initialize() override
Definition: cTauRoIThresholdsTool.cxx:11
ReadDecorHandle.h
Handle class for reading a decoration on an object.