ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaValidation
src
RecoClusterHistograms.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
RecoClusterHistograms.h
"
6
#include "GaudiKernel/ITHistSvc.h"
7
#include "
AthenaBaseComps/AthCheckMacros.h
"
8
9
#include "
xAODEgamma/EgammaxAODHelpers.h
"
10
#include "
xAODCaloEvent/CaloCluster.h
"
11
#include "
CaloEvent/CaloClusterCellLink.h
"
12
#include "
CaloEvent/CaloCell.h
"
13
14
#include "TH3D.h"
15
16
using namespace
egammaMonitoring
;
17
18
StatusCode
RecoClusterHistograms::initializePlots
() {
19
20
const
char
* fN =
m_name
.c_str();
21
22
for
(
int
il = 0; il < 4; il++) {
23
TString hN = Form(
"hNcellsvseteta_Lr%i"
,il);
24
m_histo3DMap
[hN.Data()] =
new
TH3D(Form(
"%s_%s"
,fN,hN.Data()),
""
,20,0,200,25,0,2.5,60,0,60);
25
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+hN.Data(),
m_histo3DMap
[hN.Data()]));
26
hN = Form(
"hEvseteta_Lr%i"
,il);
27
m_histo3DMap
[hN.Data()] =
new
TH3D(Form(
"%s_%s"
,fN,hN.Data()),
""
,20,0,200,25,0,2.5,50,0,200);
28
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+hN.Data(),
m_histo3DMap
[hN.Data()]));
29
}
30
TString hN =
"hNToposvseteta"
;
31
m_histo3DMap
[hN.Data()] =
new
TH3D(Form(
"%s_%s"
,fN,hN.Data()),
""
,20,0,200,25,0,2.5,10,0,10);
32
ATH_CHECK
(
m_rootHistSvc
->regHist(
m_folder
+hN.Data(),
m_histo3DMap
[hN.Data()]));
33
34
return
StatusCode::SUCCESS;
35
36
}
// initializePlots
37
38
void
RecoClusterHistograms::fill
(
const
xAOD::Egamma
&
egamma
) {
39
40
const
xAOD::CaloCluster
*cluster =
egamma
.caloCluster();
41
// This should be a real error...
42
if
(!cluster) {
43
return
;
44
}
45
46
const
CaloClusterCellLink
* cellLinks = cluster->
getCellLinks
();
47
if
(!cellLinks) {
48
return
;
49
}
50
51
double
et
=
egamma
.
pt
()*1e-3;
52
double
aeta = std::abs(
egamma
.
eta
());
53
54
std::map<int, int > cells_per_layer;
55
for
(
const
CaloCell
* cell : *cellLinks) {
56
if
(cell) {
57
int
layer = cell->caloDDE()->getLayer();
58
cells_per_layer[layer]++;
59
}
60
}
61
62
auto
associatedTopoCluster =
xAOD::EgammaHelpers::getAssociatedTopoClusters
(cluster);
63
m_histo3DMap
[
"hNToposvseteta"
]->Fill(
et
,aeta,associatedTopoCluster.size());
64
65
for
(
int
il = 0; il < 4; il++) {
66
int
nc = cells_per_layer.find(il) != cells_per_layer.end() ? cells_per_layer[il] : 0;
67
m_histo3DMap
[Form(
"hNcellsvseteta_Lr%i"
,il)]->Fill(
et
,aeta,nc);
68
m_histo3DMap
[Form(
"hEvseteta_Lr%i"
,il)]->Fill(
et
,aeta,cluster->
energyBE
(il)*1e-3);
69
}
70
71
}
AthCheckMacros.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
CaloCell.h
CaloClusterCellLink.h
EgammaxAODHelpers.h
CaloCluster.h
RecoClusterHistograms.h
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloClusterCellLink
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Definition
CaloClusterCellLink.h:24
ParticleImpl::pt
virtual double pt() const
transverse momentum
Definition
ParticleImpl.h:554
ParticleImpl::eta
virtual double eta() const
pseudo rapidity
Definition
ParticleImpl.h:514
egammaMonitoring::RecoClusterHistograms::initializePlots
StatusCode initializePlots()
Definition
RecoClusterHistograms.cxx:18
egammaMonitoring::RecoClusterHistograms::m_folder
std::string m_folder
Definition
RecoClusterHistograms.h:40
egammaMonitoring::RecoClusterHistograms::m_histo3DMap
std::map< std::string, TH3D * > m_histo3DMap
Definition
RecoClusterHistograms.h:32
egammaMonitoring::RecoClusterHistograms::fill
void fill(const xAOD::Egamma &egamma)
Definition
RecoClusterHistograms.cxx:38
egammaMonitoring::RecoClusterHistograms::m_rootHistSvc
SmartIF< ITHistSvc > m_rootHistSvc
Definition
RecoClusterHistograms.h:41
egammaMonitoring::RecoClusterHistograms::m_name
std::string m_name
Definition
RecoClusterHistograms.h:38
egamma
elec/gamma data class.
Definition
egamma.h:59
xAOD::CaloCluster_v1::getCellLinks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version).
Definition
CaloCluster_v1.cxx:829
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
egammaMonitoring
Definition
ClusterHistograms.h:19
xAOD::EgammaHelpers::getAssociatedTopoClusters
std::vector< const xAOD::CaloCluster * > getAssociatedTopoClusters(const xAOD::CaloCluster *cluster)
Return a vector of all the topo clusters associated with the egamma cluster.
Definition
EgammaxAODHelpers.cxx:77
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