ATLAS Offline Software
TrigEgammaEmulationL1CaloHypoTool.cxx
Go to the documentation of this file.
1 
2 
3 #include <utility>
4 
6 #include "boost/algorithm/string.hpp"
7 #include "GaudiKernel/SystemOfUnits.h"
8 
9 
10 using namespace Trig;
11 //**********************************************************************
12 
15 {}
16 
17 
19 
20 
22 {
23  pass=false;
24  if( !input.l1 ){
25  ATH_MSG_WARNING("L1 not found. poinet is null");
26  return false;
27  }
28 
29  pass = decide( input );
30  return true;
31 }
32 
33 
36 {
37  auto l1 = input.l1;
38  std::string l1item = m_l1item;
39 
40  //for(const auto& l1 : *l1Cont){
41  if (l1->roiType() != xAOD::EmTauRoI::EMRoIWord){
42  ATH_MSG_DEBUG("This roi is not EMRoIWord!");
43  return true;
44  }
45  float emE = l1->emClus()/Gaudi::Units::GeV; // Cluster energy
46  float eta = l1->eta(); // eta
47  float hadCore = l1->hadCore()/Gaudi::Units::GeV; // Hadronic core energy
48  float emIsol = l1->emIsol()/Gaudi::Units::GeV; // EM Isolation energy
49 
50  ATH_MSG_DEBUG("emE = " << emE);
51  ATH_MSG_DEBUG("eta = " << eta);
52  ATH_MSG_DEBUG("hadCore = " << hadCore);
53  ATH_MSG_DEBUG("emIsol = " << emIsol);
54 
55  if (boost::contains(l1item,"H")) {
56  ATH_MSG_DEBUG("L1 (H) CUT");
58  ATH_MSG_DEBUG("rejected");
59  return false;
60  }
61  ATH_MSG_DEBUG("accepted");
62  }
63 
64  if (boost::contains(l1item,"I")) {
65  ATH_MSG_DEBUG("L1 (I) CUT");
67  ATH_MSG_DEBUG("rejected");
68  return false;
69  }
70  ATH_MSG_DEBUG("accepted");
71  }
72 
73  ATH_MSG_DEBUG("Apply L1 Et cut " << m_l1threshold << " cluster emE " << emE << " eta " << eta);
74  if (boost::contains(l1item,"V")) {
75  ATH_MSG_DEBUG("L1 (V) CUT");
76  if (!variableEtL1(l1item,emE,eta)) {
77  ATH_MSG_DEBUG("rejected");
78  return false;
79  }
80  ATH_MSG_DEBUG("accepted");
81  }
82  // add new method for this also
83  else if (emE <= m_l1threshold) { // this cut is confirmed to be <=
84  return false;
85  }
86 
87  return true;
88 }
89 
90 
92 
93 // (H) and (I) Hadronic core and electromagnetic isolation
94 bool TrigEgammaEmulationL1CaloHypoTool::isolationL1(float min, float offset, float slope, float energy, float emE) const
95 {
96  if (emE > m_isolMaxCut) {
97  ATH_MSG_DEBUG("L1 Isolation skipped, ET > Maximum isolation");
98  return true;
99  }
100  float isolation = offset + emE*slope;
101  if (isolation < min) isolation = min;
102  /*
103  from CaloDef.py
104  isolation <= ET/m + offset
105  */
106  bool value = (energy <= isolation);
107 
108 
109  ATH_MSG_DEBUG("L1 Isolation ET = " << energy << " ISOLATION CUT " << isolation);
110  return value;
111 }
112 
113 
115 // (V) Variable Et cut
116 bool TrigEgammaEmulationL1CaloHypoTool::variableEtL1(std::string L1item, float l1energy, float l1eta) const
117 {
118  float cut = emulationL1V(std::move(L1item),l1eta);
119  return l1energy>cut;
120 }
122 // Eta dependant cuts for (V)
123 float TrigEgammaEmulationL1CaloHypoTool::emulationL1V(const std::string& L1item, float l1eta) const
124 {
125  // Values updated from TriggerMenu-00-13-26
126  // Now they all look symmetric in negative and positive eta
127  // look that in general que can remove the first region since it is the defaul value
128  float cut=0.;
129  // float eta = fabs((int)l1eta*10);
130  float eta = std::abs(l1eta);
131  if (L1item=="50V") {
132  if (eta >= 0.8 && eta < 1.2) cut = 51.0;
133  else if (eta >= 1.2 && eta < 1.6) cut = 50.0;
134  else if (eta >= 1.6 && eta < 2.0) cut = 51.0;
135  else cut = 52;
136  }
137  else if (L1item=="8VH") {
138  if (eta > 0.8 && eta <= 1.1) cut = 7.0;
139  else if (eta > 1.1 && eta <= 1.4) cut = 6.0;
140  else if (eta > 1.4 && eta <= 1.5) cut = 5.0;
141  else if (eta > 1.5 && eta <= 1.8) cut = 7.0;
142  else if (eta > 1.8 && eta <= 2.5) cut = 8.0;
143  else cut = 9.0;
144  }
145  else if (L1item=="10VH") {
146  if (eta > 0.8 && eta <= 1.1) cut = 9.0;
147  else if (eta > 1.1 && eta <= 1.4) cut = 8.0;
148  else if (eta > 1.4 && eta <= 1.5) cut = 7.0;
149  else if (eta > 1.5 && eta <= 1.8) cut = 9.0;
150  else if (eta > 1.8 && eta <= 2.5) cut = 10.0;
151  else cut = 11.;
152  }
153  else if (L1item=="13VH") {
154  if (eta > 0.7 && eta <= 0.9) cut = 14.0;
155  else if (eta > 0.9 && eta <= 1.2) cut = 13.0;
156  else if (eta > 1.2 && eta <= 1.4) cut = 12.0;
157  else if (eta > 1.4 && eta <= 1.5) cut = 11.0;
158  else if (eta > 1.5 && eta <= 1.7) cut = 13.0;
159  else if (eta > 1.7 && eta <= 2.5) cut = 14.0;
160  else cut = 15.0;
161  }
162  else if (L1item=="15VH") {
163  if (eta > 0.7 && eta <= 0.9) cut = 16.0;
164  else if (eta > 0.9 && eta <= 1.2) cut = 15.0;
165  else if (eta > 1.2 && eta <= 1.4) cut = 14.0;
166  else if (eta > 1.4 && eta <= 1.5) cut = 13.0;
167  else if (eta > 1.5 && eta <= 1.7) cut = 15.0;
168  else if (eta > 1.7 && eta <= 2.5) cut = 16.0;
169  else cut = 17.0;
170  }
171  else if (L1item == "18VH") {
172  if (eta > 0.7 && eta <= 0.8) cut = 19.0;
173  else if (eta > 0.8 && eta <= 1.1) cut = 18.0;
174  else if (eta > 1.1 && eta <= 1.3) cut = 17.0;
175  else if (eta > 1.3 && eta <= 1.4) cut = 16.0;
176  else if (eta > 1.4 && eta <= 1.5) cut = 15.0;
177  else if (eta > 1.5 && eta <= 1.7) cut = 17.0;
178  else if (eta > 1.7 && eta <= 2.5) cut = 19.0;
179  else cut = 20.0;
180  }
181  else if (L1item == "20VH") {
182  if (eta > 0.7 && eta <= 0.8) cut = 21.0;
183  else if (eta > 0.8 && eta <= 1.1) cut = 20.0;
184  else if (eta > 1.1 && eta <= 1.3) cut = 19.0;
185  else if (eta > 1.3 && eta <= 1.4) cut = 18.0;
186  else if (eta > 1.4 && eta <= 1.5) cut = 17.0;
187  else if (eta > 1.5 && eta <= 1.7) cut = 19.0;
188  else if (eta > 1.7 && eta <= 2.5) cut = 21.0;
189  else cut = 22.0;
190  }
191  else if (L1item == "20VHI") { // Same as 20VH
192  if (eta > 0.7 && eta <= 0.8) cut = 21.0;
193  else if (eta > 0.8 && eta <= 1.1) cut = 20.0;
194  else if (eta > 1.1 && eta <= 1.3) cut = 19.0;
195  else if (eta > 1.3 && eta <= 1.4) cut = 18.0;
196  else if (eta > 1.4 && eta <= 1.5) cut = 17.0;
197  else if (eta > 1.5 && eta <= 1.7) cut = 19.0;
198  else if (eta > 1.7 && eta <= 2.5) cut = 21.0;
199  else cut = 22.0;
200  }
201  else if (L1item == "22VHI") {
202  if (eta > 0.7 && eta <= 0.8) cut = 23.0;
203  else if (eta > 0.8 && eta <= 1.1) cut = 22.0;
204  else if (eta > 1.1 && eta <= 1.3) cut = 21.0;
205  else if (eta > 1.3 && eta <= 1.4) cut = 20.0;
206  else if (eta > 1.4 && eta <= 1.5) cut = 19.0;
207  else if (eta > 1.5 && eta <= 1.7) cut = 21.0;
208  else if (eta > 1.7 && eta <= 2.5) cut = 23.0;
209  else cut = 24.0;
210  }
211  return cut;
212 }
Trig::TrigEgammaEmulationL1CaloHypoTool::m_l1threshold
Gaudi::Property< float > m_l1threshold
Definition: TrigEgammaEmulationL1CaloHypoTool.h:44
Trig
The common trigger namespace for trigger analysis tools.
Definition: CaloTowerVecMon.h:44
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
Trig::TrigEgammaEmulationL1CaloHypoTool::m_emIsolCutSlope
Gaudi::Property< float > m_emIsolCutSlope
Definition: TrigEgammaEmulationL1CaloHypoTool.h:50
Trig::TrigEgammaEmulationL1CaloHypoTool::variableEtL1
bool variableEtL1(std::string L1item, float l1energy, float l1eta) const
==========================================================================
Definition: TrigEgammaEmulationL1CaloHypoTool.cxx:116
athena.value
value
Definition: athena.py:122
Trig::TrigEgammaEmulationL1CaloHypoTool::m_hadCoreCutMin
Gaudi::Property< float > m_hadCoreCutMin
Definition: TrigEgammaEmulationL1CaloHypoTool.h:45
Trig::TrigEgammaEmulationL1CaloHypoTool::isolationL1
bool isolationL1(float min, float offset, float slope, float energy, float emE) const
==========================================================================
Definition: TrigEgammaEmulationL1CaloHypoTool.cxx:94
Trig::TrigEgammaEmulationBaseHypoTool
Definition: TrigEgammaEmulationBaseHypoTool.h:22
Trig::TrigEgammaEmulationL1CaloHypoTool::TrigEgammaEmulationL1CaloHypoTool
TrigEgammaEmulationL1CaloHypoTool(const std::string &myname)
Definition: TrigEgammaEmulationL1CaloHypoTool.cxx:13
Trig::TrigEgammaEmulationL1CaloHypoTool::m_emIsolCutMin
Gaudi::Property< float > m_emIsolCutMin
Definition: TrigEgammaEmulationL1CaloHypoTool.h:48
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
TrigEgammaEmulationL1CaloHypoTool.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trig::TrigEgammaEmulationL1CaloHypoTool::m_hadCoreCutSlope
Gaudi::Property< float > m_hadCoreCutSlope
Definition: TrigEgammaEmulationL1CaloHypoTool.h:47
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
Trig::TrigEgammaEmulationL1CaloHypoTool::m_hadCoreCutOff
Gaudi::Property< float > m_hadCoreCutOff
Definition: TrigEgammaEmulationL1CaloHypoTool.h:46
min
#define min(a, b)
Definition: cfImp.cxx:40
Trig::TrigEgammaEmulationL1CaloHypoTool::m_l1item
Gaudi::Property< std::string > m_l1item
Definition: TrigEgammaEmulationL1CaloHypoTool.h:43
Trig::TrigEgammaEmulationL1CaloHypoTool::decide
bool decide(const Trig::TrigData &input) const
==========================================================================
Definition: TrigEgammaEmulationL1CaloHypoTool.cxx:35
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trig::TrigEgammaEmulationL1CaloHypoTool::m_isolMaxCut
Gaudi::Property< float > m_isolMaxCut
Definition: TrigEgammaEmulationL1CaloHypoTool.h:51
xAOD::EmTauRoI_v2::EMRoIWord
@ EMRoIWord
This is a Run 2 EM RoI word.
Definition: EmTauRoI_v2.h:47
Trig::TrigData
Definition: TrigEgammaEmulationToolMT.h:40
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
Trig::TrigEgammaEmulationL1CaloHypoTool::emulate
virtual bool emulate(const TrigData &, bool &) const override
==========================================================================
Definition: TrigEgammaEmulationL1CaloHypoTool.cxx:21
skel.l1
l1
Definition: skel.GENtoEVGEN.py:425
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
Trig::TrigEgammaEmulationL1CaloHypoTool::emulationL1V
float emulationL1V(const std::string &L1item, float l1eta) const
==========================================================================
Definition: TrigEgammaEmulationL1CaloHypoTool.cxx:123
Trig::TrigEgammaEmulationL1CaloHypoTool::m_emIsolCutOff
Gaudi::Property< float > m_emIsolCutOff
Definition: TrigEgammaEmulationL1CaloHypoTool.h:49