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

EM cluster shower shape calculations in 3rd sampling. Calculate the width in the back layer around the eta,phi of the hottest cell in the middle layer. More...

#include <egammaBackShape.h>

Collaboration diagram for egammaBackShape:

Classes

struct  Info
 

Static Public Member Functions

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

Detailed Description

EM cluster shower shape calculations in 3rd sampling. Calculate the width in the back 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 26 of file egammaBackShape.h.

Member Function Documentation

◆ execute()

StatusCode egammaBackShape::execute ( const xAOD::CaloCluster cluster,
const CaloDetDescrManager cmgr,
const CaloCellContainer cell_container,
Info info,
bool  ExecOtherVariables = true 
)
static

Definition at line 14 of file egammaBackShape.cxx.

19 {
20  //
21  // Estimate shower shapes from third compartment
22  // based on hottest cell and deta,dphi
23  // with eta = cluster->eta(sam)
24  // phi = cluster->phi(sam)
25  //
26 
27  // check if cluster is in barrel or in the end-cap
28  if (!cluster.inBarrel() && !cluster.inEndcap()) {
29  return StatusCode::SUCCESS;
30  }
31 
32  double eallsamples = egammaEnergyPositionAllSamples::e(cluster);
33  double e3 = egammaEnergyPositionAllSamples::e3(cluster);
34 
35  // fraction of energy deposited in third sampling
36  info.f3 = std::abs(eallsamples) > 0. ? e3 / eallsamples : 0.;
37 
38  // check if cluster is in barrel or end-cap
39  const bool in_barrel = egammaEnergyPositionAllSamples::inBarrel(cluster, 3);
40 
41  // define accordingly position of CaloSampling
44 
46  bool barrel = false;
47  int sampling_or_module = 0;
48 
49  // From the original (eta,phi) position, find the location
50  // (sampling, barrel/end-cap, granularity)
51  // For this we use the tool egammaEnergyAllSamples
52  // which uses the CaloCluster method inBarrel() and inEndcap()
53  // but also, in case close to the crack region where both
54  // boolean can be true, the energy reconstructed in the sampling
55  //
56 
57  // Fetch eta and phi of the sampling
58  // Note that we use m_sam2 in the 2nd sampling, not in presampler
59  double eta = cluster.etamax(sam2);
60  double phi = cluster.phimax(sam2);
61 
62  if ((eta == 0. && phi == 0.) || std::abs(eta) > 100) {
63  return StatusCode::SUCCESS;
64  }
65 
66  // granularity in (eta,phi) in the pre sampler
67  // CaloCellList needs both enums: subCalo and CaloSample
68  CaloDetDescrManager::decode_sample(subcalo, barrel, sampling_or_module, sam);
69 
70  // Get the corresponding grannularities : needs to know where you are
71  // the easiest is to look for the CaloDetDescrElement
72  const CaloDetDescrElement* dde =
73  cmgr.get_element(subcalo, sampling_or_module, barrel, eta, phi);
74  // if object does not exist then return
75  if (!dde) {
76  return StatusCode::SUCCESS;
77  }
78 
79  // local granularity
80  double deta = dde->deta();
81  double dphi = dde->dphi();
82  // change values of eta,phi
83  eta = dde->eta_raw();
84  phi = dde->phi_raw();
85 
86  // estimate the relevant quantities around the hottest cell
87  // in the following eta X phi windows
89 
90  // 3X3
91  StatusCode sc =
92  calc.fill(cmgr, &cell_container, eta, phi, 3. * deta, 3. * dphi, sam);
93  if (sc.isFailure()) {
94  return sc;
95  }
96  info.e333 = calc.em();
97 
98  if (ExecOtherVariables) {
99 
100  CaloCellList cell_list(&cmgr, &cell_container);
101  // 7x7
102  cell_list.select(eta, phi, 7.0 * deta, 7.0 * dphi, sam);
103 
104  calc.fill(
105  cell_list.begin(), cell_list.end(), eta, phi, 7. * deta, 7. * dphi, sam);
106  info.e377 = calc.em();
107 
108  // 5X5
109  calc.fill(
110  cell_list.begin(), cell_list.end(), eta, phi, 5. * deta, 5. * dphi, sam);
111  info.e355 = calc.em();
112 
113  // 3X7
114  calc.fill(
115  cell_list.begin(), cell_list.end(), eta, phi, 3. * deta, 7. * dphi, sam);
116  info.e337 = calc.em();
117 
118  // 3X5
119  calc.fill(
120  cell_list.begin(), cell_list.end(), eta, phi, 3. * deta, 5. * dphi, sam);
121  info.e335 = calc.em();
122  }
123 
124  // f3core
125  if (eallsamples > 0. && info.e333 > -999.) {
126  info.f3core = info.e333 / eallsamples;
127  }
128 
129  return StatusCode::SUCCESS;
130 }

The documentation for this class was generated from the following files:
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
grepfile.info
info
Definition: grepfile.py:38
xAOD::CaloCluster_v1::phimax
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
Definition: CaloCluster_v1.cxx:589
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
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition: CaloCluster_v1.h:901
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
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
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
egammaEnergyPositionAllSamples::e
double e(const xAOD::CaloCluster &cluster)
return the uncorrected sum of energy in all samples
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
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
egammaEnergyPositionAllSamples::e3
double e3(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 3rd sampling
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
beamspotnt.calc
calc
Definition: bin/beamspotnt.py:1252
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352