ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
egammaD3PDAnalysis
src
egammaDeltaEmax2Alg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
12
#include "
egammaDeltaEmax2Alg.h
"
13
#include "
xAODCaloEvent/CaloCluster.h
"
14
#include "
AthenaKernel/errorcheck.h
"
15
#include <cmath>
16
17
18
namespace
D3PD
{
19
20
21
egammaDeltaEmax2Alg::egammaDeltaEmax2Alg
(
const
std::string& name,
22
ISvcLocator* svcloc)
23
:
AthAlgorithm
(name, svcloc),
24
m_getter
(this)
25
{
26
declareProperty
(
"AuxPrefix"
,
m_auxPrefix
,
27
"Prefix to add to aux data items."
);
28
declareProperty
(
"Getter"
,
m_getter
,
29
"Getter instance for the input egamma objects."
);
30
declareProperty
(
"AllowMissing"
,
m_allowMissing
=
false
,
31
"If true, don't complain if input objects are missing."
);
32
declareProperty
(
"HighLum"
,
m_highLum
=
false
,
33
"True if we should use the high-lum definition "
34
"of deltaEmax2."
);
35
}
36
37
41
StatusCode
egammaDeltaEmax2Alg::initialize
()
42
{
43
CHECK
( AthAlgorithm::initialize() );
44
CHECK
(
m_getter
.retrieve() );
45
CHECK
(
m_getter
->configureD3PD<
xAOD::Egamma
>() );
46
return
StatusCode::SUCCESS;
47
}
48
49
53
StatusCode
egammaDeltaEmax2Alg::execute
(
const
EventContext&
/*ctx*/
)
54
{
55
xAOD::Egamma::Decorator<float> deltaemax2 (
m_auxPrefix
+
"deltaEmax2"
);
56
57
CHECK
(
m_getter
->reset (
m_allowMissing
) );
58
while
(
const
xAOD::Egamma
* g =
m_getter
->next<
xAOD::Egamma
>())
59
{
60
deltaemax2(*g) = -999;
61
const
xAOD::CaloCluster
* cluster = g->caloCluster();
62
if
(cluster) {
63
double
eta2 = std::fabs(cluster->
etaBE
(2));
64
// Protect against soft E topo clusters that don't have samp info.
65
if
(eta2 > 900)
66
eta2 = std::fabs(cluster->
eta
());
67
double
et
= cluster->
e
()/std::cosh(eta2);
68
float
emax2 = 0;
69
emax2 = g->showerShapeValue (
xAOD::EgammaParameters::e2tsts1
);
70
71
if
(
m_highLum
)
72
deltaemax2(*g) = emax2/(1000.+0.0049*
et
);
73
else
74
deltaemax2(*g) = emax2/(1000.+0.009*
et
);
75
}
76
77
m_getter
->releaseElement (g);
78
}
79
80
return
StatusCode::SUCCESS;
81
}
82
83
84
}
// namespace D3PD
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CaloCluster.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
D3PD::egammaDeltaEmax2Alg::m_auxPrefix
std::string m_auxPrefix
Property: Prefix to add to aux data items.
Definition
egammaDeltaEmax2Alg.h:52
D3PD::egammaDeltaEmax2Alg::m_getter
ToolHandle< ICollectionGetterTool > m_getter
Property: Getter for input photon objects.
Definition
egammaDeltaEmax2Alg.h:55
D3PD::egammaDeltaEmax2Alg::m_allowMissing
bool m_allowMissing
Property: If true, don't complain if input objects are missing.
Definition
egammaDeltaEmax2Alg.h:58
D3PD::egammaDeltaEmax2Alg::egammaDeltaEmax2Alg
egammaDeltaEmax2Alg(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi algorithm constructor.
Definition
egammaDeltaEmax2Alg.cxx:21
D3PD::egammaDeltaEmax2Alg::m_highLum
bool m_highLum
Property: True if we should use the high-lum definition of deltaEmax2.
Definition
egammaDeltaEmax2Alg.h:61
D3PD::egammaDeltaEmax2Alg::execute
virtual StatusCode execute(const EventContext &ctx) override
Standard Gaudi execute method.
Definition
egammaDeltaEmax2Alg.cxx:53
D3PD::egammaDeltaEmax2Alg::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Definition
egammaDeltaEmax2Alg.cxx:41
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition
CaloCluster_v1.cxx:251
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition
CaloCluster_v1.cxx:265
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition
CaloCluster_v1.cxx:628
egammaDeltaEmax2Alg.h
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
xAOD::EgammaParameters::e2tsts1
@ e2tsts1
energy of the cell corresponding to second energy maximum in the first sampling
Definition
EgammaEnums.h:109
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::Egamma
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition
Egamma.h:17
et
Extra patterns decribing particle interation process.
Generated on
for ATLAS Offline Software by
1.17.0