ATLAS Offline Software
egammaShowerShape.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #include "egammaShowerShape.h"
7 #include <cmath>
8 
10  const std::string& name,
11  const IInterface* parent)
12  : AthAlgTool(type, name, parent){
13  // declare Interface
14  declareInterface<IegammaShowerShape>(this);
15  }
16 
18  ATH_MSG_DEBUG(" Initializing egammaShowerShape");
19  return StatusCode::SUCCESS;
20 }
21 
23  return StatusCode::SUCCESS;
24 }
25 
27  const CaloDetDescrManager& cmgr,
28  const CaloCellContainer& cell_container,
29  Info& info) const {
30 
31  // check if cluster is in barrel or in the end-cap
32  if (!cluster.inBarrel() && !cluster.inEndcap()) {
33  ATH_MSG_WARNING(" egammaShowerShape: Cluster is neither in Barrel nor in "
34  "Endcap, cannot calculate ShowerShape ");
35  }
36 
37  egammaPreSamplerShape::Info egammaPreSamplerShapeInfo;
38  egammaStripsShape::Info egammaStripsShapeInfo;
39  egammaMiddleShape::Info egammaMiddleShapeInfo;
40  egammaBackShape::Info egammaBackShapeInfo;
41 
42  // shower shapes in presampler
44  // call execute method
46  cluster, cmgr, cell_container, egammaPreSamplerShapeInfo);
47  if (sc.isFailure()) {
48  ATH_MSG_WARNING("Presampler shape returned failure ");
49  }
50  }
51 
52  // shower shapes in 1st compartment
54  // call the execute method
55  StatusCode sc =
56  egammaStripsShape::execute(cluster, cmgr, egammaStripsShapeInfo);
57  if (sc.isFailure()) {
58  ATH_MSG_WARNING("Strip shape returned failure ");
59  }
60  }
61 
62  // shower shapes in 2nd compartment
64  // call the execute method
66  cluster, cmgr, cell_container, egammaMiddleShapeInfo);
67  if (sc.isFailure()) {
68  ATH_MSG_WARNING("Middle shape returned failure ");
69  }
70  }
71 
72  // shower shapes in 3rd compartment
74  // call execute method
76  cluster, cmgr, cell_container, egammaBackShapeInfo);
77  if (sc.isFailure()) {
78  ATH_MSG_DEBUG("Back shape returned failure ");
79  }
80  }
81  /*
82  * Fill egammaShowerShape object
83  * with values from other tools
84  */
85 
86  // presampler
87  info.e011 = egammaPreSamplerShapeInfo.e011;
88  info.e033 = egammaPreSamplerShapeInfo.e033;
89 
90  // strips
91  info.etot = egammaStripsShapeInfo.etot;
92  info.e1152 = egammaStripsShapeInfo.e1152;
93  info.e132 = egammaStripsShapeInfo.e132;
94  info.emaxs1 = egammaStripsShapeInfo.emaxs1;
95  info.emins1 = egammaStripsShapeInfo.emins1;
96  info.esec = egammaStripsShapeInfo.esec;
97  info.esec1 = egammaStripsShapeInfo.esec1;
98  info.f1 = egammaStripsShapeInfo.f1;
99  info.f1core = egammaStripsShapeInfo.f1core;
100  info.f2 = egammaStripsShapeInfo.f2;
101  info.ncetamax = egammaStripsShapeInfo.ncetamax;
102  info.ncetaseed = egammaStripsShapeInfo.ncetaseed;
103  info.etas3 = egammaStripsShapeInfo.etas3;
104  info.poscs1 = egammaStripsShapeInfo.poscs1;
105  info.deltaEtaTrackShower = egammaStripsShapeInfo.deltaEtaTrackShower;
106  info.deltaEtaTrackShower7 = egammaStripsShapeInfo.deltaEtaTrackShower7;
107  info.wstot = egammaStripsShapeInfo.wstot;
108  info.ws3 = egammaStripsShapeInfo.ws3;
109  info.ws3c = egammaStripsShapeInfo.ws3c;
110  info.widths5 = egammaStripsShapeInfo.widths5;
111  info.asymmetrys3 = egammaStripsShapeInfo.asymmetrys3;
112  info.val = egammaStripsShapeInfo.val;
113  info.fside = egammaStripsShapeInfo.fside;
114  info.success = egammaStripsShapeInfo.success;
115 
116  // middle
117  info.e233 = egammaMiddleShapeInfo.e233;
118  info.e235 = egammaMiddleShapeInfo.e235;
119  info.e255 = egammaMiddleShapeInfo.e255;
120  info.e237 = egammaMiddleShapeInfo.e237;
121  info.e277 = egammaMiddleShapeInfo.e277;
122  info.etaw = egammaMiddleShapeInfo.etaw;
123  info.width = egammaMiddleShapeInfo.width;
124  info.phiw = egammaMiddleShapeInfo.phiw;
125  info.poscs2 = egammaMiddleShapeInfo.poscs2;
126 
127  // back
128  info.e333 = egammaBackShapeInfo.e333;
129  info.e335 = egammaBackShapeInfo.e335;
130  info.e355 = egammaBackShapeInfo.e355;
131  info.e337 = egammaBackShapeInfo.e337;
132  info.e377 = egammaBackShapeInfo.e377;
133  info.f3 = egammaBackShapeInfo.f3;
134  info.f3core = egammaBackShapeInfo.f3core;
135 
136  // shower shapes combined in different samplings
138  /* Shower shapes combining different samplings
139  * all energy values have to be initialised to zero
140  * which is equivalent to have nothing (if it does not exists)
141  * or 0 if there is no deposit
142  */
143 
144  // energy in 3 strips in the 1st sampling
145  double e132 = (info.e132 > -999.) ? info.e132 : 0.;
146 
147  // energy in 1X1 in the presampler
148  double e011 = (info.e011 > -999.) ? info.e011 : 0.;
149  // energy in 3X3 in the presampler
150  double e033 = (info.e033 > -999.) ? info.e033 : 0.;
151  // energy in 15 strips in the 1st sampling
152  double e1152 = (info.e1152 > -999.) ? info.e1152 : 0.;
153  // energy in 3X3 in the 2nd sampling
154  double e233 = (info.e233 > -999.) ? info.e233 : 0.;
155  // energy in 5X5 in the 2nd sampling
156  double e255 = (info.e255 > -999.) ? info.e255 : 0.;
157  // energy in 3X7 in the 2nd sampling
158  double e237 = (info.e237 > -999.) ? info.e237 : 0.;
159  // energy in 3X3 in the 3rd sampling
160  double e333 = (info.e333 > -999.) ? info.e333 : 0.;
161  // energy in 3X5 in the 3rd sampling
162  double e335 = (info.e335 > -999.) ? info.e335 : 0.;
163  // energy in 3X7 in the 3rd sampling
164  double e337 = (info.e337 > -999.) ? info.e337 : 0.;
165 
166  /*energy in core of the shower
167  * 3X3 in the presampler (info.e033)
168  * 15X2 in the strips (info.e1152)
169  * 5X5 in the middle (info.e255)
170  * 3X5 in the back (info.e335)
171  */
172  info.ecore = e033 + e1152 + e255 + e335;
173 
174  /* e 3X3 / e 3X7, the ratio of energies deposited
175  * in a 3X3 and 3X7 clusters. More precisely,
176  * for the 3X3 cluster, sampling by sampling, the cell energies
177  * are summed on the following eta by phi windows
178  * 1X1 in the presampler (info.e011)
179  * 3X2 in the strips (info.e132)
180  * 3X3 in the middle (info.e233)
181  * 3X3 in the back (info.e333)
182  * for the 7X3 cluster, sampling by sampling, the cell energies
183  * are summed on the following eta by phi windows
184  * 3X3 in the presampler (info.e033)
185  * 15X2 in the strips (info.e1152)
186  * 3X7 in the middle (info.e237)
187  * 3X7 in the back (info.e337)
188  */
189  double e33 = e011 + e132 + e233 + e333;
190  double e37 = e033 + e1152 + e237 + e337;
191  info.reta3337_allcalo = fabs(e37) > 0. ? 1. - e33 / e37 : 1.;
192  }
193  return StatusCode::SUCCESS;
194 }
195 
grepfile.info
info
Definition: grepfile.py:38
xAOD::EgammaParameters::e233
@ e233
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x3 (in cell units e...
Definition: EgammaEnums.h:68
egammaShowerShape::m_ExecEMThird
Gaudi::Property< bool > m_ExecEMThird
boolean to calculate variables for 3rd sampling
Definition: egammaShowerShape.h:76
IegammaShowerShape::Info
the info payload
Definition: IegammaShowerShape.h:41
egammaStripsShape::Info::ncetamax
int ncetamax
Definition: egammaStripsShape.h:56
egammaShowerShape.h
egammaPreSamplerShape::Info::e011
double e011
Definition: egammaPreSamplerShape.h:26
xAOD::EgammaParameters::e033
@ e033
uncalibrated energy (sum of cells) in presampler in a 3x3 window in cells in eta X phi
Definition: EgammaEnums.h:33
egammaShowerShape::m_ExecEMFirst
Gaudi::Property< bool > m_ExecEMFirst
boolean to calculate variables for 1st sampling
Definition: egammaShowerShape.h:68
egammaStripsShape::Info::success
bool success
Definition: egammaStripsShape.h:58
egammaMiddleShape::Info::e237
double e237
Definition: egammaMiddleShape.h:33
egammaPreSamplerShape::Info::e033
double e033
Definition: egammaPreSamplerShape.h:27
egammaStripsShape::Info::ncetaseed
int ncetaseed
Definition: egammaStripsShape.h:57
egammaStripsShape::Info::fside
double fside
Definition: egammaStripsShape.h:52
egammaPreSamplerShape::Info
Definition: egammaPreSamplerShape.h:25
egammaBackShape::Info::e355
double e355
Definition: egammaBackShape.h:35
egammaStripsShape::Info::etot
double etot
Definition: egammaStripsShape.h:35
egammaBackShape::Info::e335
double e335
Definition: egammaBackShape.h:34
egammaStripsShape::Info::esec1
double esec1
Definition: egammaStripsShape.h:55
egammaStripsShape::Info::widths5
double widths5
Definition: egammaStripsShape.h:49
egammaBackShape::Info::e337
double e337
Definition: egammaBackShape.h:36
egammaMiddleShape::Info::width
double width
Definition: egammaMiddleShape.h:38
egammaMiddleShape::Info::phiw
double phiw
Definition: egammaMiddleShape.h:37
egammaBackShape::execute
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info, bool ExecOtherVariables=true)
Definition: egammaBackShape.cxx:14
egammaShowerShape::m_ExecPreSampler
Gaudi::Property< bool > m_ExecPreSampler
boolean to calculate variables for presempler
Definition: egammaShowerShape.h:64
egammaShowerShape::m_ExecEMSecond
Gaudi::Property< bool > m_ExecEMSecond
boolean to calculate variables for 2nd sampling
Definition: egammaShowerShape.h:72
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
egammaShowerShape::initialize
StatusCode initialize() override
AlgTool initialize method.
Definition: egammaShowerShape.cxx:17
egammaStripsShape::Info::deltaEtaTrackShower
double deltaEtaTrackShower
Definition: egammaStripsShape.h:37
xAOD::EgammaParameters::e333
@ e333
uncalibrated energy (sum of cells) of the third sampling in a rectangle of size 3x3
Definition: EgammaEnums.h:83
xAOD::EgammaParameters::e1152
@ e1152
uncalibrated energy (sum of cells) in strips in a 15x2 window in cells in eta X phi
Definition: EgammaEnums.h:39
egammaBackShape::Info
Definition: egammaBackShape.h:30
egammaShowerShape::egammaShowerShape
egammaShowerShape(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: egammaShowerShape.cxx:9
egammaStripsShape::Info::deltaEtaTrackShower7
double deltaEtaTrackShower7
Definition: egammaStripsShape.h:38
egammaShowerShape::finalize
StatusCode finalize() override
AlgTool finalize method.
Definition: egammaShowerShape.cxx:22
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition: CaloCluster_v1.h:901
egammaShowerShape::execute
virtual StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info) const override final
AlgTool main method.
Definition: egammaShowerShape.cxx:26
egammaMiddleShape::Info::e277
double e277
Definition: egammaMiddleShape.h:35
CaloCluster.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
egammaMiddleShape::Info::etaw
double etaw
Definition: egammaMiddleShape.h:36
egammaMiddleShape::Info::poscs2
double poscs2
Definition: egammaMiddleShape.h:39
xAOD::EgammaParameters::e011
@ e011
uncalibrated energy (sum of cells) in presampler in a 1x1 window in cells in eta X phi
Definition: EgammaEnums.h:30
xAOD::CaloCluster_v1::inBarrel
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Definition: CaloCluster_v1.h:896
test_pyathena.parent
parent
Definition: test_pyathena.py:15
egammaShowerShape::m_ExecAllVariables
Gaudi::Property< bool > m_ExecAllVariables
boolean to calculate all variables
Definition: egammaShowerShape.h:60
egammaBackShape::Info::e333
double e333
Definition: egammaBackShape.h:33
egammaStripsShape::Info::e132
double e132
Definition: egammaStripsShape.h:39
egammaMiddleShape::Info::e235
double e235
Definition: egammaMiddleShape.h:32
egammaBackShape::Info::e377
double e377
Definition: egammaBackShape.h:37
egammaShowerShape::m_ExecEMCombined
Gaudi::Property< bool > m_ExecEMCombined
boolean to calculate combined variables
Definition: egammaShowerShape.h:80
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
egammaStripsShape::execute
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, Info &info, bool ExecAllVariables=true)
AlgTool main method.
Definition: egammaStripsShape.cxx:702
egammaStripsShape::Info::etas3
double etas3
Definition: egammaStripsShape.h:36
egammaStripsShape::Info::wstot
double wstot
Definition: egammaStripsShape.h:34
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
egammaStripsShape::Info::e1152
double e1152
Definition: egammaStripsShape.h:40
egammaBackShape::Info::f3
double f3
Definition: egammaBackShape.h:31
egammaMiddleShape::Info
Definition: egammaMiddleShape.h:30
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
egammaStripsShape::Info::val
double val
Definition: egammaStripsShape.h:51
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
egammaMiddleShape::Info::e233
double e233
Definition: egammaMiddleShape.h:31
xAOD::EgammaParameters::e255
@ e255
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 5x5
Definition: EgammaEnums.h:74
egammaStripsShape::Info::esec
double esec
Definition: egammaStripsShape.h:50
egammaStripsShape::Info::emins1
double emins1
Definition: egammaStripsShape.h:54
xAOD::EgammaParameters::e337
@ e337
uncalibrated energy (sum of cells) of the third sampling in a rectangle of size 3x7
Definition: EgammaEnums.h:89
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
egammaStripsShape::Info::poscs1
double poscs1
Definition: egammaStripsShape.h:43
egammaStripsShape::Info
Definition: egammaStripsShape.h:29
egammaMiddleShape::Info::e255
double e255
Definition: egammaMiddleShape.h:34
egammaPreSamplerShape::execute
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info)
Definition: egammaPreSamplerShape.cxx:13
xAOD::EgammaParameters::e132
@ e132
uncalibrated energy (sum of cells) in strips in a 3x2 window in cells in eta X phi
Definition: EgammaEnums.h:36
xAOD::EgammaParameters::e237
@ e237
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x7
Definition: EgammaEnums.h:77
AthAlgTool
Definition: AthAlgTool.h:26
egammaBackShape::Info::f3core
double f3core
Definition: egammaBackShape.h:32
egammaStripsShape::Info::emaxs1
double emaxs1
Definition: egammaStripsShape.h:53
xAOD::EgammaParameters::e335
@ e335
uncalibrated energy (sum of cells) of the third sampling in a rectangle of size 3x5
Definition: EgammaEnums.h:86
egammaStripsShape::Info::ws3
double ws3
Definition: egammaStripsShape.h:41
egammaStripsShape::Info::asymmetrys3
double asymmetrys3
Definition: egammaStripsShape.h:45
egammaMiddleShape::execute
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info, bool doRetaOnly=false)
Definition: egammaMiddleShape.cxx:17
egammaStripsShape::Info::f1core
double f1core
Definition: egammaStripsShape.h:47
egammaStripsShape::Info::f1
double f1
Definition: egammaStripsShape.h:46
egammaStripsShape::Info::f2
double f2
Definition: egammaStripsShape.h:48
egammaStripsShape::Info::ws3c
double ws3c
Definition: egammaStripsShape.h:42