ATLAS Offline Software
CaloSwEtaoff_v3.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 */
15 #ifndef CALOCLUSTERCORRECTION_CALOSWETAOFF_V3_H
16 #define CALOCLUSTERCORRECTION_CALOSWETAOFF_V3_H
17 
19 #include "CaloConditions/Array.h"
20 
21 
23 
24 
132 {
133 public:
136 
137 
158  virtual void makeTheCorrection (const Context& myctx,
159  xAOD::CaloCluster* cluster,
160  const CaloDetDescrElement* elt,
161  float eta,
162  float adj_eta,
163  float phi,
164  float adj_phi,
165  CaloSampling::CaloSample samp) const override;
166 
167 private:
172  class Builder
173  : public TableBuilder
174  {
175  public:
182  const CxxUtils::Array<2>& regions,
183  const CxxUtils::Array<2>& forms,
184  float aeta,
185  float u,
186  int region_ndx);
187 
189  virtual float calculate (int energy_ndx, bool& good) const;
190 
191  private:
193  static float calc0 (float aeta, float u, const CaloRec::Array<2>& coef) ;
194 
196  static float calc3 (float aeta, float u, const CaloRec::Array<2>& coef) ;
197 
199  static float calc4 (float aeta, float u, const CaloRec::Array<2>& coef) ;
200 
202  static float calc5 (float aeta, float u, const CaloRec::Array<2>& coef) ;
203 
205  static float calc10 (float aeta, float u, const CaloRec::Array<2>& coef) ;
206 
208  static float calc11 (float aeta, float u, const CaloRec::Array<2>& coef) ;
209 
211  static float calc13 (float aeta, float u, const CaloRec::Array<2>& coef, float xlo, float xhi) ;
212 
213  // Tabulated arrays of function parameters.
215 
218 
221 
224 
227  float m_aeta;
228 
230  float m_u;
231 
233  int m_form;
234  };
235  friend class Builder;
236 
238  static int find_region (const CxxUtils::Array<2>& regions,
239  float aeta) ;
240 
252  { this, "correction", "Tabulated arrays of function parameters." };
253 
265  { this, "regions", "Table of regions." };
266 
267  enum {
268  REG_LO = 0,
269  REG_HI = 1,
270  REG_FORM = 2,
273  REG_ENTRIES = 5 // Number of entries expected.
274  };
275 
279  { this, "energies", "Table of energies at which the correction was tabulated." };
280 
283  { this, "energy_degree", "Degree of the polynomial interpolation in energy." };
284 
289  { this, "forms", "Functional form to use per region per energy." };
290 };
291 
292 
293 #endif // not CALOCLUSTERCORRECTION_CALOSWETAOFF_V3_H
CaloSwEtaoff_v3::Builder::calc4
static float calc4(float aeta, float u, const CaloRec::Array< 2 > &coef)
Evaluate the function Form 4.
Definition: CaloSwEtaoff_v3.cxx:306
CaloSwEtaoff_v3::find_region
static int find_region(const CxxUtils::Array< 2 > &regions, float aeta)
Find the index of the region containing a given value.
Definition: CaloSwEtaoff_v3.cxx:103
CaloSwEtaoff_v3::Builder
Helper class for calculating the energy interpolation table.
Definition: CaloSwEtaoff_v3.h:174
CaloSwEtaoff_v3::REG_CELLSIZE
@ REG_CELLSIZE
Definition: CaloSwEtaoff_v3.h:271
CaloSwEtaoff_v3::REG_LO
@ REG_LO
Definition: CaloSwEtaoff_v3.h:268
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloSwEtaoff_v3::Builder::Builder
Builder(const CxxUtils::Array< 4 > &correction, const CxxUtils::Array< 2 > &regions, const CxxUtils::Array< 2 > &forms, float aeta, float u, int region_ndx)
Constructor.
Definition: CaloSwEtaoff_v3.cxx:129
CaloSwEtaoff_v3::REG_PHASE
@ REG_PHASE
Definition: CaloSwEtaoff_v3.h:272
CaloSwEtaoff_v3::Builder::calc13
static float calc13(float aeta, float u, const CaloRec::Array< 2 > &coef, float xlo, float xhi)
Evaluate the function Form 13.
Definition: CaloSwEtaoff_v3.cxx:395
Array.h
Simple multidimensional arrays.
CaloSwEtaoff_v3::Builder::calc11
static float calc11(float aeta, float u, const CaloRec::Array< 2 > &coef)
Evaluate the function Form 11.
Definition: CaloSwEtaoff_v3.cxx:376
CaloSwEtaoff_v3::Builder::calc0
static float calc0(float aeta, float u, const CaloRec::Array< 2 > &coef)
Evaluate the function Form 0.
Definition: CaloSwEtaoff_v3.cxx:268
CaloSwEtaoff_v3::REG_FORM
@ REG_FORM
Definition: CaloSwEtaoff_v3.h:270
CaloSwEtaoff_v3::Builder::m_correction
const CxxUtils::Array< 4 > & m_correction
Definition: CaloSwEtaoff_v3.h:214
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
CaloSwEtaoff_v3::Builder::m_u
float m_u
The fractional offset in the cell of this cluster.
Definition: CaloSwEtaoff_v3.h:230
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
CaloClusterCorrectionCommon::TableBuilder
Helper, used to calculate the values of the energy interpolation table.
Definition: CaloClusterCorrectionCommon.h:127
CaloSwEtaoff_v3::Builder::calc3
static float calc3(float aeta, float u, const CaloRec::Array< 2 > &coef)
Evaluate the function Form 3.
Definition: CaloSwEtaoff_v3.cxx:286
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
WritePulseShapeToCool.xhi
xhi
Definition: WritePulseShapeToCool.py:152
CaloSwEtaoff_v3::REG_HI
@ REG_HI
Definition: CaloSwEtaoff_v3.h:269
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloSwEtaoff_v3::Builder::m_regions
const CxxUtils::Array< 2 > & m_regions
Table of regions.
Definition: CaloSwEtaoff_v3.h:217
CaloSwEtaoff_v3::Builder::calculate
virtual float calculate(int energy_ndx, bool &good) const
Calculate the correction for tabulated energy ENERGY_NDX.
Definition: CaloSwEtaoff_v3.cxx:152
CaloSwEtaoff_v3::Builder::m_aeta
float m_aeta
The abs(eta) at which the correction is being evaluated (in cal-local coordinates).
Definition: CaloSwEtaoff_v3.h:227
CaloSwEtaoff_v3::Builder::calc5
static float calc5(float aeta, float u, const CaloRec::Array< 2 > &coef)
Evaluate the function Form 5.
Definition: CaloSwEtaoff_v3.cxx:328
CaloClusterCorrectionCommon::CaloClusterCorrectionCommon
CaloClusterCorrectionCommon(const std::string &type, const std::string &name, const IInterface *parent)
Inherit constructor.
Definition: CaloClusterCorrectionCommon.cxx:408
CxxUtils::Array< 4 >
CaloSwEtaoff_v3::makeTheCorrection
virtual void makeTheCorrection(const Context &myctx, xAOD::CaloCluster *cluster, const CaloDetDescrElement *elt, float eta, float adj_eta, float phi, float adj_phi, CaloSampling::CaloSample samp) const override
Virtual function for the correction-specific code.
Definition: CaloSwEtaoff_v3.cxx:39
CaloClusterCorrectionCommon.h
WritePulseShapeToCool.xlo
xlo
Definition: WritePulseShapeToCool.py:133
CaloSwEtaoff_v3
Definition: CaloSwEtaoff_v3.py:1
CaloSwEtaoff_v3::m_energies
Constant< CxxUtils::Array< 1 > > m_energies
Calibration constant: table of energies at which the correction was tabulated.
Definition: CaloSwEtaoff_v3.h:279
CaloSwEtaoff_v3::m_forms
Constant< CxxUtils::Array< 2 > > m_forms
Calibration constant: Functional form to use per region per energy.
Definition: CaloSwEtaoff_v3.h:289
CaloSwEtaoff_v3::m_regions
Constant< CxxUtils::Array< 2 > > m_regions
Calibration constant: table of regions.
Definition: CaloSwEtaoff_v3.h:265
ReadBchFromCool.good
good
Definition: ReadBchFromCool.py:433
CaloSwEtaoff_v3::m_energy_degree
Constant< int > m_energy_degree
Calibration constant: degree of the polynomial interpolation in energy.
Definition: CaloSwEtaoff_v3.h:283
CaloSwEtaoff_v3::Builder::calc10
static float calc10(float aeta, float u, const CaloRec::Array< 2 > &coef)
Evaluate the function Form 10.
Definition: CaloSwEtaoff_v3.cxx:345
CaloUtils::ToolConstantsContext
Context object for retrieving ToolConstant values.
Definition: ToolWithConstants.h:61
CaloSwEtaoff_v3::Builder::m_region_ndx
int m_region_ndx
The index of the region in which we're evaluating the correction.
Definition: CaloSwEtaoff_v3.h:223
CaloClusterCorrectionCommon
Code common to cluster corrections.
Definition: CaloClusterCorrectionCommon.h:42
CaloUtils::ToolConstant
Constant of a ToolWithConstants.
Definition: ToolWithConstants.h:202
CaloSwEtaoff_v3::Builder::m_forms
const CxxUtils::Array< 2 > & m_forms
Functional form per region.
Definition: CaloSwEtaoff_v3.h:220
WriteCalibToCool.coef
coef
Definition: WriteCalibToCool.py:582
CaloSwEtaoff_v3::REG_ENTRIES
@ REG_ENTRIES
Definition: CaloSwEtaoff_v3.h:273
CaloSwEtaoff_v3::Builder::m_form
int m_form
The index of the functional form we're evaluating.
Definition: CaloSwEtaoff_v3.h:233
CaloSwEtaoff_v3::m_correction
Constant< CxxUtils::Array< 4 > > m_correction
Calibration constant: tabulated arrays of function parameters.
Definition: CaloSwEtaoff_v3.h:252