ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaCaloTools
src
egammaCheckEnergyDepositTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: egammaCheckEnergyDepositTool
8
PACKAGE: offline/Reconstruction/egamma/egammaTools
9
10
AUTHORS: F. Derue
11
CREATED: July 3, 2009
12
13
PURPOSE: Check in each sampling that the fraction of energy
14
reconstructed is not greater than a certain threshold.
15
Also make sure there is some minimal energy in the 2nd
16
sampling.
17
18
UPDATED :
19
Dec. 29, 2009 (FD) protection against bad pointers
20
********************************************************************/
21
22
#include "
egammaCheckEnergyDepositTool.h
"
23
#include "
xAODEgamma/Egamma.h
"
24
#include "
xAODCaloEvent/CaloCluster.h
"
25
26
27
egammaCheckEnergyDepositTool::egammaCheckEnergyDepositTool
(
const
std::string&
type
,
28
const
std::string& name,
29
const
IInterface* parent) :
30
AthAlgTool
(
type
, name, parent)
31
{
32
declareInterface<IegammaCheckEnergyDepositTool>(
this
);
33
34
}
35
36
StatusCode
egammaCheckEnergyDepositTool::initialize
()
37
{
38
39
ATH_MSG_DEBUG
(
"Initializing "
<< name() <<
"..."
);
40
41
return
StatusCode::SUCCESS;
42
}
43
44
StatusCode
egammaCheckEnergyDepositTool::finalize
()
45
{
46
return
StatusCode::SUCCESS;
47
}
48
49
bool
egammaCheckEnergyDepositTool::checkFractioninSamplingCluster
(
const
xAOD::CaloCluster
* cluster)
const
50
{
51
52
// retrieve associated cluster
53
if
(cluster==
nullptr
)
return
false
;
54
55
// Retrieve energy in all samplings
56
double
e0 = cluster->
energyBE
(0);
57
double
e1 = cluster->
energyBE
(1);
58
double
e2 = cluster->
energyBE
(2);
59
double
e3 = cluster->
energyBE
(3);
60
61
if
(e2<
m_thrE2min
){
62
return
false
;
63
}
64
// sum of energy in all samplings
65
const
double
eallsamples = e0+e1+e2+e3;
66
67
if
(eallsamples!=0.) {
68
const
double
inv_eallsamples = 1. / eallsamples;
69
70
// check fraction of energy reconstructed in presampler
71
double
f0 = e0 * inv_eallsamples;
72
if
(f0 >
m_thrF0max
)
return
false
;
73
74
// check fraction of energy reconstructed in first sampling
75
double
f1 = e1 * inv_eallsamples;
76
if
(f1 >
m_thrF1max
)
return
false
;
77
78
// check fraction of energy reconstructed in second sampling
79
double
f2 = e2 * inv_eallsamples;
80
if
(f2 >
m_thrF2max
)
return
false
;
81
82
// check fraction of energy reconstructed in third sampling
83
double
f3 = e3 * inv_eallsamples;
84
if
(f3 >
m_thrF3max
)
return
false
;
85
}
86
87
return
true
;
88
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
Egamma.h
CaloCluster.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
egammaCheckEnergyDepositTool::m_thrF2max
Gaudi::Property< double > m_thrF2max
Threshold on maximum fraction of energy reconstructed in 2nd sampling.
Definition
egammaCheckEnergyDepositTool.h:54
egammaCheckEnergyDepositTool::checkFractioninSamplingCluster
virtual bool checkFractioninSamplingCluster(const xAOD::CaloCluster *cluster) const override final
execute method
Definition
egammaCheckEnergyDepositTool.cxx:49
egammaCheckEnergyDepositTool::m_thrF1max
Gaudi::Property< double > m_thrF1max
Threshold on maximum fraction of energy reconstructed in 1st sampling.
Definition
egammaCheckEnergyDepositTool.h:50
egammaCheckEnergyDepositTool::m_thrE2min
Gaudi::Property< double > m_thrE2min
Threshold on minimum energy reconstructed in 2nd sampling.
Definition
egammaCheckEnergyDepositTool.h:42
egammaCheckEnergyDepositTool::egammaCheckEnergyDepositTool
egammaCheckEnergyDepositTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition
egammaCheckEnergyDepositTool.cxx:27
egammaCheckEnergyDepositTool::m_thrF3max
Gaudi::Property< double > m_thrF3max
Threshold on maximum fraction of energy reconstructed in 3rd sampling.
Definition
egammaCheckEnergyDepositTool.h:58
egammaCheckEnergyDepositTool::finalize
virtual StatusCode finalize() override final
finalize method
Definition
egammaCheckEnergyDepositTool.cxx:44
egammaCheckEnergyDepositTool::m_thrF0max
Gaudi::Property< double > m_thrF0max
Threshold on maximum fraction of energy reconstructed in presampler.
Definition
egammaCheckEnergyDepositTool.h:46
egammaCheckEnergyDepositTool::initialize
virtual StatusCode initialize() override final
initialize method
Definition
egammaCheckEnergyDepositTool.cxx:36
xAOD::CaloCluster_v1::energyBE
float energyBE(const unsigned layer) const
Get the energy in one layer of the EM Calo.
Definition
CaloCluster_v1.cxx:623
egammaCheckEnergyDepositTool.h
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
type
Generated on
for ATLAS Offline Software by
1.17.0