ATLAS Offline Software
Loading...
Searching...
No Matches
egammaPreSamplerShape Class Reference

EM cluster shower shape calculations in presampler of ECAL. More...

#include <egammaPreSamplerShape.h>

Collaboration diagram for egammaPreSamplerShape:

Classes

struct  Info

Static Public Member Functions

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

Detailed Description

EM cluster shower shape calculations in presampler of ECAL.

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

Definition at line 21 of file egammaPreSamplerShape.h.

Member Function Documentation

◆ execute()

StatusCode egammaPreSamplerShape::execute ( const xAOD::CaloCluster & cluster,
const CaloDetDescrManager & cmgr,
const CaloCellContainer & cell_container,
Info & info )
static

Definition at line 13 of file egammaPreSamplerShape.cxx.

17{
18 //
19 // Estimate shower shapes in pre sampler
20 // based on hottest cell and deta,dphi windows
21 // defined from the pre sampler granularity
22 // with eta = cluster->etaSample(sam)
23 // phi = cluster->phiSample(sam)
24 // deta = 0.025
25 // dphi = 10.*0.1*(2.*M_PI/64)
26 //
27
28 // check if cluster is in barrel or in the end-cap
29 if (!cluster.inBarrel() && !cluster.inEndcap()) {
30 return StatusCode::SUCCESS;
31 }
32 // check if cluster is in barrel or end-cap
33 const bool in_barrel = egammaEnergyPositionAllSamples::inBarrel(cluster, 0);
34
35 // define accordingly the position of CaloSampling
36 const CaloSampling::CaloSample sam = in_barrel ? CaloSampling::PreSamplerB : CaloSampling::PreSamplerE;
37 const CaloSampling::CaloSample sam2 = in_barrel ? CaloSampling::EMB2 : CaloSampling::EME2;
38
39 //
40 // From the original (eta,phi) position, find the location
41 // (sampling, barrel/end-cap, granularity)
42 // For this we use the tool egammaEnergyAllSamples
43 // which uses the CaloCluster method inBarrel() and inEndcap()
44 // but also, in case close to the crack region where both
45 // boolean can be true, the energy reconstructed in the sampling
46 //
47
48 // Fetch eta and phi of the sampling
49 // Note that we use m_sam2 in the 2nd sampling, not in presampler
50 double eta = cluster.etamax(sam2);
51 double phi = cluster.phimax(sam2);
52
53 // bad patch to avoid crash with dde
54 if ((eta == 0. && phi == 0.) || std::abs(eta) > 100) {
55 return StatusCode::SUCCESS;
56 }
57 // granularity in (eta,phi) in the pre sampler
59 bool barrel = false;
60 int sampling_or_module = 0;
61 // CaloCellList needs both enums: subCalo and CaloSample
62 CaloDetDescrManager::decode_sample(subcalo, barrel, sampling_or_module, sam);
63
64 // Get the corresponding grannularities : needs to know where you are
65 // the easiest is to look for the CaloDetDescrElement
66 const CaloDetDescrElement* dde =
67 cmgr.get_element(subcalo, sampling_or_module, barrel, eta, phi);
68 // if object does not exist then return
69 if (!dde) {
70 return StatusCode::SUCCESS;
71 }
72 // local granularity
73 double deta = dde->deta();
74 double dphi = dde->dphi();
75 // change eta,phi values
76 eta = dde->eta_raw();
77 phi = dde->phi_raw();
78 // estimate the relevant quantities around the hottest cell
79 // in the following eta X phi windows
80 CaloLayerCalculator calc;
81 StatusCode sc = StatusCode::SUCCESS;
82 // 1X1
83 sc = calc.fill(cmgr, &cell_container, eta, phi, deta, dphi, sam);
84 if (sc.isFailure()) {
85 return sc;
86 }
87 info.e011 = calc.em();
88 // 3X3
89 sc = calc.fill(cmgr, &cell_container, eta, phi, 3. * deta, 3. * dphi, sam);
90 if (sc.isFailure()) {
91 return sc;
92 }
93 info.e033 = calc.em();
94 return StatusCode::SUCCESS;
95}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
static Double_t sc
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
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:
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.
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool inBarrel(const xAOD::CaloCluster &cluster, int is)
return boolean to know if we are in barrel/end-cap

The documentation for this class was generated from the following files: