ATLAS Offline Software
CaloClusterCorrectionCommon.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 */
5 /* @file CaloClusterCorrectionCommon.h
6  * @author scott snyder <snyder@bnl.gov>
7  * @date December, 2004
8  * @brief Code common to cluster corrections.
9  */
10 
11 #ifndef CALOCLUSTERCORRECTIONCOMMON_H
12 #define CALOCLUSTERCORRECTIONCOMMON_H
13 
14 
17 #include "GaudiKernel/EventContext.h"
18 #include <vector>
20 
21 
22 namespace CaloClusterCorr {
23 class DDHelper;
24 }
25 
26 
41  : public CaloClusterCorrection
42 {
43 public:
45  //using CaloClusterCorrection::CaloClusterCorrection;
46  CaloClusterCorrectionCommon (const std::string& type,
47  const std::string& name,
48  const IInterface* parent);
49 
50 
53 
54 
61  virtual void makeCorrection (const Context& myctx,
62  xAOD::CaloCluster* cluster) const override;
63 
64 
87  virtual void makeTheCorrection (const Context& myctx,
88  xAOD::CaloCluster* cluster,
89  const CaloDetDescrElement* elt,
90  float eta,
91  float adj_eta,
92  float phi,
93  float adj_phi,
94  CaloSampling::CaloSample samp) const = 0;
95 
96 
100  enum {
101  // Barrel, sampling 1.
102  EMB1 = 0,
103 
104  // Barrel, sampling 2.
105  EMB2 = 1,
106 
107  // Endcap, sampling 1.
108  EME1 = 2,
109 
110  // Endcap, sampling 2.
111  EME2 = 3,
112 
113  // Average of barrel and endcap in sampling 2.
115 
116  // Overall cluster position.
117  CLUSTER = 5,
118 
119  // Number of different region codes.
120  NREGIONS = 6
121  };
122 
123 
127  {
128  public:
129  virtual ~TableBuilder() {}
130 
133  virtual float calculate (int energy_ndx, bool& good) const = 0;
134  };
135 
136 
145  static float energy_interpolation (float energy,
146  const TableBuilder& builder,
147  const CaloRec::Array<1>& energies,
148  int energy_degree) ;
149 
150 
151 
152 private:
155  const CaloClusterCorr::DDHelper& ddhelper(const CaloDetDescrManager* dd_man) const;
156 
162  { this, "region", "Calorimeter region" };
163 
166 };
167 
168 
169 #endif // not CALOCLUSTERCORRECTIONCOMMON_H
CaloClusterCorrectionCommon::ddhelper
const CaloClusterCorr::DDHelper & ddhelper(const CaloDetDescrManager *dd_man) const
Retrieve the detector description helper, creating it if needed.
Definition: CaloClusterCorrectionCommon.cxx:640
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CxxUtils::CachedUniquePtrT
Cached pointer with atomic update.
Definition: CachedUniquePtr.h:54
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloClusterCorrectionCommon::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Perform the correction.
Definition: CaloClusterCorrectionCommon.cxx:436
CaloClusterCorr::DDHelper
Definition: CaloClusterCorrectionCommon.cxx:84
CaloClusterCorrectionCommon::m_ddhelper
CxxUtils::CachedUniquePtr< const CaloClusterCorr::DDHelper > m_ddhelper
Helper for detector description lookup.
Definition: CaloClusterCorrectionCommon.h:165
CaloClusterCorrectionCommon::EMB2
@ EMB2
Definition: CaloClusterCorrectionCommon.h:105
CaloClusterCorr
Definition: CaloClusterCorrectionCommon.h:22
CaloClusterCorrectionCommon::NREGIONS
@ NREGIONS
Definition: CaloClusterCorrectionCommon.h:120
CaloClusterCorrectionCommon::TableBuilder
Helper, used to calculate the values of the energy interpolation table.
Definition: CaloClusterCorrectionCommon.h:127
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
createSimpleDistributions.builder
builder
Definition: createSimpleDistributions.py:52
CaloClusterCorrectionCommon::CaloClusterCorrectionCommon
CaloClusterCorrectionCommon(const std::string &type, const std::string &name, const IInterface *parent)
Inherit constructor.
Definition: CaloClusterCorrectionCommon.cxx:408
CachedUniquePtr.h
Cached unique_ptr with atomic update.
CxxUtils::Array
Read-only multidimensional array.
Definition: Control/CxxUtils/CxxUtils/Array.h:138
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloClusterCorrectionCommon::COMBINED2
@ COMBINED2
Definition: CaloClusterCorrectionCommon.h:114
CaloClusterCorrection.h
CaloClusterCorrectionCommon::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 =0
Virtual function for the correction-specific code.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ReadBchFromCool.good
good
Definition: ReadBchFromCool.py:433
CaloClusterCorrectionCommon::EMB1
@ EMB1
Definition: CaloClusterCorrectionCommon.h:102
CaloClusterCorrectionCommon::energy_interpolation
static float energy_interpolation(float energy, const TableBuilder &builder, const CaloRec::Array< 1 > &energies, int energy_degree)
Many of the corrections use the same method for doing the final interpolation in energy.
Definition: CaloClusterCorrectionCommon.cxx:575
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloClusterCorrectionCommon::TableBuilder::calculate
virtual float calculate(int energy_ndx, bool &good) const =0
Calculate the correction for tabulated energy energy_ndx.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloUtils::ToolConstantsContext
Context object for retrieving ToolConstant values.
Definition: ToolWithConstants.h:61
CaloClusterCorrectionCommon::EME1
@ EME1
Definition: CaloClusterCorrectionCommon.h:108
CaloClusterCorrectionCommon::~CaloClusterCorrectionCommon
virtual ~CaloClusterCorrectionCommon()
Destructor.
CaloClusterCorrection
Definition: CaloClusterCorrection.h:55
CaloClusterCorrectionCommon
Code common to cluster corrections.
Definition: CaloClusterCorrectionCommon.h:42
CaloClusterCorrectionCommon::TableBuilder::~TableBuilder
virtual ~TableBuilder()
Definition: CaloClusterCorrectionCommon.h:129
CaloUtils::ToolConstant
Constant of a ToolWithConstants.
Definition: ToolWithConstants.h:202
CaloClusterCorrectionCommon::EME2
@ EME2
Definition: CaloClusterCorrectionCommon.h:111
CaloClusterCorrectionCommon::m_region
Constant< int > m_region
Calibration constant: The calorimeter region for which this correction is intended.
Definition: CaloClusterCorrectionCommon.h:162