ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaCaloUtils
src
CookieCutterHelpers.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/CookieCutterHelpers.h
"
6
#include "
CaloGeoHelpers/proxim.h
"
7
8
namespace
CookieCutterHelpers
9
{
10
CentralPosition::CentralPosition
(
11
const
std::vector<const xAOD::CaloCluster*>& clusters,
12
const
CaloDetDescrManager
& mgr)
13
:
AthMessaging
(
"CookieCutterHelpers::CentralPosition"
)
14
{
15
for
(
const
auto
* cluster : clusters) {
16
if
(cluster->hasSampling(CaloSampling::EMB2)) {
17
const
float
thisEmax = cluster->energy_max(CaloSampling::EMB2);
18
if
(thisEmax >
emaxB
) {
19
emaxB
= thisEmax;
20
etaB
= cluster->etamax(CaloSampling::EMB2);
21
phiB
= cluster->phimax(CaloSampling::EMB2);
22
}
23
}
24
if
(cluster->hasSampling(CaloSampling::EME2)) {
25
const
float
thisEmax = cluster->energy_max(CaloSampling::EME2);
26
if
(thisEmax >
emaxEC
) {
27
emaxEC
= thisEmax;
28
etaEC
= cluster->etamax(CaloSampling::EME2);
29
phiEC
= cluster->phimax(CaloSampling::EME2);
30
}
31
}
32
if
(cluster->hasSampling(CaloSampling::FCAL0)) {
33
const
float
thisEmax = cluster->energy_max(CaloSampling::FCAL0);
34
if
(thisEmax >
emaxF
) {
35
emaxF
= thisEmax;
36
etaF
= cluster->etamax(CaloSampling::FCAL0);
37
phiF
= cluster->phimax(CaloSampling::FCAL0);
38
}
39
}
40
}
41
42
if
(
emaxB
> 0) {
43
const
CaloDetDescrElement
* dde =
44
mgr.get_element(CaloCell_ID::EMB2,
etaB
,
phiB
);
45
if
(dde) {
46
etaB
= dde->
eta_raw
();
47
phiB
= dde->
phi_raw
();
48
}
else
{
49
ATH_MSG_WARNING
(
"Couldn't get CaloDetDescrElement from mgr for eta = "
50
<<
etaB
<<
", phi = "
<<
phiB
);
51
}
52
}
53
if
(
emaxEC
> 0) {
54
const
CaloDetDescrElement
* dde =
55
mgr.get_element(CaloCell_ID::EME2,
etaEC
,
phiEC
);
56
if
(dde) {
57
etaEC
= dde->
eta_raw
();
58
phiEC
= dde->
phi_raw
();
59
}
else
{
60
ATH_MSG_WARNING
(
"Couldn't get CaloDetDescrElement from mgr for eta = "
61
<<
etaEC
<<
", phi = "
<<
phiEC
);
62
}
63
}
64
if
(
emaxF
> 0) {
65
const
CaloDetDescrElement
* dde =
66
mgr.get_element(CaloCell_ID::FCAL0,
etaF
,
phiF
);
67
if
(dde) {
68
etaF
= dde->
eta_raw
();
69
phiF
= dde->
phi_raw
();
70
}
else
{
71
ATH_MSG_WARNING
(
"Couldn't get CaloDetDescrElement from mgr for eta = "
72
<<
etaF
<<
", phi = "
<<
phiF
);
73
}
74
}
75
}
76
77
PhiSize::PhiSize
(
const
CentralPosition
& cp0,
const
xAOD::CaloCluster
& cluster)
78
{
79
auto
cell_itr = cluster.
cell_cbegin
();
80
auto
cell_end = cluster.
cell_cend
();
81
for
(; cell_itr != cell_end; ++cell_itr) {
82
83
const
CaloCell
* cell = *cell_itr;
84
if
(!cell) {
85
continue
;
86
}
87
88
const
CaloDetDescrElement
* dde = cell->caloDDE();
89
if
(!dde) {
90
continue
;
91
}
92
93
if
(cp0.
emaxB
> 0 && CaloCell_ID::EMB2 == dde->
getSampling
()) {
94
const
float
phi0 = cp0.
phiB
;
95
double
cell_phi =
proxim
(dde->
phi_raw
(), phi0);
96
if
(cell_phi > phi0) {
97
auto
diff
= cell_phi - phi0;
98
if
(
diff
>
plusB
) {
99
plusB
=
diff
;
100
}
101
}
else
{
102
auto
diff
= phi0 - cell_phi;
103
if
(
diff
>
minusB
) {
104
minusB
=
diff
;
105
}
106
}
107
}
else
if
(cp0.
emaxEC
> 0 && CaloCell_ID::EME2 == dde->
getSampling
()) {
108
const
float
phi0 = cp0.
phiEC
;
109
double
cell_phi =
proxim
(dde->
phi_raw
(), phi0);
110
if
(cell_phi > phi0) {
111
auto
diff
= cell_phi - phi0;
112
if
(
diff
>
plusEC
) {
113
plusEC
=
diff
;
114
}
115
}
else
{
116
auto
diff
= phi0 - cell_phi;
117
if
(
diff
>
minusEC
) {
118
minusEC
=
diff
;
119
}
120
}
121
}
122
}
123
}
124
}
125
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
CookieCutterHelpers.h
diff
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Definition
Jet.cxx:631
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
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::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition
CaloDetDescrManager.h:469
xAOD::CaloCluster_v1::cell_cend
const_cell_iterator cell_cend() const
Definition
CaloCluster_v1.h:806
xAOD::CaloCluster_v1::cell_cbegin
const_cell_iterator cell_cbegin() const
Definition
CaloCluster_v1.h:798
CookieCutterHelpers
Definition
CookieCutterHelpers.h:14
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
proxim.h
proxim
double proxim(double b, double a)
Definition
proxim.h:17
CookieCutterHelpers::CentralPosition
Find the reference position (eta, phi) relative to which cells are restricted.
Definition
CookieCutterHelpers.h:19
CookieCutterHelpers::CentralPosition::CentralPosition
CentralPosition()=delete
CookieCutterHelpers::CentralPosition::phiB
float phiB
Definition
CookieCutterHelpers.h:21
CookieCutterHelpers::CentralPosition::etaEC
float etaEC
Definition
CookieCutterHelpers.h:23
CookieCutterHelpers::CentralPosition::emaxB
float emaxB
Definition
CookieCutterHelpers.h:22
CookieCutterHelpers::CentralPosition::phiF
float phiF
Definition
CookieCutterHelpers.h:27
CookieCutterHelpers::CentralPosition::emaxEC
float emaxEC
Definition
CookieCutterHelpers.h:25
CookieCutterHelpers::CentralPosition::emaxF
float emaxF
Definition
CookieCutterHelpers.h:28
CookieCutterHelpers::CentralPosition::etaB
float etaB
Definition
CookieCutterHelpers.h:20
CookieCutterHelpers::CentralPosition::phiEC
float phiEC
Definition
CookieCutterHelpers.h:24
CookieCutterHelpers::CentralPosition::etaF
float etaF
Definition
CookieCutterHelpers.h:26
CookieCutterHelpers::PhiSize::plusB
float plusB
Definition
CookieCutterHelpers.h:50
CookieCutterHelpers::PhiSize::plusEC
float plusEC
Definition
CookieCutterHelpers.h:52
CookieCutterHelpers::PhiSize::minusB
float minusB
Definition
CookieCutterHelpers.h:51
CookieCutterHelpers::PhiSize::minusEC
float minusEC
Definition
CookieCutterHelpers.h:53
CookieCutterHelpers::PhiSize::PhiSize
PhiSize()=default
Generated on
for ATLAS Offline Software by
1.17.0