ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 More...
 
Gaudi::Property< std::vector< float > > m_RelEtConeCut { this, "RelEtConeCut", {999., 999., 999.} , "Calo isolation cut on etcone20" }
 
Gaudi::Property< std::vector< float > > m_RelTopoEtConeCut { this, "RelTopoEtConeCut", {999., 999., 999.}, "Calo isolation cut in [TopoEtcone20/pt, TopoEtcone30/pt, TopoEtcone40/pt]" }
 
Gaudi::Property< std::vector< float > > m_CutOffset { this, "Offset", {0., 0., 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" }
 

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 32 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

35  : base_class( type, name, parent ),
37 }

Member Function Documentation

◆ decide() [1/2]

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

Definition at line 66 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

67 {
68 
69  bool pass = false;
70 
71  auto mon_ET = Monitored::Scalar( "Et_em", -1.0 );
72  auto mon_etaBin = Monitored::Scalar( "EtaBin", -1.0 );
73  auto mon_Eta = Monitored::Scalar( "Eta", -99. );
74  auto mon_Phi = Monitored::Scalar( "Phi", -99. );
75  auto mon_mu = Monitored::Scalar("mu", -1.);
76  auto mon_etcone20 = Monitored::Scalar("etcone20", -99.);
77  auto mon_topoetcone20 = Monitored::Scalar("topoetcone20", -99.);
78  auto mon_reletcone20 = Monitored::Scalar("reletcone20", -99.);
79  auto mon_reltopoetcone20 = Monitored::Scalar("reltopoetcone20", -99.);
80 
81  auto mon_etcone30 = Monitored::Scalar("etcone30", -99.);
82  auto mon_topoetcone30 = Monitored::Scalar("topoetcone30", -99.);
83  auto mon_reletcone30 = Monitored::Scalar("reletcone30", -99.);
84  auto mon_reltopoetcone30 = Monitored::Scalar("reltopoetcone30", -99.);
85 
86  auto mon_etcone40 = Monitored::Scalar("etcone40", -99.);
87  auto mon_topoetcone40 = Monitored::Scalar("topoetcone40", -99.);
88  auto mon_reletcone40 = Monitored::Scalar("reletcone40", -99.);
89  auto mon_reltopoetcone40 = Monitored::Scalar("reltopoetcone40", -99.);
90 
91  auto PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 );
92  auto monitorIt = Monitored::Group( m_monTool,
93  mon_etaBin, mon_Eta, mon_Phi, mon_mu,
94  mon_etcone20, mon_topoetcone20, mon_reletcone20, mon_reltopoetcone20,
95  mon_etcone30, mon_topoetcone30, mon_reletcone30, mon_reltopoetcone30,
96  mon_etcone40, mon_topoetcone40, mon_reletcone40, mon_reltopoetcone40,
97  PassedCuts );
98 
99  // when leaving scope it will ship data to monTool
100  PassedCuts = PassedCuts + 1; //got called (data in place)
101 
102  float ET(0);
103 
104  auto roiDescriptor = input.roi;
105 
106  if ( fabs( roiDescriptor->eta() ) > 2.6 ) {
107  ATH_MSG_DEBUG( "REJECT The photon had eta coordinates beyond the EM fiducial volume : "
108  << roiDescriptor->eta() << "; stop the chain now" );
109  pass=false; // special case
110  return pass;
111  }
112 
113  ATH_MSG_DEBUG( "; RoI ID = " << roiDescriptor->roiId()
114  << ": Eta = " << roiDescriptor->eta()
115  << ", Phi = " << roiDescriptor->phi() );
116 
117 
118  auto pClus = input.photon->caloCluster();
119 
120  float absEta = fabs( pClus->eta() );
121  const int cutIndex = findCutIndex( absEta );
122 
123  ET = pClus->et();
124  // eta = pClus->eta();
125  // phi = pClus->phi();
126 
127  // eta range
128  if ( !m_acceptAll && cutIndex == -1 ) { // VD
129  ATH_MSG_DEBUG( "Photon : " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] );
130  return pass;
131  } else {
132  ATH_MSG_DEBUG( "eta bin used for cuts " << cutIndex << " AcceptAll = " << m_acceptAll );
133  }
134  mon_etaBin = m_etabin[cutIndex];
135  PassedCuts = PassedCuts + 1; // passed eta cut
136 
137  mon_ET = ET;
138 
139  // get average luminosity information to calculate LH
140  float avg_mu = 0;
142  if(eventInfoDecor.isPresent()) {
143  avg_mu = eventInfoDecor(0);
144  ATH_MSG_DEBUG("Average mu " << avg_mu);
145  }
146  mon_mu = avg_mu;
147 
148  float ptcone20(999), ptcone30(999), ptcone40(999),
149  etcone20(999), etcone30(999), etcone40(999),
150  topoetcone20(999), topoetcone30(999), topoetcone40(999),
151  reletcone20(999), reletcone30(999), reletcone40(999),
152  reltopoetcone20(999), reltopoetcone30(999), reltopoetcone40(999);
153 
154 
155  // isolation variables
156  input.photon->isolationValue(ptcone20, xAOD::Iso::ptcone20);
157 
158  input.photon->isolationValue(ptcone30, xAOD::Iso::ptcone30);
159 
160  input.photon->isolationValue(ptcone40, xAOD::Iso::ptcone40);
161 
162  input.photon->isolationValue(etcone20, xAOD::Iso::etcone20);
163 
164  input.photon->isolationValue(etcone30, xAOD::Iso::etcone30);
165 
166  input.photon->isolationValue(etcone40, xAOD::Iso::etcone40);
167 
168  input.photon->isolationValue(topoetcone20, xAOD::Iso::topoetcone20);
169 
170  input.photon->isolationValue(topoetcone30, xAOD::Iso::topoetcone30);
171 
172  input.photon->isolationValue(topoetcone40, xAOD::Iso::topoetcone40);
173 
174  ATH_MSG_DEBUG( " ptcone20 = " << ptcone20 ) ;
175  ATH_MSG_DEBUG( " ptcone30 = " << ptcone30 ) ;
176  ATH_MSG_DEBUG( " ptcone40 = " << ptcone40 ) ;
177  ATH_MSG_DEBUG( " etcone20 = " << etcone20 ) ;
178  ATH_MSG_DEBUG( " etcone30 = " << etcone30 ) ;
179  ATH_MSG_DEBUG( " etcone40 = " << etcone40 ) ;
180  ATH_MSG_DEBUG( " topoetcone20 = " << topoetcone20 ) ;
181  ATH_MSG_DEBUG( " topoetcone30 = " << topoetcone30 ) ;
182  ATH_MSG_DEBUG( " topoetcone40 = " << topoetcone40 ) ;
183 
184  // Monitor showershapes
185  float photon_eT = input.photon->caloCluster()->et();
186  mon_etcone20 = etcone20;
187  reletcone20 = etcone20/photon_eT;
188  ATH_MSG_DEBUG("reletcone20 = " <<reletcone20 );
189  mon_reletcone20 = reletcone20;
190 
191  mon_topoetcone20 = topoetcone20;
192  reltopoetcone20 = topoetcone20/photon_eT;
193  ATH_MSG_DEBUG("reltopoetcone20 = " <<reltopoetcone20 );
194  mon_reltopoetcone20 = reltopoetcone20;
195 
196  mon_etcone30 = etcone30;
197  reletcone30 = etcone30/photon_eT;
198  ATH_MSG_DEBUG("reletcone30 = " <<reletcone30 );
199  mon_reletcone30 = reletcone30;
200 
201  mon_topoetcone30 = topoetcone30;
202  reltopoetcone30 = topoetcone30/photon_eT;
203  ATH_MSG_DEBUG("reltopoetcone30 = " <<reltopoetcone30 );
204  mon_reltopoetcone30 = reltopoetcone30;
205 
206  mon_etcone40 = etcone40;
207  reletcone40 = etcone40/photon_eT;
208  ATH_MSG_DEBUG("reletcone40 = " <<reletcone40 );
209  mon_reletcone40 = reletcone40;
210 
211  mon_topoetcone40 = topoetcone40;
212  reltopoetcone40 = topoetcone40/photon_eT;
213  ATH_MSG_DEBUG("reltopoetcone40 = " <<reltopoetcone40 );
214  mon_reltopoetcone40 = reltopoetcone40;
215 
216  // Place here all etcone variables to apply the cuts within the loop on cone sizes
217  std::vector<float> reltopoetcone;
218  reltopoetcone.push_back(reltopoetcone20);
219  reltopoetcone.push_back(reltopoetcone30);
220  reltopoetcone.push_back(reltopoetcone40);
221 
222  std::vector<float> reletcone;
223  reletcone.push_back(etcone20);
224  reletcone.push_back(etcone30);
225  reletcone.push_back(etcone40);
226 
227 
228  bool pass_reletcone = true; // If cut is not succeeded, this will be "AND"ed with a False result
229  bool pass_reltopoetcone = true;
230 
231  // Loop over three indices 0,1 and 2, each referring to cones 20 30 and 40 and checking whether it passes or not
232  for (unsigned int conesize=0; conesize<3; conesize++){
233  ATH_MSG_DEBUG("m_RelEtConeCut[" << conesize << "] = " << m_RelEtConeCut[conesize] );
234  ATH_MSG_DEBUG("m_RelTopoEtConeCut[" << conesize << "] = " << m_RelTopoEtConeCut[conesize] );
235  ATH_MSG_DEBUG("m_CutOffset[" << conesize << "] = " << m_CutOffset[conesize] );
236 
237  // Check if need to apply isolation
238  // First check logic. if cut is very big, then no isolation cut is defined
239  // Applies to both reletcone[20,30,40] and reltopoetcone[20,30,40]
240  if (m_RelEtConeCut[conesize] > 900){ // I guess we want to deprecate this?
241  ATH_MSG_DEBUG(" not applying etcone[" << conesize << "] isolation.");
242  }
243  if (m_RelTopoEtConeCut[conesize] > 900){ // I guess we want to deprecate this?
244  ATH_MSG_DEBUG(" not applying topoetcone[" << conesize << "] isolation.");
245  }
246  bool pass_this_reletcone = ( m_RelEtConeCut[conesize] > 900 || ( reletcone[conesize] - m_CutOffset[conesize]/photon_eT < m_RelEtConeCut[conesize]));
247  bool pass_this_reltopoetcone = ( m_RelTopoEtConeCut[conesize] > 900 || ( reltopoetcone[conesize] - m_CutOffset[conesize]/photon_eT < m_RelTopoEtConeCut[conesize]));
248 
249  ATH_MSG_DEBUG(" pass_reletcone[" << conesize << "] = " << reletcone[conesize] << " - " << m_CutOffset[conesize] << "/" << photon_eT << " < " << m_RelEtConeCut[conesize] << " = " << pass_reletcone);
250  ATH_MSG_DEBUG(" pass_reltopoetcone[" << conesize << "] = " << reltopoetcone[conesize] << " - " << m_CutOffset[conesize] << "/" << photon_eT << " < " << m_RelEtConeCut[conesize] << " = " << pass_reltopoetcone);
251 
252  pass_reletcone = pass_reletcone && pass_this_reletcone ;
253  pass_reltopoetcone = pass_reltopoetcone && pass_this_reltopoetcone ;
254  }
255  // Reach this point successfully
256  pass = m_acceptAll || (pass_reletcone && pass_reltopoetcone);
257  ATH_MSG_DEBUG( "AcceptAll = " << m_acceptAll );
258  ATH_MSG_DEBUG( "pass_reletcone = " << pass_reletcone );
259  ATH_MSG_DEBUG( "pass_reltopoetcone = " << pass_reltopoetcone );
260  ATH_MSG_DEBUG( "pass = " << pass );
261 
262  return pass;
263 
264 }

◆ 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 266 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

266  {
267  const float absEta = std::abs(eta);
268 
269  auto binIterator = std::adjacent_find( m_etabin.begin(), m_etabin.end(), [=](float left, float right){ return left < absEta and absEta < right; } );
270  if ( binIterator == m_etabin.end() ) {
271  return -1;
272  }
273  return binIterator - m_etabin.begin();
274 }

◆ initialize()

StatusCode TrigEgammaPrecisionPhotonCaloIsoHypoTool::initialize ( )
overridevirtual

Definition at line 40 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx.

41 {
42  ATH_MSG_DEBUG( "Initialization completed successfully" );
43  ATH_MSG_DEBUG( "EtaBins = " << m_etabin );
44 
45  if ( m_etabin.empty() ) {
46  ATH_MSG_ERROR( " There are no cuts set (EtaBins property is an empty list)" );
47  return StatusCode::FAILURE;
48  }
49 
50  // Now we try to retrieve the ElectronPhotonSelectorTools that we will use to apply the photon Identification. This is a *must*
51 
52 
53  // Retrieving Luminosity info
54  ATH_MSG_DEBUG( "Retrieving luminosityCondData..." );
55  ATH_CHECK( m_avgMuKey.initialize() );
56 
57  ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
58 
59  if ( not m_monTool.name().empty() )
60  CHECK( m_monTool.retrieve() );
61 
62  return StatusCode::SUCCESS;
63 }

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.

◆ 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.

◆ m_CutOffset

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

Definition at line 52 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

◆ 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.

◆ m_monTool

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

Definition at line 58 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

◆ m_pidName

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

Definition at line 53 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

◆ m_RelEtConeCut

Gaudi::Property< std::vector<float> > TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_RelEtConeCut { this, "RelEtConeCut", {999., 999., 999.} , "Calo isolation cut on etcone20" }
private

Definition at line 50 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.

◆ m_RelTopoEtConeCut

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

Definition at line 51 of file TrigEgammaPrecisionPhotonCaloIsoHypoTool.h.


The documentation for this class was generated from the following files:
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
xAOD::Iso::topoetcone20
@ topoetcone20
Topo-cluster ET-sum.
Definition: IsolationType.h:48
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:56
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
xAOD::Iso::ptcone30
@ ptcone30
Definition: IsolationType.h:41
xAOD::Iso::ptcone20
@ ptcone20
Track isolation.
Definition: IsolationType.h:40
xAOD::Iso::etcone40
@ etcone40
Definition: IsolationType.h:34
xAOD::Iso::topoetcone30
@ topoetcone30
Definition: IsolationType.h:49
xAOD::Iso::etcone30
@ etcone30
Definition: IsolationType.h:33
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_RelEtConeCut
Gaudi::Property< std::vector< float > > m_RelEtConeCut
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:50
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:46
TrigEgammaPrecisionPhotonCaloIsoHypoTool::findCutIndex
int findCutIndex(float eta) const
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.cxx:266
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_etabin
Gaudi::Property< std::vector< float > > m_etabin
selection variable for PRECISION calo selection:eta bins
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:49
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
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
xAOD::Iso::etcone20
@ etcone20
Calorimeter isolation.
Definition: IsolationType.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_RelTopoEtConeCut
Gaudi::Property< std::vector< float > > m_RelTopoEtConeCut
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:51
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:58
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::Iso::ptcone40
@ ptcone40
Definition: IsolationType.h:42
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_CutOffset
Gaudi::Property< std::vector< float > > m_CutOffset
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:52
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:234
xAOD::Iso::topoetcone40
@ topoetcone40
Definition: IsolationType.h:50
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigEgammaPrecisionPhotonCaloIsoHypoTool::m_avgMuKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_avgMuKey
Definition: TrigEgammaPrecisionPhotonCaloIsoHypoTool.h:61