ATLAS Offline Software
Loading...
Searching...
No Matches
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-2026 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 $
34
35
36#ifndef CALOCLUSTERCORRECTION_CALOFILLRECTANGULARCLUSTER_H
37#define CALOCLUSTERCORRECTION_CALOFILLRECTANGULARCLUSTER_H
38
39
42#include <string>
46
47
48
49// Helper object used for the per-sampling calculations.
50namespace CaloClusterCorr {
51class SamplingHelper;
52}
53//class CaloCluster;
54class CaloCell;
56
57
59 : public CaloClusterCorrection,
61{
62public:
69 CaloFillRectangularCluster(const std::string& type,
70 const std::string& name,
71 const IInterface* parent);
72
78 virtual StatusCode initialize() override;
79
85 virtual void makeCorrection (const Context& myctx,
86 xAOD::CaloCluster* cluster) const override;
87
88
89 // Alternate version that takes an EventContext.
90 void makeCorrection (const EventContext& ctx,
91 xAOD::CaloCluster* cluster) const
92 {
93 return makeCorrection (context(ctx), cluster);
94 }
95
96
97 /*
98 * @brief Return the seed position of a cluster.
99 * @param helper Sampling calculation helper object.
100 * @param cluster The cluster on which to operate.
101 * @param[out] eta The @f$\eta@f$ location of the cluster seed.
102 * @param[out] phi The @f$\phi@f$ location of the cluster seed.
103 *
104 * The cluster seed is the center of rectangular cluster windows.
105 * This may be overridden by derived classes to change the seed definition.
106 */
107 virtual void get_seed (CaloClusterCorr::SamplingHelper& helper,
108 const xAOD::CaloCluster* cluster,
109 double& eta, double& phi) const;
110
111
116 virtual StatusCode setCaloCellContainerName (const std::string& name) override;
117
118
120 typedef std::array<std::pair<double, double>, 4> WindowArray_t;
121
122
132 virtual
133 WindowArray_t initWindows (const int neta,
134 const int nphi,
135 const double detas2,
136 const double dphis2) const;
137
138
139
140private:
141
144
145
146 /*
147 * @brief Actually make the correction for one region (barrel or endcap).
148 * @param ctx The event context.
149 * @param helper Sampling calculation helper object.
150 * @param eta The @f$\eta@f$ seed of the cluster.
151 * @param phi The @f$\phi@f$ seed of the cluster.
152 * @param samplings List of samplings for this region.
153 */
154 void makeCorrection1 (const EventContext& ctx,
155 const CaloDetDescrManager& dd_man,
157 double eta,
158 double phi,
159 const CaloSampling::CaloSample samplings[4]) const;
160
161
162 /*
163 * @brief Execute the correction, given a helper object.
164 * @param ctx The event context.
165 * @param helper Sampling calculation helper object.
166 */
167 void makeCorrection2 (const EventContext& ctx,
168 const CaloDetDescrManager& dd_man,
169 CaloClusterCorr::SamplingHelper& helper) const;
170
171
172protected:
174 double m_deta0 = 0.0, m_deta1 = 0.0, m_deta2 = 0.0, m_deta3 = 0.0;
175 double m_dphi0 = 0.0, m_dphi1 = 0.0, m_dphi2 = 0.0, m_dphi3 = 0.0;
176
178 Gaudi::Property<int> m_neta{this, "eta_size", 5};
179 Gaudi::Property<int> m_nphi{this, "phi_size", 5};
180
184 Gaudi::Property<bool> m_fill_cluster{this, "fill_cluster", true};
185
186
189 Gaudi::Property<bool> m_setRawState{this, "set_raw_state", true};
190
191private:
194 SG::ReadHandleKey<CaloCellContainer> m_cellsName{this, "cells_name", "AllCalo"};
195};
196
197#endif // not CALOCLUSTERCORRECTION_CALOFILLRECTANGULARCLUSTER_H
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Definition of CaloDetDescrManager.
Property holding a SG store/key/clid from which a ReadHandle is made.
Container class for CaloCell.
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
Sampling calculator helper class.
This class provides the client interface for accessing the detector description information common to...
Gaudi::Property< int > m_neta
cluster size. These are properties.
Gaudi::Property< bool > m_fill_cluster
Fill-cluster flag.
SG::ReadHandleKey< CaloCellContainer > m_cellsName
The StoreGate key for the container of our input cells.
Gaudi::Property< bool > m_setRawState
Property to tell if the raw energy, eta0 and phi0 should be saved as uncalibrated signal state.
virtual void get_seed(CaloClusterCorr::SamplingHelper &helper, const xAOD::CaloCluster *cluster, double &eta, double &phi) const
std::array< std::pair< double, double >, 4 > WindowArray_t
Holds the per-layer window sizes.
void makeCorrection2(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper) const
CaloFillRectangularCluster()=delete
This isn't allowed.
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
CaloClusterCorrection virtual method.
void makeCorrection1(const EventContext &ctx, const CaloDetDescrManager &dd_man, CaloClusterCorr::SamplingHelper &helper, double eta, double phi, const CaloSampling::CaloSample samplings[4]) const
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.
virtual StatusCode initialize() override
Standard Gaudi initialize method.
double m_deta0
Cell window sizes in each sampling.
virtual StatusCode setCaloCellContainerName(const std::string &name) override
Change the name of the CaloCellContainer used by this tool.
void makeCorrection(const EventContext &ctx, xAOD::CaloCluster *cluster) const
CaloFillRectangularCluster(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi constructor.
Allow changing the name of the CaloCellContainer used by a tool.
Property holding a SG store/key/clid from which a ReadHandle is made.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.