ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaCaloUtils
src
egammaBackShape.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
egammaCaloUtils/egammaBackShape.h
"
6
#include "
egammaCaloUtils/egammaEnergyPositionAllSamples.h
"
7
#include "
xAODCaloEvent/CaloCluster.h
"
8
9
#include "
CaloDetDescr/CaloDetDescrManager.h
"
10
#include "
CaloUtils/CaloLayerCalculator.h
"
11
#include "
CaloUtils/CaloCellList.h
"
12
13
StatusCode
14
egammaBackShape::execute
(
const
xAOD::CaloCluster
& cluster,
15
const
CaloDetDescrManager
& cmgr,
16
const
CaloCellContainer
& cell_container,
17
Info
& info,
18
bool
ExecOtherVariables)
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
42
const
CaloSampling::CaloSample
sam = in_barrel ? CaloSampling::EMB3 : CaloSampling::EME3;
43
const
CaloSampling::CaloSample
sam2 = in_barrel ? CaloSampling::EMB2 : CaloSampling::EME2;
44
45
CaloCell_ID::SUBCALO
subcalo =
CaloCell_ID::LAREM
;
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
88
CaloLayerCalculator
calc;
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
}
131
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
CaloCellList.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloLayerCalculator.h
Calculate total energy, position, etc. for a given layer of a cluster.
CaloCluster.h
DetectorZone::barrel
@ barrel
Definition
FPGATrackSimTypes.h:28
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCellList
Definition
CaloCellList.h:40
CaloCellList::end
list_iterator end() const
Definition
CaloCellList.h:95
CaloCellList::select
void select(double eta, double phi, double deta, double dphi)
Definition
CaloCellList.cxx:89
CaloCellList::begin
list_iterator begin() const
Definition
CaloCellList.h:89
CaloCell_Base_ID::LAREM
@ LAREM
Definition
CaloCell_Base_ID.h:45
CaloCell_ID::SUBCALO
CaloCell_Base_ID::SUBCALO SUBCALO
Definition
CaloCell_ID.h:50
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352
CaloDetDescrElement::deta
float deta() const
cell deta
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition
CaloDetDescrManager.cxx:159
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
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition
CaloDetDescrManager.h:469
CaloLayerCalculator
Definition
CaloLayerCalculator.h:82
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
xAOD::CaloCluster_v1::inBarrel
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Definition
CaloCluster_v1.h:887
xAOD::CaloCluster_v1::inEndcap
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
Definition
CaloCluster_v1.h:892
xAOD::CaloCluster_v1::etamax
float etamax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
Definition
CaloCluster_v1.cxx:569
xAOD::CaloCluster_v1::phimax
float phimax(const CaloSample sampling) const
Retrieve of cell with maximum energy in given sampling.
Definition
CaloCluster_v1.cxx:582
egammaBackShape.h
egammaEnergyPositionAllSamples.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
egammaEnergyPositionAllSamples::e3
double e3(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 3rd sampling
egammaEnergyPositionAllSamples::inBarrel
bool inBarrel(const xAOD::CaloCluster &cluster, int is)
return boolean to know if we are in barrel/end-cap
egammaEnergyPositionAllSamples::e
double e(const xAOD::CaloCluster &cluster)
return the uncorrected sum of energy in all samples
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
egammaBackShape::Info
Definition
egammaBackShape.h:30
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
Generated on
for ATLAS Offline Software by
1.17.0