ATLAS Offline Software
CaloFillRectangularCluster.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 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: CaloFillRectangularCluster.h,v 1.7 2009-04-25 17:57:00 ssnyder Exp $
36 #ifndef CALOCLUSTERCORRECTION_CALOFILLRECTANGULARCLUSTER_H
37 #define CALOCLUSTERCORRECTION_CALOFILLRECTANGULARCLUSTER_H
38 
39 
42 #include <string>
45 #include "GaudiKernel/ThreadLocalContext.h"
48 
49 
50 
51 // Helper object used for the per-sampling calculations.
52 namespace CaloClusterCorr {
53 class SamplingHelper;
54 }
55 //class CaloCluster;
56 class CaloCell;
57 class CaloCellContainer;
58 
59 
61  : public CaloClusterCorrection,
63 {
64 public:
71  CaloFillRectangularCluster(const std::string& type,
72  const std::string& name,
73  const IInterface* parent);
74 
80  virtual StatusCode initialize() override;
81 
87  virtual void makeCorrection (const Context& myctx,
88  xAOD::CaloCluster* cluster) const override;
89 
90 
91  // Alternate version that takes an EventContext.
92  void makeCorrection (const EventContext& ctx,
93  xAOD::CaloCluster* cluster) const
94  {
95  return makeCorrection (context(ctx), cluster);
96  }
97 
98 
99  /*
100  * @brief Return the seed position of a cluster.
101  * @param helper Sampling calculation helper object.
102  * @param cluster The cluster on which to operate.
103  * @param[out] eta The @f$\eta@f$ location of the cluster seed.
104  * @param[out] phi The @f$\phi@f$ location of the cluster seed.
105  *
106  * The cluster seed is the center of rectangular cluster windows.
107  * This may be overridden by derived classes to change the seed definition.
108  */
110  const xAOD::CaloCluster* cluster,
111  double& eta, double& phi) const;
112 
113 
118  virtual StatusCode setCaloCellContainerName (const std::string& name) override;
119 
120 
122  typedef std::array<std::pair<double, double>, 4> WindowArray_t;
123 
124 
134  virtual
135  WindowArray_t initWindows (const int neta,
136  const int nphi,
137  const double detas2,
138  const double dphis2) const;
139 
140 
141 
142 private:
143 
146 
147 
148  /*
149  * @brief Actually make the correction for one region (barrel or endcap).
150  * @param ctx The event context.
151  * @param helper Sampling calculation helper object.
152  * @param eta The @f$\eta@f$ seed of the cluster.
153  * @param phi The @f$\phi@f$ seed of the cluster.
154  * @param samplings List of samplings for this region.
155  */
156  void makeCorrection1 (const EventContext& ctx,
157  const CaloDetDescrManager& dd_man,
159  double eta,
160  double phi,
161  const CaloSampling::CaloSample samplings[4]) const;
162 
163 
164  /*
165  * @brief Execute the correction, given a helper object.
166  * @param ctx The event context.
167  * @param helper Sampling calculation helper object.
168  */
169  void makeCorrection2 (const EventContext& ctx,
170  const CaloDetDescrManager& dd_man,
172 
173 
174 protected:
176  double m_deta0 = 0.0, m_deta1 = 0.0, m_deta2 = 0.0, m_deta3 = 0.0;
177  double m_dphi0 = 0.0, m_dphi1 = 0.0, m_dphi2 = 0.0, m_dphi3 = 0.0;
178 
181 
186 
187 
191 
192 private:
196 
197 
198 };
199 
200 #endif // not CALOCLUSTERCORRECTION_CALOFILLRECTANGULARCLUSTER_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CaloFillRectangularCluster::initWindows
virtual WindowArray_t initWindows(const int neta, const int nphi, const double detas2, const double dphis2) const
Set up layer-by-layer cluster window sizes.
Definition: CaloFillRectangularCluster.cxx:1235
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ISetCaloCellContainerName
Allow changing the name of the CaloCellContainer used by a tool.
Definition: ISetCaloCellContainerName.h:23
CaloFillRectangularCluster::makeCorrection1
void makeCorrection1(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper, double eta, double phi, const CaloSampling::CaloSample samplings[4]) const
Definition: CaloFillRectangularCluster.cxx:823
CaloClusterCorr::SamplingHelper
Sampling calculator helper class.
Definition: CaloFillRectangularCluster.cxx:186
CaloFillRectangularCluster::CaloFillRectangularCluster
CaloFillRectangularCluster()=delete
This isn't allowed.
CaloFillRectangularCluster::m_neta
int m_neta
cluster size. These are properties.
Definition: CaloFillRectangularCluster.h:180
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloFillRectangularCluster::makeCorrection2
void makeCorrection2(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper) const
Definition: CaloFillRectangularCluster.cxx:954
ISetCaloCellContainerName.h
CaloClusterCorr
Definition: CaloClusterCorrectionCommon.h:22
SG::ReadHandleKey< CaloCellContainer >
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloFillRectangularCluster::m_dphi0
double m_dphi0
Definition: CaloFillRectangularCluster.h:177
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloFillRectangularCluster::m_cellsName
SG::ReadHandleKey< CaloCellContainer > m_cellsName
The StoreGate key for the container of our input cells.
Definition: CaloFillRectangularCluster.h:195
CaloFillRectangularCluster::makeCorrection
void makeCorrection(const EventContext &ctx, xAOD::CaloCluster *cluster) const
Definition: CaloFillRectangularCluster.h:92
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloFillRectangularCluster::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition: CaloFillRectangularCluster.cxx:801
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloFillRectangularCluster::m_deta1
double m_deta1
Definition: CaloFillRectangularCluster.h:176
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloFillRectangularCluster::m_nphi
int m_nphi
Definition: CaloFillRectangularCluster.h:180
CaloFillRectangularCluster::m_dphi1
double m_dphi1
Definition: CaloFillRectangularCluster.h:177
CaloFillRectangularCluster
Definition: CaloFillRectangularCluster.h:63
CaloClusterCorrection.h
CaloFillRectangularCluster::setCaloCellContainerName
virtual StatusCode setCaloCellContainerName(const std::string &name) override
Change the name of the CaloCellContainer used by this tool.
Definition: CaloFillRectangularCluster.cxx:1219
ReadCondHandleKey.h
CaloFillRectangularCluster::WindowArray_t
std::array< std::pair< double, double >, 4 > WindowArray_t
Holds the per-layer window sizes.
Definition: CaloFillRectangularCluster.h:122
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloUtils::ToolWithConstants< CaloClusterProcessor >::context
Context context(const EventContext &ctx) const
Create a Context object.
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloFillRectangularCluster::m_dphi2
double m_dphi2
Definition: CaloFillRectangularCluster.h:177
CaloFillRectangularCluster::m_setRawState
bool m_setRawState
Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state
Definition: CaloFillRectangularCluster.h:190
CaloFillRectangularCluster::m_deta0
double m_deta0
Cell window sizes in each sampling.
Definition: CaloFillRectangularCluster.h:176
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloFillRectangularCluster::m_deta3
double m_deta3
Definition: CaloFillRectangularCluster.h:176
CaloFillRectangularCluster::m_fill_cluster
bool m_fill_cluster
Fill-cluster flag.
Definition: CaloFillRectangularCluster.h:185
CaloFillRectangularCluster::m_deta2
double m_deta2
Definition: CaloFillRectangularCluster.h:176
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloUtils::ToolConstantsContext
Context object for retrieving ToolConstant values.
Definition: ToolWithConstants.h:61
IOVSvcDefs.h
defines and typedefs for IOVSvc
CaloFillRectangularCluster::get_seed
virtual void get_seed(CaloClusterCorr::SamplingHelper &helper, const xAOD::CaloCluster *cluster, double &eta, double &phi) const
Definition: CaloFillRectangularCluster.cxx:1153
CaloFillRectangularCluster::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
CaloClusterCorrection virtual method.
CaloClusterCorrection
Definition: CaloClusterCorrection.h:55
CaloFillRectangularCluster::m_dphi3
double m_dphi3
Definition: CaloFillRectangularCluster.h:177