ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::eFexInputProvider Class Reference

#include <eFexInputProvider.h>

Inheritance diagram for LVL1::eFexInputProvider:
Collaboration diagram for LVL1::eFexInputProvider:

Public Member Functions

 eFexInputProvider (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~eFexInputProvider ()
virtual StatusCode initialize () override final
virtual StatusCode fillTopoInputEvent (TCS::TopoInputEvent &) const override final

Private Member Functions

void CalculateCoordinates (int32_t roiWord, double &eta, double &phi) const
 calculates eta and phi from roiWord
StatusCode fillEM (TCS::TopoInputEvent &inputEvent) const
StatusCode fillTau (TCS::TopoInputEvent &inputEvent) const

Private Attributes

ToolHandle< GenericMonitoringToolm_monTool {this, "MonTool", "", "Monitoring tool to create online histograms"}
SG::ReadHandleKey< xAOD::eFexEMRoIContainerm_eEM_EDMKey {this, "eFexEMRoIKey", "L1_eEMRoI", "eFEXEM EDM"}
SG::ReadHandleKey< xAOD::eFexTauRoIContainerm_eTau_EDMKey {this, "eFexTauRoIKey", "L1_eTauRoI", "eFEXTau EDM"}

Static Private Attributes

static const double m_EtDouble_conversion = 0.1
static const double m_phiDouble_conversion = 0.05
static const double m_etaDouble_conversion = 0.025

Detailed Description

Definition at line 17 of file eFexInputProvider.h.

Constructor & Destructor Documentation

◆ eFexInputProvider()

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

Definition at line 27 of file eFexInputProvider.cxx.

28 :
29 base_class(type, name, parent)
30{
31 declareInterface<LVL1::IInputTOBConverter>( this );
32}

◆ ~eFexInputProvider()

eFexInputProvider::~eFexInputProvider ( )
virtual

Definition at line 34 of file eFexInputProvider.cxx.

35{}

Member Function Documentation

◆ CalculateCoordinates()

void eFexInputProvider::CalculateCoordinates ( int32_t roiWord,
double & eta,
double & phi ) const
private

calculates eta and phi from roiWord

Definition at line 185 of file eFexInputProvider.cxx.

185 {
186 CPRoIDecoder get;
187 double TwoPI = 2 * M_PI;
188 CoordinateRange coordRange = get.coordinate( roiWord );
189
190 eta = coordRange.eta();
191 phi = coordRange.phi();
192 if( phi > M_PI ) phi -= TwoPI;
193}
#define M_PI
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
double phi() const
return phi
double eta() const
return eta
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

◆ fillEM()

StatusCode eFexInputProvider::fillEM ( TCS::TopoInputEvent & inputEvent) const
private

Definition at line 48 of file eFexInputProvider.cxx.

48 {
49 if (m_eEM_EDMKey.empty()) {
50 ATH_MSG_DEBUG("eFex EM input disabled, skip filling");
51 return StatusCode::SUCCESS;
52 }
53
54 SG::ReadHandle<xAOD::eFexEMRoIContainer> eEM_EDM(m_eEM_EDMKey);
55 ATH_CHECK(eEM_EDM.isValid());
56
57 for(const auto it : * eEM_EDM){
58 const xAOD::eFexEMRoI* eFexRoI = it;
59 ATH_MSG_DEBUG( "EDM eFex Number: "
60 << +eFexRoI->eFexNumber() // returns an 8 bit unsigned integer referring to the eFEX number
61 << " et: "
62 << eFexRoI->et() // returns the et value of the EM cluster in MeV
63 << " etTOB: "
64 << eFexRoI->etTOB() // returns the et value of the EM cluster in units of 100 MeV
65 << " eta: "
66 << eFexRoI->eta() // returns a floating point global eta
67 << " phi: "
68 << eFexRoI->phi() // returns a floating point global phi
69 << " iEtaTopo: "
70 << eFexRoI->iEtaTopo() // returns 40 x eta (custom function for L1Topo)
71 << " iPhiTopo: "
72 << eFexRoI->iPhiTopo() // returns 20 x phi (custom function for L1Topo)
73 << " reta: "
74 << eFexRoI->RetaThresholds() // jet disc 1
75 << " rhad: "
76 << eFexRoI->RhadThresholds() // jet disc 2
77 << " wstot: "
78 << eFexRoI->WstotThresholds() // jet disc 3
79 );
80
81
82 unsigned int EtTopo = eFexRoI->etTOB();
83 int etaTopo = eFexRoI->iEtaTopo();
84 int phiTopo = eFexRoI->iPhiTopo();
85 unsigned int reta = eFexRoI->RetaThresholds();
86 unsigned int rhad = eFexRoI->RhadThresholds();
87 unsigned int wstot = eFexRoI->WstotThresholds();
88
89 //Em TOB
90 TCS::eEmTOB eem( EtTopo, etaTopo, static_cast<unsigned int>(phiTopo), TCS::EEM , static_cast<long int>(eFexRoI->word0()) );
91 eem.setEtDouble( static_cast<double>(EtTopo*m_EtDouble_conversion) );
92 eem.setEtaDouble( static_cast<double>(etaTopo*m_etaDouble_conversion) );
93 eem.setPhiDouble( static_cast<double>(phiTopo*m_phiDouble_conversion) );
94 eem.setReta( reta );
95 eem.setRhad( rhad );
96 eem.setWstot( wstot );
97
98 inputEvent.addeEm( eem );
99
100 auto mon_hEmEt = Monitored::Scalar("eEmTOBEt", eem.EtDouble());
101 auto mon_hEmREta = Monitored::Scalar("eEmTOBREta", eem.Reta());
102 auto mon_hEmRHad = Monitored::Scalar("eEmTOBRHad", eem.Rhad());
103 auto mon_hEmWsTot = Monitored::Scalar("eEmTOBWsTot", eem.Wstot());
104 auto mon_hEmPhi = Monitored::Scalar("eEmTOBPhi", eem.phi());
105 auto mon_hEmEta = Monitored::Scalar("eEmTOBEta", eem.eta());
106 Monitored::Group(m_monTool, mon_hEmEt, mon_hEmREta, mon_hEmRHad, mon_hEmWsTot, mon_hEmPhi, mon_hEmEta);
107
108 }
109
110 return StatusCode::SUCCESS;
111}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
ToolHandle< GenericMonitoringTool > m_monTool
static const double m_etaDouble_conversion
static const double m_EtDouble_conversion
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eEM_EDMKey
static const double m_phiDouble_conversion
StatusCode addeEm(const eEmTOB &eEm)
float et() const
TOB ET (decoded from TOB, stored for convenience)
uint32_t word0() const
The "raw" 32-bit words describing the e/gamma candidate.
float eta() const
setter for the above
unsigned int eFexNumber() const
Methods to decode data from the TOB/RoI and return to the user.
unsigned int RetaThresholds() const
Jet Discriminant 1 (R_eta) results.
unsigned int WstotThresholds() const
Jet Discriminant 3 (W_stot) results.
float phi() const
Seed supercell index within central tower (0 -> 3)
unsigned int RhadThresholds() const
Jet Discriminant 2 (R_had) results.
unsigned int etTOB() const
Cluster ET (TOB ET scale, 100 MeV/count)
int iEtaTopo() const
Getter for integer phi index (0-63)
int iPhiTopo() const
Return phi index in the range used by L1Topo (0->127)
eFexEMRoI_v1 eFexEMRoI
Define the latest version of the eFexEMRoI class.
Definition eFexEMRoI.h:17
setEt setPhi setE277 setWeta2 setEta1 setE2tsts1 wstot

◆ fillTau()

StatusCode eFexInputProvider::fillTau ( TCS::TopoInputEvent & inputEvent) const
private

Definition at line 115 of file eFexInputProvider.cxx.

115 {
116 if (m_eTau_EDMKey.empty()) {
117 ATH_MSG_DEBUG("eFex Tau input disabled, skip filling");
118 return StatusCode::SUCCESS;
119 }
120
121 SG::ReadHandle<xAOD::eFexTauRoIContainer> eTau_EDM(m_eTau_EDMKey);
122 ATH_CHECK(eTau_EDM.isValid());
123
124 for(const auto it : * eTau_EDM){
126 ATH_MSG_DEBUG( "EDM eFex Number: "
127 << +eFexTauRoI->eFexNumber() // returns an 8 bit unsigned integer referring to the eFEX number
128 << " et: "
129 << eFexTauRoI->et() // returns the et value of the Tau cluster in MeV
130 << " etTOB: "
131 << eFexTauRoI->etTOB() // returns the et value of the Tau cluster in units of 100 MeV
132 << " eta: "
133 << eFexTauRoI->eta() // returns a floating point global eta
134 << " phi: "
135 << eFexTauRoI->phi() // returns a floating point global phi
136 << " iEtaTopo: "
137 << eFexTauRoI->iEtaTopo() // returns 40 x eta (custom function for L1Topo)
138 << " iPhiTopo: "
139 << eFexTauRoI->iPhiTopo() // returns 20 x phi (custom function for L1Topo)
140 << " rCore: "
141 << eFexTauRoI->tauOneThresholds() // rCore or BDT working point (eTau algo agnostic accessor)
142 << " rHad: "
143 << eFexTauRoI->tauTwoThresholds() // rHad
144 );
145
146
147 unsigned int EtTopo = eFexTauRoI->etTOB();
148 int etaTopo = eFexTauRoI->iEtaTopo();
149 int phiTopo = eFexTauRoI->iPhiTopo();
150 unsigned int rCore = eFexTauRoI->tauOneThresholds();
151 unsigned int rHad = eFexTauRoI->tauTwoThresholds();
152
153 //Tau TOB
154 TCS::eTauTOB etau( EtTopo, etaTopo, static_cast<unsigned int>(phiTopo), TCS::ETAU );
155 etau.setEtDouble( static_cast<double>(EtTopo*m_EtDouble_conversion) );
156 etau.setEtaDouble( static_cast<double>(etaTopo*m_etaDouble_conversion) );
157 etau.setPhiDouble( static_cast<double>(phiTopo*m_phiDouble_conversion) );
158
159 etau.setRCore( rCore );
160 etau.setRHad( rHad );
161
162 inputEvent.addeTau( etau );
163 inputEvent.addcTau( etau );
164
165 auto mon_hTauEt = Monitored::Scalar("eTauTOBEt", etau.EtDouble());
166 auto mon_hTauRCore = Monitored::Scalar("eTauTOBRCore", etau.rCore());
167 auto mon_hTauRHad = Monitored::Scalar("eTauTOBRHad", etau.rHad());
168 auto mon_hTauPhi = Monitored::Scalar("eTauTOBPhi", etau.phi());
169 auto mon_hTauEta = Monitored::Scalar("eTauTOBEta", etau.eta());
170 Monitored::Group(m_monTool, mon_hTauEt, mon_hTauRCore, mon_hTauRHad, mon_hTauPhi, mon_hTauEta);
171 }
172
173 return StatusCode::SUCCESS;
174}
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eTau_EDMKey
StatusCode addcTau(const eTauTOB &eTau)
StatusCode addeTau(const eTauTOB &eTau)
int iPhiTopo() const
Return phi index in the range used by L1Topo (0->127)
unsigned int eFexNumber() const
eFEX number
float et() const
TOB ET (decoded from TOB, stored for convenience)
float phi() const
Seed supercell index within central tower (0 -> 3)
unsigned int tauOneThresholds() const
Tau Condition 1 (generic) results.
unsigned int etTOB() const
Cluster ET (TOB ET scale, 100 MeV/count)
float eta() const
setter for the above
int iEtaTopo() const
Getter for integer phi index (0-63)
unsigned int tauTwoThresholds() const
Tau Condition 2 (generic) results.
eFexTauRoI_v1 eFexTauRoI
Define the latest version of the eFexTauRoI class.
Definition eFexTauRoI.h:16

◆ fillTopoInputEvent()

StatusCode eFexInputProvider::fillTopoInputEvent ( TCS::TopoInputEvent & inputEvent) const
finaloverridevirtual

Definition at line 177 of file eFexInputProvider.cxx.

177 {
178 ATH_CHECK(fillEM(inputEvent));
179 ATH_CHECK(fillTau(inputEvent));
180 return StatusCode::SUCCESS;
181}
StatusCode fillEM(TCS::TopoInputEvent &inputEvent) const
StatusCode fillTau(TCS::TopoInputEvent &inputEvent) const

◆ initialize()

StatusCode eFexInputProvider::initialize ( )
finaloverridevirtual

Definition at line 38 of file eFexInputProvider.cxx.

38 {
39
42
43 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
44 return StatusCode::SUCCESS;
45}
#define CHECK(...)
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_eEM_EDMKey

SG::ReadHandleKey<xAOD::eFexEMRoIContainer> LVL1::eFexInputProvider::m_eEM_EDMKey {this, "eFexEMRoIKey", "L1_eEMRoI", "eFEXEM EDM"}
private

Definition at line 38 of file eFexInputProvider.h.

38{this, "eFexEMRoIKey", "L1_eEMRoI", "eFEXEM EDM"};

◆ m_etaDouble_conversion

const double eFexInputProvider::m_etaDouble_conversion = 0.025
staticprivate

Definition at line 44 of file eFexInputProvider.h.

◆ m_eTau_EDMKey

SG::ReadHandleKey<xAOD::eFexTauRoIContainer> LVL1::eFexInputProvider::m_eTau_EDMKey {this, "eFexTauRoIKey", "L1_eTauRoI", "eFEXTau EDM"}
private

Definition at line 39 of file eFexInputProvider.h.

39{this, "eFexTauRoIKey", "L1_eTauRoI", "eFEXTau EDM"};

◆ m_EtDouble_conversion

const double eFexInputProvider::m_EtDouble_conversion = 0.1
staticprivate

Definition at line 42 of file eFexInputProvider.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> LVL1::eFexInputProvider::m_monTool {this, "MonTool", "", "Monitoring tool to create online histograms"}
private

Definition at line 36 of file eFexInputProvider.h.

36{this, "MonTool", "", "Monitoring tool to create online histograms"};

◆ m_phiDouble_conversion

const double eFexInputProvider::m_phiDouble_conversion = 0.05
staticprivate

Definition at line 43 of file eFexInputProvider.h.


The documentation for this class was generated from the following files: