ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonHistogramming
MuonHistUtils
Root
MuonIsolationPlots.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonHistUtils/MuonIsolationPlots.h
"
6
7
#include <utility>
8
9
namespace
Muon
{
10
11
MuonIsolationPlots::MuonIsolationPlots
(
PlotBase
* pParent,
12
const
std::string& sDir)
13
:
PlotBase
(pParent, sDir),
14
// iso variables
15
m_oPtCone20
(this,
""
,
"ptcone20"
),
16
m_oPtCone30
(this,
""
,
"ptcone30"
),
17
m_oPtCone40
(this,
""
,
"ptcone40"
),
18
19
m_oTopoEtCone20
(this,
""
,
"topoetcone20"
),
20
m_oTopoEtCone30
(this,
""
,
"topoetcone30"
),
21
m_oTopoEtCone40
(this,
""
,
"topoetcone40"
),
22
23
m_oNEFlowIso20
(this,
""
,
"neflowisol20"
),
24
m_oNEFlowIso30
(this,
""
,
"neflowisol30"
),
25
m_oNEFlowIso40
(this,
""
,
"neflowisol40"
),
26
27
m_oPtVarCone20
(this,
""
,
"ptvarcone20"
),
28
m_oPtVarCone30
(this,
""
,
"ptvarcone30"
),
29
m_oPtVarCone40
(this,
""
,
"ptvarcone40"
)
30
// iso corrections
31
,
32
m_oTopoEtCone_coreCone
(this,
""
,
"topoetcone_coreCone"
),
33
m_oNEFlowIso_coreCone
(this,
""
,
"neflowisol_coreCone"
) {}
34
35
void
MuonIsolationPlots::fill
(
const
xAOD::Muon
& muon,
float
weight) {
36
m_oPtCone20
.fill(muon,
xAOD::Iso::ptcone20
, weight);
37
m_oPtCone30
.fill(muon,
xAOD::Iso::ptcone30
, weight);
38
m_oPtCone40
.fill(muon,
xAOD::Iso::ptcone40
, weight);
39
40
m_oTopoEtCone20
.fill(muon,
xAOD::Iso::topoetcone20
, weight);
41
m_oTopoEtCone30
.fill(muon,
xAOD::Iso::topoetcone30
, weight);
42
m_oTopoEtCone40
.fill(muon,
xAOD::Iso::topoetcone40
, weight);
43
44
m_oNEFlowIso20
.fill(muon,
xAOD::Iso::neflowisol20
, weight);
45
m_oNEFlowIso30
.fill(muon,
xAOD::Iso::neflowisol30
, weight);
46
m_oNEFlowIso40
.fill(muon,
xAOD::Iso::neflowisol40
, weight);
47
48
m_oPtVarCone20
.fill(muon,
xAOD::Iso::ptvarcone20
, weight);
49
m_oPtVarCone30
.fill(muon,
xAOD::Iso::ptvarcone30
, weight);
50
m_oPtVarCone40
.fill(muon,
xAOD::Iso::ptvarcone40
, weight);
51
52
m_oTopoEtCone_coreCone
.fill(
53
muon,
xAOD::Iso::topoetcone20
,
xAOD::Iso::topoetcone30
,
54
xAOD::Iso::topoetcone40
,
xAOD::Iso::topoetcone
,
xAOD::Iso::coreCone
,
55
xAOD::Iso::coreEnergy
, weight);
56
m_oNEFlowIso_coreCone
.fill(muon,
xAOD::Iso::neflowisol20
,
57
xAOD::Iso::neflowisol30
,
xAOD::Iso::neflowisol40
,
58
xAOD::Iso::neflowisol
,
xAOD::Iso::coreCone
,
59
xAOD::Iso::coreEnergy
, weight);
60
}
61
62
IsoPlots::IsoPlots
(
PlotBase
* pParent,
const
std::string& sDir,
63
std::string sConeSize)
64
:
PlotBase
(pParent, sDir),
65
m_sConeSize
(
std
::move(sConeSize)),
66
cone
(nullptr),
67
conerel
(nullptr) {}
68
69
void
IsoPlots::initializePlots
() {
70
cone
=
Book1D
(
m_sConeSize
,
m_sConeSize
+
";"
+
m_sConeSize
+
";Entries"
, 60,
71
-5., 25.);
72
conerel
=
73
Book1D
(
m_sConeSize
+
"rel"
,
74
m_sConeSize
+
"rel;"
+
m_sConeSize
+
"rel;Entries"
, 40, 0., 2.);
75
}
76
77
void
IsoPlots::fill
(
const
xAOD::Muon
& muon,
78
const
xAOD::Iso::IsolationType
& isoType,
float
weight) {
79
float
fIso = 0;
80
try
{
81
muon.isolation(fIso, isoType);
82
}
catch
(
SG::ExcBadAuxVar
&) {
83
return
;
84
}
85
if
(fIso) {
86
fill
(fIso, muon.pt(), weight);
87
}
88
}
89
void
IsoPlots::fill
(
float
fIso,
float
fPt,
float
weight) {
90
cone
->Fill(fIso * 0.001, weight);
91
conerel
->Fill(fIso / fPt, weight);
92
}
93
94
#ifndef XAOD_ANALYSIS
95
IsoCorrPlots::IsoCorrPlots
(
PlotBase
* pParent,
const
std::string& sDir,
96
std::string sCorrType)
97
:
PlotBase
(pParent, sDir),
98
m_sCorrType
(
std
::move(sCorrType)),
99
isocorr
(nullptr),
100
isocorr_relPt
(nullptr),
101
isocorr_relIsocone20
(nullptr),
102
isocorr_relIsocone30
(nullptr),
103
isocorr_relIsocone40
(nullptr) {}
104
105
void
IsoCorrPlots::initializePlots
() {
106
isocorr
=
Book1D
(
m_sCorrType
,
m_sCorrType
+
";"
+
m_sCorrType
+
";Entries"
,
107
60, -5., 25.);
108
isocorr_relPt
=
Book1D
(
109
m_sCorrType
+
"_relPt"
,
110
m_sCorrType
+
"_relPt;"
+
m_sCorrType
+
"_relPt;Entries"
, 40, 0., 2.);
111
isocorr_relIsocone20
=
Book1D
(
112
m_sCorrType
+
"_relIsocone20"
,
113
m_sCorrType
+
"_relIsocone20;"
+
m_sCorrType
+
"_relIsocone20;Entries"
,
114
150, -25., 25.);
115
isocorr_relIsocone30
=
Book1D
(
116
m_sCorrType
+
"_relIsocone30"
,
117
m_sCorrType
+
"_relIsocone30;"
+
m_sCorrType
+
"_relIsocone30;Entries"
,
118
150, -25., 25.);
119
isocorr_relIsocone40
=
Book1D
(
120
m_sCorrType
+
"_relIsocone40"
,
121
m_sCorrType
+
"_relIsocone40;"
+
m_sCorrType
+
"_relIsocone40;Entries"
,
122
150, -25., 25.);
123
}
124
125
void
IsoCorrPlots::fill
(
126
const
xAOD::Muon
& muon,
const
xAOD::Iso::IsolationType
& isoType_cone20,
127
const
xAOD::Iso::IsolationType
& isoType_cone30,
128
const
xAOD::Iso::IsolationType
& isoType_cone40,
129
const
xAOD::Iso::IsolationFlavour
& flavour,
130
const
xAOD::Iso::IsolationCaloCorrection
& isoCorrType,
131
const
xAOD::Iso::IsolationCorrectionParameter
& isoCorrParam,
float
weight) {
132
float
fIso20 = 0;
133
float
fIso30 = 0;
134
float
fIso40 = 0;
135
float
fIsoCorr = 0;
136
137
try
{
138
muon.isolation(fIso20, isoType_cone20);
139
muon.isolation(fIso30, isoType_cone30);
140
muon.isolation(fIso40, isoType_cone40);
141
muon.isolationCaloCorrection(fIsoCorr, flavour, isoCorrType,
142
isoCorrParam);
143
}
catch
(
SG::ExcBadAuxVar
&) {
144
return
;
145
}
146
if
(fIso20 && fIso30 && fIso40) {
147
fill
(fIso20, fIso30, fIso40, muon.pt(), fIsoCorr, weight);
148
}
149
}
150
151
void
IsoCorrPlots::fill
(
float
fIso20,
float
fIso30,
float
fIso40,
float
fPt,
152
float
fIsoCorr,
float
weight) {
153
isocorr
->Fill(fIsoCorr * 0.001, weight);
154
isocorr_relPt
->Fill(fIsoCorr / fPt, weight);
155
isocorr_relIsocone20
->Fill(fIsoCorr / fIso20, weight);
156
isocorr_relIsocone30
->Fill(fIsoCorr / fIso30, weight);
157
isocorr_relIsocone40
->Fill(fIsoCorr / fIso40, weight);
158
}
159
#endif
// not XAOD_ANALYSIS
160
161
}
// namespace Muon
MuonIsolationPlots.h
Muon::IsoCorrPlots::isocorr_relIsocone20
TH1 * isocorr_relIsocone20
Definition
MuonIsolationPlots.h:33
Muon::IsoCorrPlots::fill
void fill(const xAOD::Muon &muon, const xAOD::Iso::IsolationType &isoType_cone20, const xAOD::Iso::IsolationType &isoType_cone30, const xAOD::Iso::IsolationType &isoType_cone40, const xAOD::Iso::IsolationFlavour &flavour, const xAOD::Iso::IsolationCaloCorrection &isoCorrType, const xAOD::Iso::IsolationCorrectionParameter &isoCorrParam, float weight=1.0)
Definition
MuonIsolationPlots.cxx:125
Muon::IsoCorrPlots::isocorr_relIsocone30
TH1 * isocorr_relIsocone30
Definition
MuonIsolationPlots.h:34
Muon::IsoCorrPlots::m_sCorrType
std::string m_sCorrType
Definition
MuonIsolationPlots.h:29
Muon::IsoCorrPlots::isocorr
TH1 * isocorr
Definition
MuonIsolationPlots.h:31
Muon::IsoCorrPlots::isocorr_relIsocone40
TH1 * isocorr_relIsocone40
Definition
MuonIsolationPlots.h:35
Muon::IsoCorrPlots::IsoCorrPlots
IsoCorrPlots(PlotBase *pParent, const std::string &sDir, std::string sCorrType)
Definition
MuonIsolationPlots.cxx:95
Muon::IsoCorrPlots::initializePlots
void initializePlots()
Definition
MuonIsolationPlots.cxx:105
Muon::IsoCorrPlots::isocorr_relPt
TH1 * isocorr_relPt
Definition
MuonIsolationPlots.h:32
Muon::IsoPlots::cone
TH1 * cone
Definition
MuonIsolationPlots.h:50
Muon::IsoPlots::conerel
TH1 * conerel
Definition
MuonIsolationPlots.h:51
Muon::IsoPlots::IsoPlots
IsoPlots(PlotBase *pParent, const std::string &sDir, std::string sConeSize)
Definition
MuonIsolationPlots.cxx:62
Muon::IsoPlots::fill
void fill(const xAOD::Muon &muon, const xAOD::Iso::IsolationType &isoType, float weight=1.0)
Definition
MuonIsolationPlots.cxx:77
Muon::IsoPlots::m_sConeSize
std::string m_sConeSize
Definition
MuonIsolationPlots.h:48
Muon::IsoPlots::initializePlots
void initializePlots()
Definition
MuonIsolationPlots.cxx:69
Muon::MuonIsolationPlots::fill
void fill(const xAOD::Muon &muon, float weight=1.0)
Definition
MuonIsolationPlots.cxx:35
Muon::MuonIsolationPlots::m_oNEFlowIso_coreCone
IsoCorrPlots m_oNEFlowIso_coreCone
Definition
MuonIsolationPlots.h:80
Muon::MuonIsolationPlots::m_oNEFlowIso30
IsoPlots m_oNEFlowIso30
Definition
MuonIsolationPlots.h:71
Muon::MuonIsolationPlots::m_oNEFlowIso20
IsoPlots m_oNEFlowIso20
Definition
MuonIsolationPlots.h:70
Muon::MuonIsolationPlots::m_oPtCone40
IsoPlots m_oPtCone40
Definition
MuonIsolationPlots.h:64
Muon::MuonIsolationPlots::m_oPtVarCone40
IsoPlots m_oPtVarCone40
Definition
MuonIsolationPlots.h:76
Muon::MuonIsolationPlots::m_oNEFlowIso40
IsoPlots m_oNEFlowIso40
Definition
MuonIsolationPlots.h:72
Muon::MuonIsolationPlots::m_oTopoEtCone40
IsoPlots m_oTopoEtCone40
Definition
MuonIsolationPlots.h:68
Muon::MuonIsolationPlots::m_oPtCone30
IsoPlots m_oPtCone30
Definition
MuonIsolationPlots.h:63
Muon::MuonIsolationPlots::m_oPtCone20
IsoPlots m_oPtCone20
Definition
MuonIsolationPlots.h:62
Muon::MuonIsolationPlots::MuonIsolationPlots
MuonIsolationPlots(PlotBase *pParent, const std::string &sDir)
Definition
MuonIsolationPlots.cxx:11
Muon::MuonIsolationPlots::m_oTopoEtCone_coreCone
IsoCorrPlots m_oTopoEtCone_coreCone
Definition
MuonIsolationPlots.h:79
Muon::MuonIsolationPlots::m_oPtVarCone30
IsoPlots m_oPtVarCone30
Definition
MuonIsolationPlots.h:75
Muon::MuonIsolationPlots::m_oPtVarCone20
IsoPlots m_oPtVarCone20
Definition
MuonIsolationPlots.h:74
Muon::MuonIsolationPlots::m_oTopoEtCone30
IsoPlots m_oTopoEtCone30
Definition
MuonIsolationPlots.h:67
Muon::MuonIsolationPlots::m_oTopoEtCone20
IsoPlots m_oTopoEtCone20
Definition
MuonIsolationPlots.h:66
PlotBase::Book1D
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
Definition
PlotBase.cxx:94
PlotBase::PlotBase
PlotBase(PlotBase *parent, std::string_view sDir)
Definition
PlotBase.cxx:29
SG::ExcBadAuxVar
Exception — Attempt to retrieve nonexistent aux data item.
Definition
Control/AthContainers/AthContainers/exceptions.h:59
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
std
STL namespace.
xAOD::Iso::IsolationType
IsolationType
Overall enumeration for isolation types in xAOD files.
Definition
IsolationType.h:26
xAOD::Iso::neflowisol40
@ neflowisol40
Definition
IsolationType.h:66
xAOD::Iso::neflowisol30
@ neflowisol30
Definition
IsolationType.h:65
xAOD::Iso::neflowisol20
@ neflowisol20
Neutral eflow isolation.
Definition
IsolationType.h:64
xAOD::Iso::topoetcone20
@ topoetcone20
Topo-cluster ET-sum.
Definition
IsolationType.h:48
xAOD::Iso::ptvarcone30
@ ptvarcone30
Definition
IsolationType.h:56
xAOD::Iso::topoetcone40
@ topoetcone40
Definition
IsolationType.h:50
xAOD::Iso::ptcone40
@ ptcone40
Definition
IsolationType.h:42
xAOD::Iso::ptcone20
@ ptcone20
Track isolation.
Definition
IsolationType.h:40
xAOD::Iso::ptvarcone40
@ ptvarcone40
Definition
IsolationType.h:57
xAOD::Iso::ptcone30
@ ptcone30
Definition
IsolationType.h:41
xAOD::Iso::ptvarcone20
@ ptvarcone20
Mini-Isolation http://arxiv.org/abs/1007.2221.
Definition
IsolationType.h:55
xAOD::Iso::topoetcone30
@ topoetcone30
Definition
IsolationType.h:49
xAOD::Iso::IsolationFlavour
IsolationFlavour
Enumeration for different ways of calculating isolation in xAOD files.
Definition
IsolationFlavour.h:17
xAOD::Iso::topoetcone
@ topoetcone
Topo-cluster ET-sum.
Definition
IsolationFlavour.h:25
xAOD::Iso::neflowisol
@ neflowisol
neutral eflow
Definition
IsolationFlavour.h:31
xAOD::Iso::IsolationCorrectionParameter
IsolationCorrectionParameter
Definition
Event/xAOD/xAODPrimitives/xAODPrimitives/IsolationCorrection.h:91
xAOD::Iso::coreEnergy
@ coreEnergy
energy stored for this correction
Definition
Event/xAOD/xAODPrimitives/xAODPrimitives/IsolationCorrection.h:93
xAOD::Iso::IsolationCaloCorrection
IsolationCaloCorrection
Enumeration for different ways of correcting isolation in xAOD files.
Definition
Event/xAOD/xAODPrimitives/xAODPrimitives/IsolationCorrection.h:18
xAOD::Iso::coreCone
@ coreCone
core energy (in dR<0.1).
Definition
Event/xAOD/xAODPrimitives/xAODPrimitives/IsolationCorrection.h:29
xAOD::Muon
Muon_v1 Muon
Reference the current persistent version:
Definition
Event/xAOD/xAODMuon/xAODMuon/Muon.h:13
Generated on
for ATLAS Offline Software by
1.17.0