ATLAS Offline Software
Classes | Static Public Member Functions | List of all members
egammaMiddleShape Class Reference

EM cluster shower shape calculations in 2nd ECAL sampling Calculate the width in the strip layer around the eta,phi of the hottest cell in the middle layer. More...

#include <egammaMiddleShape.h>

Collaboration diagram for egammaMiddleShape:

Classes

struct  Info
 

Static Public Member Functions

static StatusCode execute (const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cell_container, Info &info, bool doRetaOnly=false)
 

Detailed Description

EM cluster shower shape calculations in 2nd ECAL sampling Calculate the width in the strip layer around the eta,phi of the hottest cell in the middle layer.

Author
Frederic Derue derue.nosp@m.@lpn.nosp@m.he.in.nosp@m.2p3..nosp@m.fr
Christos Anastopoulos

Definition at line 27 of file egammaMiddleShape.h.

Member Function Documentation

◆ execute()

StatusCode egammaMiddleShape::execute ( const xAOD::CaloCluster cluster,
const CaloDetDescrManager cmgr,
const CaloCellContainer cell_container,
Info info,
bool  doRetaOnly = false 
)
static

Definition at line 17 of file egammaMiddleShape.cxx.

22 {
23  //
24  // Estimate shower shapes from 2nd compartment
25  // based on hottest cell and deta,dphi
26  // with eta = cluster->eta(sam)
27  // phi = cluster->phi(sam)
28  // and search for hottest cell in a 7X7 window
29  // in the second sampling
30  //
31  //
32  StatusCode sc = StatusCode::SUCCESS;
33  // check if cluster is in barrel or in the end-cap
34  if (!cluster.inBarrel() && !cluster.inEndcap()) {
35  return sc;
36  }
37 
38  // check if cluster is in barrel or end-cap
39  const bool in_barrel = egammaEnergyPositionAllSamples::inBarrel(cluster, 2);
40 
41  // define accordingly position of CaloSampling
43 
44  // granularity in (eta,phi) in the pre sampler
45  // CaloCellList needs both enums: subCalo and CaloSample
46  bool barrel = false;
48  int sampling_or_module = 0;
49 
50  float etacell = cluster.etamax(sam);
51  double eta = cluster.etaSample(sam);
52  double phi = cluster.phiSample(sam);
53  if ((eta == 0. && phi == 0.) || std::abs(eta) > 100) {
54  return sc;
55  }
56 
57  CaloDetDescrManager::decode_sample(subcalo, barrel, sampling_or_module, sam);
58 
59  // Get the corresponding grannularities : needs to know where you are
60  // the easiest is to look for the CaloDetDescrElement
61  const CaloDetDescrElement* dde =
62  cmgr.get_element(subcalo, sampling_or_module, barrel, eta, phi);
63  // if object does not exist then return
64  if (!dde) {
65  return sc;
66  }
67  // local granularity
68  double deta = dde->deta();
69  double dphi = dde->dphi();
70 
71  // Find the hottest cell
72  // in a 7x7 (7deta,7*dphi) window
73  // opened in the eta/phi of the
74  // cluster in this sampling
76  sc = calc.fill(cmgr,
77  &cell_container,
78  cluster.etaSample(sam),
79  cluster.phiSample(sam),
80  7. * deta,
81  7. * dphi,
82  sam);
83  double etamax = calc.etarmax();
84  double phimax = calc.phirmax();
85 
86  //select the widest cell list we will use
87  //i.e a 7x7 around the found hottest cell
88  CaloCellList cell_list(&cmgr, &cell_container);
89  cell_list.select(etamax, phimax, 7. * deta, 7. * dphi, sam);
90 
91  // Using that list do the filling
92  // of all the sub windows.
93 
94  // 7x7
95  calc.fill(cell_list.begin(),
96  cell_list.end(),
97  etamax,
98  phimax,
99  7. * deta,
100  7. * dphi,
101  sam);
102  info.e277 = calc.em();
103  // 3X7
104  calc.fill(cell_list.begin(),
105  cell_list.end(),
106  etamax,
107  phimax,
108  3. * deta,
109  7. * dphi,
110  sam);
111  info.e237 = calc.em();
112 
113  if (!doRetaOnly) {
114  // estimate the relevant quantities around the hottest cell
115  // in the following eta X phi windows
116  // 3X3
117  calc.fill(cell_list.begin(),
118  cell_list.end(),
119  etamax,
120  phimax,
121  3. * deta,
122  3. * dphi,
123  sam);
124  info.e233 = calc.em();
125  // 3X5
126  calc.fill(cell_list.begin(),
127  cell_list.end(),
128  etamax,
129  phimax,
130  3. * deta,
131  5. * dphi,
132  sam);
133  info.e235 = calc.em();
134  double etaw = calc.etas();
135  info.phiw = calc.phis();
136  info.etaw = egammaqweta2c::Correct(eta, etacell, etaw);
137  info.width = etaw;
138  info.poscs2 = egammaqweta2c::RelPosition(eta, etacell);
139  // 5X5
140  calc.fill(cell_list.begin(),
141  cell_list.end(),
142  etamax,
143  phimax,
144  5. * deta,
145  5. * dphi,
146  sam);
147  info.e255 = calc.em();
148  }
149  return sc;
150 }

The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
CaloCellList
Definition: CaloCellList.h:40
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
egammaEnergyPositionAllSamples::inBarrel
bool inBarrel(const xAOD::CaloCluster &cluster, int is)
return boolean to know if we are in barrel/end-cap
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
xAOD::CaloCluster_v1::etamax
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
Definition: CaloCluster_v1.cxx:576
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
xAOD::CaloCluster_v1::etaSample
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:532
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition: CaloCluster_v1.h:901
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
xAOD::CaloCluster_v1::inBarrel
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Definition: CaloCluster_v1.h:896
xAOD::CaloCluster_v1::phiSample
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:547
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
CaloLayerCalculator
Definition: CaloLayerCalculator.h:82
CaloDetDescrManager_Base::decode_sample
static void decode_sample(CaloCell_ID::SUBCALO &subCalo, bool &barrel, int &sampling_or_module, CaloCell_ID::CaloSample sample)
translate between the 2 ways to label a sub-detector:
Definition: CaloDetDescrManager.cxx:1468
DetectorZone::barrel
@ barrel
egammaqweta2c::RelPosition
double RelPosition(const float eta, const float etacell)
returns method within the cell
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
beamspotnt.calc
calc
Definition: bin/beamspotnt.py:1252
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
egammaqweta2c::Correct
float Correct(float eta, float etacell, float width)
returns corrected width at eta.