ATLAS Offline Software
Loading...
Searching...
No Matches
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
65 StatusCode sc = egammaMiddleShape::execute(
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
75 StatusCode sc = egammaBackShape::execute(
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
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Container class for CaloCell.
This class provides the client interface for accessing the detector description information common to...
virtual StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info) const override final
AlgTool main method.
Gaudi::Property< bool > m_ExecPreSampler
boolean to calculate variables for presempler
Gaudi::Property< bool > m_ExecEMSecond
boolean to calculate variables for 2nd sampling
egammaShowerShape(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
StatusCode initialize() override
AlgTool initialize method.
StatusCode finalize() override
AlgTool finalize method.
Gaudi::Property< bool > m_ExecEMCombined
boolean to calculate combined variables
Gaudi::Property< bool > m_ExecEMFirst
boolean to calculate variables for 1st sampling
Gaudi::Property< bool > m_ExecEMThird
boolean to calculate variables for 3rd sampling
Gaudi::Property< bool > m_ExecAllVariables
boolean to calculate all variables
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info, bool ExecOtherVariables=true)
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info, bool doRetaOnly=false)
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info)
static StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, Info &info, bool ExecAllVariables=true)
AlgTool main method.