ATLAS Offline Software
eEmInputAlgTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "./eEmInputAlgTool.h"
6 #include "L1TopoEvent/eEmTOB.h"
7 
8 #include <sstream>
9 
10 namespace GlobalSim {
11 
13  const std::string& name,
14  const IInterface* parent):
15  base_class(type, name, parent){
16  }
17 
19  CHECK(m_eEmRoIKey.initialize());
21 
22  return StatusCode::SUCCESS;
23  }
24 
25  StatusCode eEmInputAlgTool::run(const EventContext& ctx) const {
27  eEmRoIontainer(m_eEmRoIKey, ctx);
28 
29  CHECK(eEmRoIontainer.isValid());
30 
31  auto eEms = std::make_unique<GlobalSim::eEmTOBArray>("InputeEms", 60);
32  for(const auto eFexRoI : *eEmRoIontainer){
33 
34 
35  /*
36  * eFexNumber() : 8 bit unsigned integer eFEX number
37  * et() : et value of the EM cluster in MeV
38  * etTOB() : et value of the EM cluster in units of 100 MeV
39  * eta() : floating point global eta
40  * phi() : floating point global phi
41  * iEtaTopo() : 40 x eta (custom function for L1Topo)
42  * iPhiTopo() : 20 x phi (custom function for L1Topo)
43  * RetaThresholds() : jet disc 1
44  * RhadThresholds() : jet disc 2
45  * WstotThresholds() : jet disc 3
46  */
47 
48  ATH_MSG_DEBUG( "EDM eFex Number: "
49  << eFexRoI->eFexNumber()
50  << " et: "
51  << eFexRoI->et()
52  << " etTOB: "
53  << eFexRoI->etTOB()
54  << " eta: "
55  << eFexRoI->eta()
56  << " phi: "
57  << eFexRoI->phi()
58  << " iEtaTopo: "
59  << eFexRoI->iEtaTopo()
60  << " iPhiTopo: "
61  << eFexRoI->iPhiTopo()
62  << " reta: "
63  << eFexRoI->RetaThresholds()
64  << " rhad: "
65  << eFexRoI->RhadThresholds()
66  << " wstot: "
67  << eFexRoI->WstotThresholds()
68  );
69 
70 
71  unsigned int EtTopo = eFexRoI->etTOB();
72  int etaTopo = eFexRoI->iEtaTopo();
73  int phiTopo = eFexRoI->iPhiTopo();
74  unsigned int reta = eFexRoI->RetaThresholds();
75  unsigned int rhad = eFexRoI->RhadThresholds();
76  unsigned int wstot = eFexRoI->WstotThresholds();
77 
78  //Em TOB
79  TCS::eEmTOB eem(EtTopo, etaTopo, static_cast<unsigned int>(phiTopo), TCS::EEM , static_cast<long int>(eFexRoI->word0()));
80  eem.setEtDouble(static_cast<double>(EtTopo * s_EtDouble_conversion));
81  eem.setEtaDouble(static_cast<double>(etaTopo * s_etaDouble_conversion));
82  eem.setPhiDouble(static_cast<double>(phiTopo * s_phiDouble_conversion));
83  eem.setReta(reta);
84  eem.setRhad(rhad);
85  eem.setWstot(wstot);
86 
87  eEms->push_back(eem);
88  }
89 
91  ctx);
92  CHECK(h_write.record(std::move(eEms)));
93 
94  return StatusCode::SUCCESS;
95  }
96 
97  std::string eEmInputAlgTool::toString() const {
98  std::stringstream ss;
99  ss << "eEmInputAlgTool: name" << name() << '\n'
100  << m_eEmRoIKey << '\n'
101  << m_eEmTOBArrayWriteKey << '\n';
102  return ss.str();
103  }
104 
105 
106 
107 }
108 
GlobalSim::eEmInputAlgTool::eEmInputAlgTool
eEmInputAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: eEmInputAlgTool.cxx:12
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
GlobalSim::eEmInputAlgTool::initialize
StatusCode initialize() override
Definition: eEmInputAlgTool.cxx:18
TCS::eEmTOB::setRhad
void setRhad(unsigned int th)
Definition: eEmTOB.h:55
xAOD::wstot
setEt setPhi setE277 setWeta2 setEta1 setE2tsts1 wstot
Definition: TrigEMCluster_v1.cxx:49
TCS::eEmTOB::setWstot
void setWstot(unsigned int th)
Definition: eEmTOB.h:56
GlobalSim::eEmInputAlgTool::m_eEmTOBArrayWriteKey
SG::WriteHandleKey< GlobalSim::eEmTOBArray > m_eEmTOBArrayWriteKey
Definition: eEmInputAlgTool.h:48
TCS::eEmTOB::setEtDouble
void setEtDouble(double et)
Definition: eEmTOB.h:50
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
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::eEmTOB
Definition: eEmTOB.h:13
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
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?
TCS::eEmTOB::setReta
void setReta(unsigned int th)
Definition: eEmTOB.h:54
eEmInputAlgTool.h
GlobalSim::eEmInputAlgTool::s_phiDouble_conversion
static constexpr double s_phiDouble_conversion
Definition: eEmInputAlgTool.h:52
eEmTOB.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
GlobalSim::eEmInputAlgTool::run
virtual StatusCode run(const EventContext &ctx) const override
Definition: eEmInputAlgTool.cxx:25
TCS::eEmTOB::setPhiDouble
void setPhiDouble(double phi)
Definition: eEmTOB.h:52
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
TCS::eEmTOB::setEtaDouble
void setEtaDouble(double eta)
Definition: eEmTOB.h:51
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GlobalSim::eEmInputAlgTool::m_eEmRoIKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eEmRoIKey
Definition: eEmInputAlgTool.h:45
GlobalSim::eEmInputAlgTool::toString
virtual std::string toString() const override
Definition: eEmInputAlgTool.cxx:97
GlobalSim::eEmInputAlgTool::s_EtDouble_conversion
static constexpr double s_EtDouble_conversion
Definition: eEmInputAlgTool.h:51
GlobalSim::eEmInputAlgTool::s_etaDouble_conversion
static constexpr double s_etaDouble_conversion
Definition: eEmInputAlgTool.h:53
TCS::EEM
@ EEM
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:21