ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaPrecisionPhotonCaloIsoHypoTool Class Reference

#include <TrigEgammaPrecisionPhotonCaloIsoHypoTool.h>

Inheritance diagram for TrigEgammaPrecisionPhotonCaloIsoHypoTool:
Collaboration diagram for TrigEgammaPrecisionPhotonCaloIsoHypoTool:

Public Member Functions

 TrigEgammaPrecisionPhotonCaloIsoHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual StatusCode decide (std::vector< ITrigEgammaPrecisionPhotonCaloIsoHypoTool::PhotonInfo > &input) const override
virtual bool decide (const ITrigEgammaPrecisionPhotonCaloIsoHypoTool::PhotonInfo &i) const override

Private Member Functions

int findCutIndex (float eta) const

Private Attributes

HLT::Identifier m_decisionId
Gaudi::Property< std::vector< float > > m_etabin { this, "EtaBins", {} , "Bins of eta" }
 selection variable for PRECISION calo selection:eta bins
Gaudi::Property< int > m_TopoEtConeSize { this, "TopoEtConeSize", -1 , "Calo isolation cone size" }
Gaudi::Property< float > m_RelTopoEtConeCut { this, "RelTopoEtConeCut", 999., "Calo isolation cut in [TopoEtcone20/pt, TopoEtcone30/pt, TopoEtcone40/pt]" }
Gaudi::Property< float > m_CutOffset { this, "Offset", 0., "Calo isolation offset cut in [(Topo)Etcone20/pt, (Topo)Etcone30/pt, (Topo)Etcone40/pt]" }
Gaudi::Property< std::string > m_pidName {this, "PidName", "", "Pid name"}
Gaudi::Property< bool > m_acceptAll {this, "AcceptAll", false, "Force accept the event"}
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
SG::ReadDecorHandleKey< xAOD::EventInfom_avgMuKey { this, "averageInteractionsPerCrossingKey", "EventInfo.averageInteractionsPerCrossing", "Decoration for Average Interaction Per Crossing" }
int m_coneIdx = -1

Static Private Attributes

static const int s_nCones = 3
static constexpr int s_coneSizes [s_nCones] = {20, 30, 40}
static constexpr xAOD::Iso::IsolationType s_ptConeIsoTypes [s_nCones] = {xAOD::Iso::ptcone20, xAOD::Iso::ptcone30, xAOD::Iso::ptcone40}
static constexpr xAOD::Iso::IsolationType s_etConeIsoTypes [s_nCones] = {xAOD::Iso::etcone20, xAOD::Iso::etcone30, xAOD::Iso::etcone40}
static constexpr xAOD::Iso::IsolationType s_topoEtconeIsoTypes [s_nCones] = {xAOD::Iso::topoetcone20, xAOD::Iso::topoetcone30, xAOD::Iso::topoetcone40}

Detailed Description

Definition at line 35 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

Constructor & Destructor Documentation

◆ TrigEgammaPrecisionPhotonCaloIsoHypoTool()

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

Definition at line 30 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

33 : base_class( type, name, parent ),
35}
static HLT::Identifier fromToolName(const std::string &tname)

Member Function Documentation

◆ decide() [1/2]

bool TrigEgammaPrecisionPhotonCaloIsoHypoTool::decide ( const ITrigEgammaPrecisionPhotonCaloIsoHypoTool::PhotonInfo & i) const
overridevirtual

Definition at line 72 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

73{
74 auto mon_ET = Monitored::Scalar( "Et_em", -1.0 );
75 auto mon_etaBin = Monitored::Scalar( "EtaBin", -1.0 );
76 auto mon_Eta = Monitored::Scalar( "Eta", -99. );
77 auto mon_Phi = Monitored::Scalar( "Phi", -99. );
78 auto mon_mu = Monitored::Scalar("mu", -1.);
79 auto mon_etcone20 = Monitored::Scalar("etcone20", -99.);
80 auto mon_topoetcone20 = Monitored::Scalar("topoetcone20", -99.);
81 auto mon_relEtCone20 = Monitored::Scalar("relEtCone20", -99.);
82 auto mon_relTopoEtCone20 = Monitored::Scalar("relTopoEtCone20", -99.);
83
84 auto mon_etcone30 = Monitored::Scalar("etcone30", -99.);
85 auto mon_topoetcone30 = Monitored::Scalar("topoetcone30", -99.);
86 auto mon_relEtCone30 = Monitored::Scalar("relEtCone30", -99.);
87 auto mon_relTopoEtCone30 = Monitored::Scalar("relTopoEtCone30", -99.);
88
89 auto mon_etcone40 = Monitored::Scalar("etcone40", -99.);
90 auto mon_topoetcone40 = Monitored::Scalar("topoetcone40", -99.);
91 auto mon_relEtCone40 = Monitored::Scalar("relEtCone40", -99.);
92 auto mon_relTopoEtCone40 = Monitored::Scalar("relTopoEtCone40", -99.);
93
94 auto PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 );
95 auto monitorIt = Monitored::Group( m_monTool,
96 mon_etaBin, mon_Eta, mon_Phi, mon_mu,
97 mon_etcone20, mon_topoetcone20, mon_relEtCone20, mon_relTopoEtCone20,
98 mon_etcone30, mon_topoetcone30, mon_relEtCone30, mon_relTopoEtCone30,
99 mon_etcone40, mon_topoetcone40, mon_relEtCone40, mon_relTopoEtCone40,
100 PassedCuts );
101
102 // when leaving scope it will ship data to monTool
103 PassedCuts = PassedCuts + 1; //got called (data in place)
104
105 auto roiDescriptor = input.roi;
106
107 if ( fabs( roiDescriptor->eta() ) > 2.6 ) {
108 ATH_MSG_DEBUG( "REJECT The photon had eta coordinates beyond the EM fiducial volume : "
109 << roiDescriptor->eta() << "; stop the chain now" );
110 return false; // special case
111 }
112
113 ATH_MSG_DEBUG( "; RoI ID = " << roiDescriptor->roiId()
114 << ": Eta = " << roiDescriptor->eta()
115 << ", Phi = " << roiDescriptor->phi() );
116
117
118 const auto pClus = input.photon->caloCluster();
119
120 const float absEta = fabs( pClus->eta() );
121 const int cutIndex = findCutIndex( absEta );
122
123 // eta range
124 if ( !m_acceptAll && cutIndex == -1 ) { // VD
125 ATH_MSG_DEBUG( "Photon : " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] );
126 return false;
127 } else {
128 ATH_MSG_DEBUG( "eta bin used for cuts " << cutIndex << " AcceptAll = " << m_acceptAll );
129 }
130 mon_etaBin = m_etabin[cutIndex];
131 PassedCuts = PassedCuts + 1; // passed eta cut
132
133 const float photon_eT = pClus->et();
134 mon_ET = photon_eT;
135
136 // get average luminosity information to calculate LH
137 float avg_mu = 0;
138 SG::ReadDecorHandle<xAOD::EventInfo,float> eventInfoDecor(m_avgMuKey);
139 if(eventInfoDecor.isPresent()) {
140 avg_mu = eventInfoDecor(0);
141 ATH_MSG_DEBUG("Average mu " << avg_mu);
142 }
143 mon_mu = avg_mu;
144
145 float ptCone[s_nCones] = {999, 999, 999};
146 float etCone[s_nCones] = {999, 999, 999};
147 float topoEtCone[s_nCones] = {999, 999, 999};
148
149 float relEtCone[s_nCones] = {999, 999, 999};
150 float relTopoEtCone[s_nCones] = {999, 999, 999};
151
152 for (int idx = 0; idx < s_nCones; ++idx) {
153 input.photon->isolationValue(ptCone[idx], s_ptConeIsoTypes[idx]);
154 input.photon->isolationValue(etCone[idx], s_etConeIsoTypes[idx]);
155 input.photon->isolationValue(topoEtCone[idx], s_topoEtconeIsoTypes[idx]);
156
157 ATH_MSG_DEBUG( " ptCone" << s_coneSizes[idx] << " = " << ptCone[idx] );
158 ATH_MSG_DEBUG( " etCone" << s_coneSizes[idx] << " = " << etCone[idx] );
159 ATH_MSG_DEBUG( " topoEtCone" << s_coneSizes[idx] << " = " << topoEtCone[idx] );
160 }
161
162 // Calculate relative isolations and assign monitoring variables
163 for (int idx = 0; idx < s_nCones; ++idx) {
164 relEtCone[idx] = etCone[idx] / photon_eT;
165 relTopoEtCone[idx] = topoEtCone[idx] / photon_eT;
166
167 ATH_MSG_DEBUG("relEtCone" << s_coneSizes[idx] << " = " << relEtCone[idx]);
168 ATH_MSG_DEBUG("relTopoEtCone" << s_coneSizes[idx] << " = " << relTopoEtCone[idx]);
169 }
170
171 // Fill monitoring variables (per-cone names preserved for downstream monitoring)
172 mon_etcone20 = etCone[0];
173 mon_topoetcone20 = topoEtCone[0];
174 mon_relEtCone20 = relEtCone[0];
175 mon_relTopoEtCone20 = relTopoEtCone[0];
176
177 mon_etcone30 = etCone[1];
178 mon_topoetcone30 = topoEtCone[1];
179 mon_relEtCone30 = relEtCone[1];
180 mon_relTopoEtCone30 = relTopoEtCone[1];
181
182 mon_etcone40 = etCone[2];
183 mon_topoetcone40 = topoEtCone[2];
184 mon_relEtCone40 = relEtCone[2];
185 mon_relTopoEtCone40 = relTopoEtCone[2];
186
187 if ( m_acceptAll ) {
188 return true;
189 }
190
191 const bool pass_relTopoEtCone = ( m_RelTopoEtConeCut > 900 || ( relTopoEtCone[m_coneIdx] - m_CutOffset/photon_eT < m_RelTopoEtConeCut ));
193 "pass_relTopoEtCone for cone size " << m_TopoEtConeSize << " (m_coneIdx = " << m_coneIdx << ") = "
194 << relTopoEtCone[m_coneIdx] << " - " << m_CutOffset << '/' << photon_eT << " < "
195 << m_RelTopoEtConeCut << " = " << pass_relTopoEtCone
196 );
197
198 return pass_relTopoEtCone;
199
200}
#define ATH_MSG_DEBUG(x)
Gaudi::Property< std::vector< float > > m_etabin
selection variable for PRECISION calo selection:eta bins
static constexpr xAOD::Iso::IsolationType s_topoEtconeIsoTypes[s_nCones]
static constexpr xAOD::Iso::IsolationType s_ptConeIsoTypes[s_nCones]
static constexpr xAOD::Iso::IsolationType s_etConeIsoTypes[s_nCones]
bool absEta(const xAOD::TauJet &tau, float &out)

◆ decide() [2/2]

virtual StatusCode TrigEgammaPrecisionPhotonCaloIsoHypoTool::decide ( std::vector< ITrigEgammaPrecisionPhotonCaloIsoHypoTool::PhotonInfo > & input) const
overridevirtual

◆ findCutIndex()

int TrigEgammaPrecisionPhotonCaloIsoHypoTool::findCutIndex ( float eta) const
private

Definition at line 202 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

202 {
203 const float absEta = std::abs(eta);
204
205 auto binIterator = std::adjacent_find( m_etabin.begin(), m_etabin.end(), [=](float left, float right){ return left < absEta and absEta < right; } );
206 if ( binIterator == m_etabin.end() ) {
207 return -1;
208 }
209 return binIterator - m_etabin.begin();
210}
Scalar eta() const
pseudorapidity method

◆ initialize()

StatusCode TrigEgammaPrecisionPhotonCaloIsoHypoTool::initialize ( )
overridevirtual

Definition at line 38 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

39{
40 ATH_MSG_DEBUG( "Initialization completed successfully" );
41 ATH_MSG_DEBUG( "EtaBins = " << m_etabin );
42
43 if ( m_etabin.empty() ) {
44 ATH_MSG_ERROR( " There are no cuts set (EtaBins property is an empty list)" );
45 return StatusCode::FAILURE;
46 }
47
48 for (unsigned idx = 0; idx < s_nCones; ++idx) {
49 if (s_coneSizes[idx] == m_TopoEtConeSize) {
50 m_coneIdx = idx;
51 break;
52 }
53 }
54 if ( m_coneIdx < 0 && !m_acceptAll ) {
55 ATH_MSG_ERROR("Invalid cone size: " << m_TopoEtConeSize);
56 return StatusCode::FAILURE;
57 }
58
59 // Retrieving Luminosity info
60 ATH_MSG_DEBUG( "Retrieving luminosityCondData..." );
61 ATH_CHECK( m_avgMuKey.initialize() );
62
63 ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
64
65 if ( not m_monTool.name().empty() )
66 CHECK( m_monTool.retrieve() );
67
68 return StatusCode::SUCCESS;
69}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define CHECK(...)
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_acceptAll

Gaudi::Property< bool > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_acceptAll {this, "AcceptAll", false, "Force accept the event"}
private

Definition at line 56 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

56{this, "AcceptAll", false, "Force accept the event"};

◆ m_avgMuKey

SG::ReadDecorHandleKey<xAOD::EventInfo> TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_avgMuKey { this, "averageInteractionsPerCrossingKey", "EventInfo.averageInteractionsPerCrossing", "Decoration for Average Interaction Per Crossing" }
private

Definition at line 61 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

61{ this, "averageInteractionsPerCrossingKey", "EventInfo.averageInteractionsPerCrossing", "Decoration for Average Interaction Per Crossing" };

◆ m_coneIdx

int TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_coneIdx = -1
private

Definition at line 66 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

◆ m_CutOffset

Gaudi::Property< float > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_CutOffset { this, "Offset", 0., "Calo isolation offset cut in [(Topo)Etcone20/pt, (Topo)Etcone30/pt, (Topo)Etcone40/pt]" }
private

Definition at line 52 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

52{ this, "Offset", 0., "Calo isolation offset cut in [(Topo)Etcone20/pt, (Topo)Etcone30/pt, (Topo)Etcone40/pt]" };

◆ m_decisionId

HLT::Identifier TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_decisionId
private

Definition at line 46 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

◆ m_etabin

Gaudi::Property< std::vector<float> > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_etabin { this, "EtaBins", {} , "Bins of eta" }
private

selection variable for PRECISION calo selection:eta bins

Definition at line 49 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

49{ this, "EtaBins", {} , "Bins of eta" };

◆ m_monTool

ToolHandle< GenericMonitoringTool > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 58 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

58{ this, "MonTool", "", "Monitoring tool" };

◆ m_pidName

Gaudi::Property< std::string > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_pidName {this, "PidName", "", "Pid name"}
private

Definition at line 53 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

53{this, "PidName", "", "Pid name"};

◆ m_RelTopoEtConeCut

Gaudi::Property< float > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_RelTopoEtConeCut { this, "RelTopoEtConeCut", 999., "Calo isolation cut in [TopoEtcone20/pt, TopoEtcone30/pt, TopoEtcone40/pt]" }
private

Definition at line 51 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

51{ this, "RelTopoEtConeCut", 999., "Calo isolation cut in [TopoEtcone20/pt, TopoEtcone30/pt, TopoEtcone40/pt]" };

◆ m_TopoEtConeSize

Gaudi::Property< int > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_TopoEtConeSize { this, "TopoEtConeSize", -1 , "Calo isolation cone size" }
private

Definition at line 50 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

50{ this, "TopoEtConeSize", -1 , "Calo isolation cone size" };

◆ s_coneSizes

int TrigEgammaPrecisionPhotonCaloIsoHypoTool::s_coneSizes[s_nCones] = {20, 30, 40}
staticconstexprprivate

Definition at line 68 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

68{20, 30, 40};

◆ s_etConeIsoTypes

xAOD::Iso::IsolationType TrigEgammaPrecisionPhotonCaloIsoHypoTool::s_etConeIsoTypes[s_nCones] = {xAOD::Iso::etcone20, xAOD::Iso::etcone30, xAOD::Iso::etcone40}
staticconstexprprivate

◆ s_nCones

const int TrigEgammaPrecisionPhotonCaloIsoHypoTool::s_nCones = 3
staticprivate

Definition at line 67 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

◆ s_ptConeIsoTypes

xAOD::Iso::IsolationType TrigEgammaPrecisionPhotonCaloIsoHypoTool::s_ptConeIsoTypes[s_nCones] = {xAOD::Iso::ptcone20, xAOD::Iso::ptcone30, xAOD::Iso::ptcone40}
staticconstexprprivate

◆ s_topoEtconeIsoTypes

xAOD::Iso::IsolationType TrigEgammaPrecisionPhotonCaloIsoHypoTool::s_topoEtconeIsoTypes[s_nCones] = {xAOD::Iso::topoetcone20, xAOD::Iso::topoetcone30, xAOD::Iso::topoetcone40}
staticconstexprprivate

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