ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaCaloTools
src
egammaIso.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
#include "
egammaIso.h
"
6
#include "
xAODCaloEvent/CaloCluster.h
"
7
#include "
CaloUtils/CaloCellList.h
"
8
#include "CaloGeoHelpers/CaloSampling.h"
9
#include "
CaloDetDescr/CaloDetDescrManager.h
"
10
#include <cmath>
11
12
namespace
{
13
const
double
size
= 0.12;
14
const
std::vector<CaloCell_ID::SUBCALO> theVecCalo = {
15
CaloCell_ID::LARHEC
,
CaloCell_ID::TILE
};
16
}
17
18
egammaIso::egammaIso
(
const
std::string&
type
,
19
const
std::string& name,
20
const
IInterface* parent)
21
:
AthAlgTool
(
type
, name, parent){
22
// declare Interface
23
declareInterface<IegammaIso>(
this
);
24
}
25
26
StatusCode
egammaIso::initialize
(){
27
ATH_MSG_DEBUG
(
" Initializing egammaIso"
);
28
return
StatusCode::SUCCESS;
29
}
30
StatusCode
egammaIso::finalize
(){
31
return
StatusCode::SUCCESS;
32
}
33
34
StatusCode
egammaIso::execute
(
const
xAOD::CaloCluster
& cluster,
35
const
CaloDetDescrManager
& cmgr,
36
const
CaloCellContainer
& cellcoll,
37
Info
& info)
const
{
38
const
double
eta
= cluster.
eta
();
39
const
double
phi
= cluster.
phi
();
40
double
egap=0.;
41
double
ehad=0.;
42
// define a new Calo Cell list corresponding to HAD Calo
43
// retrieve the corresponding CaloCell_ID for LarHec and TILE
44
// define a new Calo Cell list
45
CaloCellList
HADCellList(&cmgr,&cellcoll, theVecCalo);
46
// increase window size a bit to avoid problems due to 4cm shift.
47
// considering that in the tile the granularity is 0.1, the value
48
// choosen below is safe. All hadrons in 0.2X0.2
49
HADCellList.
select
(
eta
,
phi
,
size
,
size
);
50
ehad +=HADCellList.
energy
();
51
info.nBadT0 += HADCellList.
nBadT
(0);
52
info.nBadT12 += HADCellList.
nBadT
(1);
53
54
HADCellList.
select
(
eta
,
phi
,
size
,
size
,CaloSampling::TileGap3);
55
egap +=HADCellList.
energy
();
56
57
HADCellList.
select
(
eta
,
phi
,
size
,
size
,CaloSampling::HEC0);
58
info.ehad1 +=HADCellList.
energy
();
59
60
HADCellList.
select
(
eta
,
phi
,
size
,
size
,CaloSampling::TileBar0);
61
info.ehad1 +=HADCellList.
energy
();
62
63
// Fix had leakage in crack (TileGap1 and TileGap2 missing before 14.2)
64
HADCellList.
select
(
eta
,
phi
,
size
,
size
,CaloSampling::TileGap1);
65
info.ehad1 +=HADCellList.
energy
();
66
HADCellList.
select
(
eta
,
phi
,
size
,
size
,CaloSampling::TileGap2);
67
info.ehad1 +=HADCellList.
energy
();
68
69
HADCellList.
select
(
eta
,
phi
,
size
,
size
,CaloSampling::TileExt0);
70
info.ehad1 +=HADCellList.
energy
();
71
72
const
double
eta2 = cluster.
etaBE
(2);
73
if
(eta2==-999.) {
74
info.ethad1 = -999;
75
info.ethad = -999;
76
}
else
{
77
const
double
cheta2 = cosh(eta2);
78
info.ethad1 = cheta2!=0. ? info.ehad1/cheta2 : 0.;
79
// substract scintillator energy from ehad!
80
info.ethad = cheta2!=0. ? (ehad-egap)/cheta2 : 0.;
81
}
82
return
StatusCode::SUCCESS;
83
}
84
85
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloCellList.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
CaloCluster.h
size
size_t size() const
Number of registered mappings.
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCellList
Definition
CaloCellList.h:40
CaloCellList::nBadT
unsigned short nBadT(int i) const
Definition
CaloCellList.h:119
CaloCellList::energy
double energy() const
Definition
CaloCellList.h:101
CaloCellList::select
void select(double eta, double phi, double deta, double dphi)
Definition
CaloCellList.cxx:89
CaloCell_Base_ID::TILE
@ TILE
Definition
CaloCell_Base_ID.h:45
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition
CaloCell_Base_ID.h:45
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition
CaloDetDescrManager.h:469
IegammaIso::Info
Definition
IegammaIso.h:39
egammaIso::initialize
StatusCode initialize() override
initialize method
Definition
egammaIso.cxx:26
egammaIso::finalize
StatusCode finalize() override
finalize method
Definition
egammaIso.cxx:30
egammaIso::execute
virtual StatusCode execute(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &cmgr, const CaloCellContainer &cellcoll, Info &info) const override final
Method to just calculate hadronic leakage.
Definition
egammaIso.cxx:34
egammaIso::egammaIso
egammaIso(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition
egammaIso.cxx:18
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition
CaloCluster_v1.cxx:251
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition
CaloCluster_v1.cxx:256
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
egammaIso.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