ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
EgammaReSamp1Fex Class Reference

Feature extraction Tool for LVL2 Calo. More...

#include <EgammaReSamp1Fex.h>

Inheritance diagram for EgammaReSamp1Fex:
Collaboration diagram for EgammaReSamp1Fex:

Public Member Functions

 EgammaReSamp1Fex (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode execute (xAOD::TrigEMCluster &rtrigEmCluster, const IRoiDescriptor &roi, const CaloDetDescrElement *&caloDDE, const EventContext &context) const override
 execute feature extraction for the EM Calorimeter second layer More...
 
virtual StatusCode initialize () override
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

const CaloIdManagerm_larMgr = nullptr
 Calorimeter Id Manager for calorimeter part determination (Barrel versus EndCap) More...
 
Gaudi::Property< bool > m_saveCells
 
Gaudi::Property< float > m_cellkeepthr
 
ToolHandle< IT2GeometryToolm_geometryTool
 
ServiceHandle< ITrigCaloDataAccessSvcm_dataSvc
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Feature extraction Tool for LVL2 Calo.

First EM Calorimeter sample.

Definition at line 28 of file EgammaReSamp1Fex.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ EgammaReSamp1Fex()

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

Definition at line 30 of file EgammaReSamp1Fex.cxx.

31  :
33 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode EgammaReSamp1Fex::execute ( xAOD::TrigEMCluster rtrigEmCluster,
const IRoiDescriptor roi,
const CaloDetDescrElement *&  caloDDE,
const EventContext &  context 
) const
overridevirtual

execute feature extraction for the EM Calorimeter second layer

Parameters
[out]rtrigEmClusteris the output cluster.
[in]eta/phi-min/max= RoI definition.

Implements IReAlgToolCalo.

Definition at line 35 of file EgammaReSamp1Fex.cxx.

38 {
39  bool cluster_in_barrel = true;
40  if (caloDDE) cluster_in_barrel = caloDDE->is_lar_em_barrel();
41 
42  ATH_MSG_DEBUG("in execute(TrigEMCluster &)");
43 
44  // Region Selector, sampling 1
45  int sampling = 1;
46 
48  ATH_CHECK( m_dataSvc->loadCollections(context, roi, TTEM, sampling, sel) );
49 
50  double totalEnergy = 0;
51  double etaEnergyS1 = 0;
53 
54  double energyEta = rtrigEmCluster.eta();
55  double energyPhi = rtrigEmCluster.phi();
56  if (caloDDE) {
57  energyEta = caloDDE->eta();
58  energyPhi = caloDDE->phi();
59  }
60 
61  // begin SRA mod: set regions via LAr way
62 
63  // Fix for 3x7 cluster size
64  double z_etamin = energyEta - (0.075 / 2.); // 3 middle layer cells (cell size 0.025) half distance (hence /2)
65  double z_etamax = energyEta + (0.075 / 2.); //
66  // in phi, the cluster size uses 7 cells of size {2*pi/64=(0.09817477)}/4 (middle layer cell size)
67  double z_phimin = energyPhi - (7.0 * 0.09817477 / 4.0) / 2.0;
68  double z_phimax = energyPhi + (7.0 * 0.09817477 / 4.0) / 2.0;
69  // Fix for 5x5 clusters
70  if (!cluster_in_barrel) {
71  z_etamin = energyEta - (0.125 / 2.); // see comments above, endcap cluster is 5x5
72  z_etamax = energyEta + (0.125 / 2.);
73  z_phimin = energyPhi - (5.0 * 0.09817477 / 4.0) / 2.0;
74  z_phimax = energyPhi + (5.0 * 0.09817477 / 4.0) / 2.0;
75  }
76 
77  double z_eta = z_etamin + (z_etamax - z_etamin) * 0.5;
78  double z_phi = z_phimin + (z_phimax - z_phimin) * 0.5;
79 
80  // Make sure these boundaries are valid
81 
82  if (z_etamin < -2.4) z_etamin = -2.4;
83  if (z_etamin < -1.4 && z_etamin > -1.5) z_etamin = -1.4;
84  if (z_etamin > 1.4 && z_etamin < 1.5) z_etamin = 1.5;
85 
86  if (z_etamax > 2.4) z_etamax = 2.4;
87  if (z_etamax < -1.4 && z_etamax > -1.5) z_etamax = -1.5;
88  if (z_etamax > 1.4 && z_etamax < 1.5) z_etamax = 1.4;
89 
90  bool signals = false;
91  if ((z_etamin < 0) && (z_etamax > 0)) signals = true;
92 
93  // identify region in which the detector change granularity for this layer
94  // and we have to compensate. This is documented in LAr TDR
95  double etareg[6] = {-2.4, -2.0, -1.8, 1.8, 2.0, 2.4};
96  double etagra[5] = {0.025 / 4, 0.025 / 6, 0.025 / 8, 0.025 / 6, 0.025 / 4};
97  int imax = -9;
98  int icrk = 1;
99  double dgra = 0.;
100  // find the region, and check if the eta range cross region.
101  for (int ir = 0; ir < 5; ir++) {
102  // make sure you're not outside acceptance of 2.4
103  if (std::abs(z_eta) < 2.4 && z_eta >= etareg[ir] && z_eta <= etareg[ir + 1]) {
104  dgra = etagra[ir];
105  imax = ir;
106  if (z_etamin >= etareg[ir] && z_etamax <= etareg[ir + 1]) icrk = 0;
107  }
108  }
109  const double inv_dgra = dgra != 0 ? 1. / dgra : 1;
110 
111  // begin SRA mod: pick the eta around which to scan
112  int strip_border;
113  double etanew;
114  double aeta = std::abs(z_eta);
115  if (aeta <= 1.4) {
116  strip_border = (int)rint(aeta * inv_dgra);
117  // this is -0.5 in atrecon: qgcshap.F .. Makes more sense to be +0.5
118  etanew = ((double)strip_border - 0.5) * dgra;
119  }
120  if (aeta <= 1.5) {
121  etanew = -99.;
122  }
123  if (aeta <= 1.8) {
124  strip_border = (int)rint(aeta * inv_dgra);
125  // this is -0.5 in atrecon: qgcshap.F .. Makes more sense to be +0.5
126  etanew = ((double)strip_border - 0.5) * dgra;
127  }
128  else if (aeta <= 2.0) {
129  strip_border = (int)rint((aeta - 1.8) * inv_dgra);
130  etanew = 1.8 + ((double)strip_border - 0.5) * dgra;
131  }
132  else if (aeta <= 2.4) {
133  strip_border = (int)rint((aeta - 2.0) * inv_dgra);
134  etanew = 2.0 + ((double)strip_border - 0.5) * dgra;
135  }
136  else {
137  etanew = -99.;
138  }
139 
140  etanew = (z_eta < 0.) ? -etanew : etanew;
141 
142  // check border crossing.
143  int ibin = 0;
144  double dgra1 = 0.;
145  int iadd = 0;
146  if ((icrk == 1) && (imax != -9)) {
147  if (imax > 0 && z_etamin > etareg[imax - 1] && z_etamin <= etareg[imax]) {
148  dgra1 = etagra[imax - 1];
149  ibin = (int)rint((etareg[imax] + 0.5 * dgra - etanew) * inv_dgra) + 20;
150  iadd = 0;
151  }
152  else {
153  if (imax < 4 && z_etamax > etareg[imax + 1] && z_etamax <= etareg[imax + 2]) {
154  dgra1 = etagra[imax + 1];
155  ibin = (int)rint((etareg[imax + 1] - 0.5 * dgra - etanew) * inv_dgra) + 20;
156  iadd = 1;
157  }
158  }
159  if (imax == 0) {
160  dgra1 = etagra[0];
161  ibin = (int)rint((etareg[0] + 0.5 * dgra - etanew) * inv_dgra) + 20;
162  iadd = 1;
163  }
164  if (imax == 4) {
165  dgra1 = etagra[4];
166  ibin = (int)rint((etareg[5] - 0.5 * dgra - etanew) * inv_dgra) + 20;
167  iadd = 0;
168  }
169  }
170  const double inv_dgra1 = dgra1 != 0 ? 1. / dgra1 : 1;
171 
172  // end SRA mod
173 
174  double z_enecell[40]; // SRA
175  double z_etacell[40]; // SRA
176 
177  for (int iii = 0; iii < 40; iii++) {
178  z_enecell[iii] = 0.;
179  z_etacell[iii] = 0.;
180  }
181 
182  int ncells = 0;
183 
184  for (const LArCell* larcell : sel) { // Should be revised for London scheme
185  ncells++;
186  double etaCell = larcell->caloDDE()->eta_raw();
187  double phiCell = larcell->phi();
188  double energyCell = larcell->energy();
189 
190  if (std::abs(etanew) != 99.) {
191 
192  double eta_cell = etaCell; // SRA
193  // double eta_cell = larcell->eta(); //SRA
194 
195  // begin SRA mod
196  if (eta_cell >= z_etamin && eta_cell <= z_etamax) {
197  // adjust for possible 2*pi offset.
198  double phi_cell0 = larcell->phi();
199  double phi_cell = proxim(phi_cell0, z_phi);
200  if (phi_cell >= z_phimin && phi_cell <= z_phimax) {
201  int ieta; // SRA
202  if (icrk == 0) {
203  // single region
204  ieta = (int)rint((eta_cell - etanew) * inv_dgra) + 20;
205  // correction for eta=0 spacing
206  if (signals && eta_cell < 0)
207  ieta = (int)rint((eta_cell - etanew + 0.007) * inv_dgra) + 20;
208  }
209  else {
210  if (eta_cell > etareg[imax] && eta_cell < etareg[imax + 1]) {
211  // same region
212  ieta = (int)rint((eta_cell - etanew) * inv_dgra) + 20;
213  }
214  else {
215  // different region
216  ieta = (int)rint((eta_cell - etareg[imax + iadd] - (0.5 - iadd) * dgra1) *
217  inv_dgra1) +
218  ibin;
219  }
220  } // icrk==0
221 
222  double z_e = energyCell;
223 
224  if (ieta >= 1 && ieta <= 40) {
225  z_enecell[ieta - 1] += z_e;
226  z_etacell[ieta - 1] = eta_cell;
227  }
228  } // phi range
229  } // eta range
230  // end SRA mod
231  } // endif for veto of clusters in crack outside acceptance
232 
233  // Find the standard em cluster energy (3*7 cell, now sampling 1)
234  double deta = std::abs(etaCell - energyEta);
235  double dphi = std::abs(phiCell - energyPhi);
236  if (dphi > M_PI) dphi = 2. * M_PI - dphi; // wrap (pi - 2pi)->(-pi - 0)
237 
238  bool condition37 = cluster_in_barrel && (deta <= 0.0375 && dphi <= 0.0875);
239  bool condition55 = (!cluster_in_barrel) && (deta <= 0.0625 && dphi <= 0.0625);
240 
241  if (condition37 || condition55) {
242  totalEnergy += energyCell;
243  etaEnergyS1 += energyCell * etaCell;
244  // samp = CaloSampling::getSampling(*larcell);
245  samp = larcell->caloDDE()->getSampling();
246  rtrigEmCluster.setEnergy(samp, rtrigEmCluster.energy(samp) + energyCell);
247  rtrigEmCluster.setRawEnergy(samp, rtrigEmCluster.rawEnergy(samp) + energyCell);
248  }
249 
250  } // end of loop over sampling 1
251 
252  // SRA mod: Emax!
253  double z_emax = -999.0;
254  int z_ncmax = -999;
255  for (int ic = 0; ic < 40; ic++) {
256  if (z_enecell[ic] > z_emax) {
257  z_emax = z_enecell[ic];
258  z_ncmax = ic;
259  }
260  }
261 
262  // Include now setWstot
263  double wtot = 0.;
264  double etot = 0.;
265  double wstot = -9999.;
266  double wstot_deta = (z_etamax - z_etamin) * 0.5;
267  // cppcheck-suppress negativeIndex
268  double eta_center = z_etacell[z_ncmax];
269  if (caloDDE != 0) {
270  eta_center = caloDDE->eta();
271  wstot_deta = caloDDE->deta() * 2.5;
272  }
273 
274  for (int ic = 0; ic < 40; ic++) {
275  if ((z_etacell[ic] >= (eta_center - wstot_deta)) &&
276  (z_etacell[ic] <= (eta_center + wstot_deta))) {
277  wtot += z_enecell[ic] * (ic - z_ncmax) * (ic - z_ncmax);
278  etot += z_enecell[ic];
279  }
280  }
281  if (etot > 0) {
282  wtot = wtot / etot;
283  wstot = wtot > 0 ? sqrt(wtot) : -9999.;
284  }
285 
286  // SRA mod: Emax2!
287  // int z_ncsec1=0;
288  double z_esec1 = -999.0; // energy of strip with second max 2
289 
290  double ecand1;
291 
292  for (int iic = 1; iic < 39; iic++) {
293  if ((z_enecell[iic] > z_enecell[iic - 1]) && (z_enecell[iic] > z_enecell[iic + 1])) {
294  if (iic != z_ncmax) {
295  ecand1 = z_enecell[iic];
296  if (ecand1 > z_esec1) {
297  z_esec1 = ecand1;
298  // z_ncsec1=iic;
299  }
300  }
301  }
302  }
303 
304  if ((z_emax + z_esec1) < 0.) z_emax = -(100. / 98.) * z_esec1;
305 
306  // do frac73 calculation: sum energies +-3 strips
307  // and +-1 strip around highest energy strip
308  double strip7 = 0.; // temporary variables to sum energy
309  double strip3 = 0.;
310  double frac73 = 0.; // (E7-E3)/E3 in layer 1
311 
312  // use Steve's array to calculate frac73 MW
313  //
314  int smax = z_ncmax;
315  if (z_ncmax > 2 && z_ncmax < 37) {
316  strip7 = z_enecell[smax - 3] + z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] +
317  z_enecell[smax + 2] + z_enecell[smax + 3] + z_enecell[smax];
318  strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
319  }
320  else if (z_ncmax == 2) {
321  strip7 = z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] + z_enecell[smax + 2] +
322  z_enecell[smax + 3] + z_enecell[smax];
323  strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
324  }
325  else if (z_ncmax == 37) {
326  strip7 = z_enecell[smax - 3] + z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] +
327  z_enecell[smax + 2] + z_enecell[smax];
328  strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
329  }
330  else if (z_ncmax == 1) {
331  strip7 = z_enecell[smax - 1] + z_enecell[smax + 1] + z_enecell[smax + 2] + z_enecell[smax + 3] +
332  z_enecell[smax];
333  strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
334  }
335  else if (z_ncmax == 38) {
336  strip7 = z_enecell[smax - 3] + z_enecell[smax - 2] + z_enecell[smax - 1] + z_enecell[smax + 1] +
337  z_enecell[smax];
338  strip3 = z_enecell[smax - 1] + z_enecell[smax] + z_enecell[smax + 1];
339  }
340  strip3 > 1.e-6 ? // protect against small values of strip3
341  frac73 = (strip7 - strip3) / strip3
342  : frac73 = 99.;
343 
344  // Update Cluster Variables
345 
346  rtrigEmCluster.setNCells(ncells + rtrigEmCluster.nCells());
347  rtrigEmCluster.setEmaxs1(z_emax);
348  rtrigEmCluster.setWstot(wstot);
349  rtrigEmCluster.setE2tsts1(z_esec1);
350  rtrigEmCluster.setFracs1(frac73);
351  if (totalEnergy != 0.0)
352  rtrigEmCluster.setEta1(etaEnergyS1 / totalEnergy);
353  else
354  rtrigEmCluster.setEta1(99.0);
355  rtrigEmCluster.setRawEnergy(rtrigEmCluster.rawEnergy() + totalEnergy);
356 
357 
358  return StatusCode::SUCCESS;
359 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode IReAlgToolCalo::initialize ( )
overridevirtualinherited

Reimplemented in RingerReFex.

Definition at line 25 of file IReAlgToolCalo.cxx.

26 {
28  if (!m_dataSvc.empty()) ATH_CHECK(m_dataSvc.retrieve());
29  ATH_CHECK(m_geometryTool.retrieve());
30 
31  return StatusCode::SUCCESS;
32 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_cellkeepthr

Gaudi::Property<float> IReAlgToolCalo::m_cellkeepthr
protectedinherited
Initial value:
{this, "ThresholdKeepCells", 1e5,
"Threshold to keep cells incontainer"}

Definition at line 77 of file IReAlgToolCalo.h.

◆ m_dataSvc

ServiceHandle<ITrigCaloDataAccessSvc> IReAlgToolCalo::m_dataSvc
protectedinherited
Initial value:
{this, "trigDataAccessMT",
"TrigCaloDataAccessSvc/TrigCaloDataAccessSvc",
"Data Access for LVL2 Calo Algorithms in MT"}

Definition at line 84 of file IReAlgToolCalo.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_geometryTool

ToolHandle<IT2GeometryTool> IReAlgToolCalo::m_geometryTool
protectedinherited
Initial value:
{
this, "T2GeometryTool", "T2GeometryTool/T2GeometryTool",
"Tool to check that a cells are contained in a given cluster"}

Definition at line 80 of file IReAlgToolCalo.h.

◆ m_larMgr

const CaloIdManager* IReAlgToolCalo::m_larMgr = nullptr
protectedinherited

Calorimeter Id Manager for calorimeter part determination (Barrel versus EndCap)

Definition at line 71 of file IReAlgToolCalo.h.

◆ m_saveCells

Gaudi::Property<bool> IReAlgToolCalo::m_saveCells
protectedinherited
Initial value:
{this, "SaveCellsInContainer", false,
"Enables saving of the RoI Calorimeter Cells in StoreGate"}

Definition at line 74 of file IReAlgToolCalo.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::TrigEMCluster_v1::eta
float eta() const
get Eta (calibrated)
xAOD::TrigCaloCluster_v1::nCells
int nCells() const
get number of cells used from RoI
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
IReAlgToolCalo::m_larMgr
const CaloIdManager * m_larMgr
Calorimeter Id Manager for calorimeter part determination (Barrel versus EndCap)
Definition: IReAlgToolCalo.h:71
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::TrigEMCluster_v1::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::wstot
setEt setPhi setE277 setWeta2 setEta1 setE2tsts1 wstot
Definition: TrigEMCluster_v1.cxx:49
xAOD::TrigCaloCluster_v1::rawEnergy
float rawEnergy() const
get Raw Energy (no calibration)
proxim
double proxim(double b, double a)
Definition: EgammaReSamp1Fex.cxx:25
IReAlgToolCalo::m_dataSvc
ServiceHandle< ITrigCaloDataAccessSvc > m_dataSvc
Definition: IReAlgToolCalo.h:84
IReAlgToolCalo::m_geometryTool
ToolHandle< IT2GeometryTool > m_geometryTool
Definition: IReAlgToolCalo.h:80
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IReAlgToolCalo::IReAlgToolCalo
IReAlgToolCalo(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: IReAlgToolCalo.cxx:20
xAOD::TrigEMCluster_v1::phi
float phi() const
get Phi (calibrated)
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::TrigEMCluster_v1::setEmaxs1
void setEmaxs1(float)
set maximum energy in sampling 1 (strip layer)
TTEM
@ TTEM
Definition: RegSelEnums.h:28
python.AppMgr.iadd
def iadd(self, tool)
associator for public tools -------------------------------------------—
Definition: AppMgr.py:28
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
sel
sel
Definition: SUSYToolsTester.cxx:92
xAOD::TrigEMCluster_v1::setE2tsts1
void setE2tsts1(float)
set second maximum energy in sampling 1 (strip layer)
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::TrigEMCluster_v1::setFracs1
void setFracs1(float)
set Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
xAOD::TrigEMCluster_v1::setEta1
void setEta1(float)
set Eta sampling 1 (strip layer)
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
imax
int imax(int i, int j)
Definition: TileLaserTimingTool.cxx:33
python.L1.Config.LegacyTopoMergerMap.signals
signals
Definition: LegacyTopoMergerMap.py:13
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
grepfile.ic
int ic
Definition: grepfile.py:33
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
LArCell
Data object for LAr calorimeter readout cell.
Definition: LArCell.h:53
LArTT_Selector< LArCellCont >
xAOD::TrigCaloCluster_v1::setNCells
void setNCells(int)
set number of cells used from RoI
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
CaloDetDescrElement::is_lar_em_barrel
bool is_lar_em_barrel() const
cell belongs to EM barrel
Definition: CaloDetDescrElement.cxx:98
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::TrigCaloCluster_v1::setRawEnergy
void setRawEnergy(float)
set Raw Energy (no calibration)
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
xAOD::TrigEMCluster_v1::setWstot
void setWstot(float)
set width in first layer
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::TrigEMCluster_v1::energy
float energy() const
get Energy (calibrated)
fitman.k
k
Definition: fitman.py:528