ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
BoostedJetTaggers
Root
ScaleFactors.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
BoostedJetTaggers/ScaleFactors.h
"
6
7
namespace
BJT
{
8
9
ScaleFactors::ScaleFactors
(
const
std::string& name) :
10
asg
::
AsgTool
(name)
11
{}
12
13
StatusCode
ScaleFactors::initialize
() {
14
15
ATH_MSG_INFO
(
"Initializing ScaleFactors tool"
);
16
17
// retrive helper tools
18
ATH_CHECK
(
m_histTool2D_quark_eff
.retrieve());
19
ATH_CHECK
(
m_histTool2D_gluon_eff
.retrieve());
20
ATH_CHECK
(
m_histTool2D_quark_ineff
.retrieve());
21
ATH_CHECK
(
m_histTool2D_gluon_ineff
.retrieve());
22
23
// print decoration name and validity range info
24
ATH_MSG_INFO
(
"Scale Factors tool initialized"
);
25
ATH_MSG_INFO
(
" jet container : "
<<
m_jetsKey
.key());
26
ATH_MSG_INFO
(
" pT cut low : "
<<
m_jetPtMin
);
27
ATH_MSG_INFO
(
" pT cut high : "
<<
m_jetPtMax
);
28
ATH_MSG_INFO
(
" eta cut high : "
<<
m_jetEtaMax
);
29
31
ATH_MSG_INFO
(
"Additional decorators that will be attached to jet :"
);
32
33
ATH_CHECK
(
m_jetsKey
.initialize());
34
35
ATH_CHECK
(
m_accTaggedKey
.initialize());
36
ATH_CHECK
(
m_decEfficiencyKey
.initialize());
37
ATH_CHECK
(
m_decInefficiencyKey
.initialize());
38
39
ATH_MSG_INFO
(
" "
<<
m_accTaggedKey
.key() <<
" : pass tagging criteria"
);
40
ATH_MSG_INFO
(
" "
<<
m_decEfficiencyKey
.key() <<
" : Efficiency correction"
);
41
ATH_MSG_INFO
(
" "
<<
m_decInefficiencyKey
.key() <<
" : Inefficiency correction"
);
42
43
return
StatusCode::SUCCESS;
44
45
}
46
47
StatusCode
ScaleFactors::decorate
(
const
xAOD::JetContainer
& jets)
const
{
48
49
ATH_MSG_DEBUG
(
"Obtaining tagger scale factors result"
);
50
52
SG::WriteDecorHandle<xAOD::JetContainer, float>
decEfficiency(
m_decEfficiencyKey
);
53
SG::WriteDecorHandle<xAOD::JetContainer, float>
decInefficiency(
m_decInefficiencyKey
);
54
56
SG::ReadDecorHandle<xAOD::JetContainer, char>
accTagged(
m_accTaggedKey
);
57
58
// loop over jets
59
for
(
const
xAOD::Jet
*
jet
: jets){
60
62
static
const
SG::AuxElement::ConstAccessor<int> truth_label_acc(
m_truthLabelName
);
63
int
truth_label = truth_label_acc(*
jet
);
64
66
bool
pass_taggerWP = accTagged(*
jet
);
67
69
JetHelper::JetContext
jc;
70
ATH_MSG_DEBUG
(
"jet pT: "
<<
jet
-> pt());
71
ATH_MSG_DEBUG
(
"jet eta: "
<<
jet
->
eta
());
72
ATH_MSG_DEBUG
(
"jet truth label: "
<< truth_label);
73
ATH_MSG_DEBUG
(
"jet pass tagger WP: "
<< pass_taggerWP);
74
75
float
efficiency
(-1.), inefficiency (-1.);
76
77
if
(pass_taggerWP){
78
if
(truth_label >= 1 && truth_label <= 5)
79
efficiency
=
m_histTool2D_quark_eff
-> getValue(*
jet
, jc);
80
else
if
(truth_label == 21)
81
inefficiency =
m_histTool2D_gluon_ineff
-> getValue(*
jet
, jc);
82
}
83
else
{
84
if
(truth_label >= 1 && truth_label <= 5)
85
inefficiency =
m_histTool2D_quark_ineff
-> getValue(*
jet
, jc);
86
else
if
(truth_label == 21)
87
efficiency
=
m_histTool2D_gluon_eff
-> getValue(*
jet
, jc);
88
}
89
90
ATH_MSG_DEBUG
(
"efficiency: "
<<
efficiency
);
91
ATH_MSG_DEBUG
(
"inefficiency: "
<< inefficiency);
92
94
decEfficiency(*
jet
) =
efficiency
;
95
decInefficiency(*
jet
) = inefficiency;
96
97
}
// end loop over jets
98
99
return
StatusCode::SUCCESS;
100
101
}
102
103
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ScaleFactors.h
BJT::ScaleFactors::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate jet container with tagging info.
Definition
ScaleFactors.cxx:47
BJT::ScaleFactors::m_histTool2D_gluon_eff
ToolHandle< JetHelper::IVarTool > m_histTool2D_gluon_eff
Definition
ScaleFactors.h:53
BJT::ScaleFactors::m_accTaggedKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_accTaggedKey
Definition
ScaleFactors.h:62
BJT::ScaleFactors::initialize
virtual StatusCode initialize() override
Run once at the start of the job to setup everything.
Definition
ScaleFactors.cxx:13
BJT::ScaleFactors::m_jetPtMin
Gaudi::Property< float > m_jetPtMin
Definition
ScaleFactors.h:40
BJT::ScaleFactors::m_histTool2D_quark_eff
ToolHandle< JetHelper::IVarTool > m_histTool2D_quark_eff
helper histogram tool ToDo: once W and top available should make this more generic and configurable
Definition
ScaleFactors.h:46
BJT::ScaleFactors::m_histTool2D_quark_ineff
ToolHandle< JetHelper::IVarTool > m_histTool2D_quark_ineff
Definition
ScaleFactors.h:49
BJT::ScaleFactors::m_histTool2D_gluon_ineff
ToolHandle< JetHelper::IVarTool > m_histTool2D_gluon_ineff
Definition
ScaleFactors.h:56
BJT::ScaleFactors::m_decEfficiencyKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decEfficiencyKey
WriteDecorHandle keys.
Definition
ScaleFactors.h:65
BJT::ScaleFactors::m_jetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetsKey
ReadDecorHandle keys.
Definition
ScaleFactors.h:61
BJT::ScaleFactors::m_jetPtMax
Gaudi::Property< float > m_jetPtMax
Definition
ScaleFactors.h:41
BJT::ScaleFactors::ScaleFactors
ScaleFactors(const std::string &name)
Constructor.
Definition
ScaleFactors.cxx:9
BJT::ScaleFactors::m_truthLabelName
Gaudi::Property< std::string > m_truthLabelName
input parameters
Definition
ScaleFactors.h:39
BJT::ScaleFactors::m_decInefficiencyKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decInefficiencyKey
Definition
ScaleFactors.h:66
BJT::ScaleFactors::m_jetEtaMax
Gaudi::Property< float > m_jetEtaMax
Definition
ScaleFactors.h:42
JetHelper::JetContext
Class JetContext Designed to read AOD information related to the event, N vertices,...
Definition
JetContext.h:23
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition
StoreGate/StoreGate/ReadDecorHandle.h:94
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
efficiency
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition
dependence.cxx:128
BJT
Definition
qgTagger.h:19
asg
Definition
DataHandleTestTool.h:28
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0