ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
MuonID
MuonIDAnalysis
MuonEfficiencyCorrections
MuonEfficiencyCorrections
KinematicSystHandler.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUONEFFICIENCYCORRECTION_SYSTHANDLER_H
6
#define MUONEFFICIENCYCORRECTION_SYSTHANDLER_H
7
8
// EDM include(s):
9
#include "
xAODMuon/Muon.h
"
10
11
#include <
PATInterfaces/CorrectionCode.h
>
12
#include <
MuonEfficiencyCorrections/HistHandler.h
>
13
#include <
MuonEfficiencyCorrections/MuonEfficiencyType.h
>
14
#include <
PATInterfaces/ISystematicsTool.h
>
15
16
#include <
ColumnarCore/ColumnAccessor.h
>
17
#include <
ColumnarCore/ColumnarTool.h
>
18
#include <
ColumnarCore/ObjectColumn.h
>
19
#include <
ColumnarMuon/MuonDef.h
>
20
21
// further ROOT includes
22
#include <TFile.h>
23
#include <TDirectory.h>
24
#include <TH1.h>
25
#include <TF1.h>
26
27
// STL includes
28
#include <string>
29
#include <iostream>
30
#include <memory>
31
#include <map>
32
#include <cmath>
33
34
namespace
ADD_CMODE(CP) {
35
36
//Interface class to retrieve the Muon dependent systematics
37
class
IKinematicSystHandler :
public
columnar::ColumnarTool
<> {
38
public
:
40
virtual
CP::CorrectionCode
GetKineDependent(
columnar::MuonId
mu,
float
& Eff)
const
= 0;
43
virtual
void
SetSystematicWeight(
float
SystWeight) = 0;
44
46
virtual
bool
initialize
() = 0;
47
virtual
~IKinematicSystHandler() =
default
;
48
50
typedef
float (IKinematicSystHandler::*KinVariable)(
columnar::MuonId
mu)
const
;
51
KinVariable GetMuonVariableToUse(
const
std::string &name);
52
53
float
Eta
(
columnar::MuonId
mu)
const
;
54
float
Pt(
columnar::MuonId
mu)
const
;
55
float
PtGeV(
columnar::MuonId
mu)
const
;
56
float
AbsEta(
columnar::MuonId
mu)
const
;
57
58
columnar::MuonAccessor<columnar::ObjectColumn>
muonsHandle {*
this
,
"Muons"
};
59
columnar::MuonAccessor<float>
ptAcc {*
this
,
"pt"
};
60
columnar::MuonAccessor<float>
etaAcc {*
this
,
"eta"
};
61
};
73
class
PtKinematicSystHandler :
public
IKinematicSystHandler {
74
public
:
75
CP::CorrectionCode
GetKineDependent(
columnar::MuonId
mu,
float
& eff)
const override
;
76
77
void
SetSystematicWeight(
float
syst_weight)
override
;
78
79
bool
initialize
()
override
;
80
82
PtKinematicSystHandler(std::unique_ptr<HistHandler> pt_flatnesss, std::unique_ptr<HistHandler> energy_loss);
83
private
:
84
std::unique_ptr<HistHandler> m_flatness;
85
std::unique_ptr<HistHandler> m_loss;
86
float
m_SystWeight;
87
};
91
92
class
PrimodialPtSystematic:
public
IKinematicSystHandler {
93
public
:
94
CP::CorrectionCode
GetKineDependent(
columnar::MuonId
mu,
float
& Eff)
const override
;
95
96
void
SetSystematicWeight(
float
SystWeight)
override
;
97
98
bool
initialize
()
override
;
99
PrimodialPtSystematic(std::unique_ptr<HistHandler>
HistHandler
);
100
private
:
101
std::unique_ptr<HistHandler> m_Handler;
102
float
m_SystWeight;
103
};
107
class
TTVAClosureSysHandler:
public
IKinematicSystHandler {
108
public
:
109
TTVAClosureSysHandler(std::unique_ptr<HistHandler>
HistHandler
);
110
111
void
SetSystematicWeight(
float
SystWeight)
override
;
112
bool
initialize
()
override
;
113
CP::CorrectionCode
GetKineDependent(
columnar::MuonId
mu,
float
& Eff)
const override
;
114
private
:
115
std::unique_ptr<HistHandler> m_Handler;
116
float
m_SystWeight;
117
};
118
119
class
BadMuonVetoSystHandler:
public
IKinematicSystHandler {
120
public
:
121
CP::CorrectionCode
GetKineDependent(
columnar::MuonId
mu,
float
& Eff)
const override
;
122
void
SetSystematicWeight(
float
SystWeight)
override
;
123
124
bool
initialize
()
override
;
125
BadMuonVetoSystHandler(TDirectory* InDir_3Stations, TDirectory* InDir_2Stations =
nullptr
);
126
virtual
~BadMuonVetoSystHandler();
127
128
private
:
129
typedef
std::pair<float, float> Ranges;
130
131
CP::CorrectionCode
findAppropiatePolynomial(
const
xAOD::Muon
& mu, TF1* &Poly)
const
;
132
133
std::string getNextProperty(std::string &sstr)
const
;
134
void
fillMap(TDirectory* InDir, std::map<Ranges, std::unique_ptr<TF1>>& systPolynomials);
135
136
std::map<Ranges, std::unique_ptr<TF1>> m_syst3Stations;
137
std::map<Ranges, std::unique_ptr<TF1>> m_syst2Stations;
138
139
KinVariable m_uncertVar;
140
KinVariable m_polySelVar;
141
float
m_SystWeight;
142
};
143
144
}
/* namespace ADD_CMODE(CP) */
145
146
#endif
/* EFFICIENCYSCALEFACTOR_H_ */
ColumnAccessor.h
ColumnarTool.h
CorrectionCode.h
HistHandler.h
ISystematicsTool.h
MuonDef.h
MuonEfficiencyType.h
Muon.h
ObjectColumn.h
Eta
@ Eta
Definition
RPCdef.h:8
CP::CorrectionCode
Return value from object correction CP tools.
Definition
CorrectionCode.h:31
HistHandler
Definition
HistHandler.h:36
columnar::ColumnarTool
the base class for all columnar components
Definition
ColumnAccessorDataArray.h:17
columnar::MuonId
ObjectId< MuonDef > MuonId
Definition
MuonDef.h:22
columnar::MuonAccessor
AccessorTemplate< MuonDef, CT, ColumnAccessMode::input, CM > MuonAccessor
Definition
MuonDef.h:24
xAOD::Muon
Muon_v1 Muon
Reference the current persistent version:
Definition
Muon.h:13
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.17.0