ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetUncertainties
Root
LargeRTopologyUncertaintyComponent.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetUncertainties/LargeRTopologyUncertaintyComponent.h
"
6
#include "
JetUncertainties/Helpers.h
"
7
8
namespace
jet
9
{
10
12
// //
13
// Constructor/destructor/initialization //
14
// //
16
17
LargeRTopologyUncertaintyComponent::LargeRTopologyUncertaintyComponent
(
const
std::string& name)
18
:
UncertaintyComponent
(
ComponentHelper
(name))
19
,
m_absEta
(false)
20
,
m_truthLabelName
(
""
)
21
,
m_truthLabels
()
22
{
23
JESUNC_NO_DEFAULT_CONSTRUCTOR
;
24
}
25
26
LargeRTopologyUncertaintyComponent::LargeRTopologyUncertaintyComponent
(
const
ComponentHelper
& component)
27
:
UncertaintyComponent
(component)
28
,
m_absEta
(
CompParametrization
::isAbsEta(component.parametrization))
29
,
m_truthLabelName
(component.LargeRJetTruthLabelName)
30
,
m_truthLabels
(component.LargeRJetTruthLabels)
31
{
32
ATH_MSG_DEBUG
(Form(
"Creating LargeRTopologyUncertaintyComponent named %s"
,
m_uncHistName
.Data()));
33
}
34
35
LargeRTopologyUncertaintyComponent::LargeRTopologyUncertaintyComponent
(
const
LargeRTopologyUncertaintyComponent
& toCopy)
36
:
UncertaintyComponent
(toCopy)
37
,
m_absEta
(toCopy.
m_absEta
)
38
,
m_truthLabelName
(toCopy.
m_truthLabelName
)
39
,
m_truthLabels
(toCopy.
m_truthLabels
)
40
{
41
ATH_MSG_DEBUG
(Form(
"Creating copy of LargeRTopologyUncertaintyComponent named %s"
,
m_uncHistName
.Data()));
42
}
43
44
LargeRTopologyUncertaintyComponent
*
LargeRTopologyUncertaintyComponent::clone
()
const
45
{
46
return
new
LargeRTopologyUncertaintyComponent
(*
this
);
47
}
48
49
51
// //
52
// Validity and uncertainty retrieval //
53
// //
55
56
bool
LargeRTopologyUncertaintyComponent::getValidityImpl
(
const
xAOD::Jet
&
jet
,
const
xAOD::EventInfo
&)
const
57
{
58
return
!
m_validHist
? true :
getValidBool
(
m_validHist
->getValue(
jet
.pt()*
m_energyScale
,
m_absEta
? fabs(
jet
.eta()) :
jet
.eta()));
59
}
60
61
double
LargeRTopologyUncertaintyComponent::getUncertaintyImpl
(
const
xAOD::Jet
&
jet
,
const
xAOD::EventInfo
&)
const
62
{
63
// Retrieve the truth jet label from the jet
64
static
const
SG::AuxElement::ConstAccessor<int> accTruthLabel(
m_truthLabelName
);
65
if
(!accTruthLabel.isAvailable(
jet
) || accTruthLabel(
jet
) ==
LargeRJetTruthLabel::UNKNOWN
)
66
{
67
ATH_MSG_ERROR
(
"Unable to retrieve the LargeRJetTruthLabel: "
<<
m_truthLabelName
<<
" from the jet. Please use JetTruthLabelingTool before calling this function."
);
68
return
JESUNC_ERROR_CODE
;
69
}
70
const
LargeRJetTruthLabel::TypeEnum
jetTruthLabel =
LargeRJetTruthLabel::intToEnum
(accTruthLabel(
jet
));
71
72
// We now have the truth jet label, check if it matches one of the label(s) assigned to this component
73
// The uncertainty is only applied to same-labelled jets (zero otherwise)
74
for
(
const
LargeRJetTruthLabel::TypeEnum
aLabel :
m_truthLabels
)
75
{
76
if
(aLabel == jetTruthLabel)
77
return
m_uncHist
->getValue(
jet
.pt()*
m_energyScale
,
m_absEta
? fabs(
jet
.eta()) :
jet
.eta());
78
}
79
return
0;
80
}
81
82
}
// end jet namespace
83
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
LargeRTopologyUncertaintyComponent.h
Helpers.h
JESUNC_ERROR_CODE
#define JESUNC_ERROR_CODE
Definition
Reconstruction/Jet/JetUncertainties/JetUncertainties/Helpers.h:23
JESUNC_NO_DEFAULT_CONSTRUCTOR
#define JESUNC_NO_DEFAULT_CONSTRUCTOR
Definition
Reconstruction/Jet/JetUncertainties/JetUncertainties/Helpers.h:24
jet::ComponentHelper
Definition
ConfigHelper.h:24
jet::LargeRTopologyUncertaintyComponent::m_truthLabels
std::vector< LargeRJetTruthLabel::TypeEnum > m_truthLabels
Definition
LargeRTopologyUncertaintyComponent.h:33
jet::LargeRTopologyUncertaintyComponent::m_absEta
const bool m_absEta
Definition
LargeRTopologyUncertaintyComponent.h:31
jet::LargeRTopologyUncertaintyComponent::m_truthLabelName
std::string m_truthLabelName
Definition
LargeRTopologyUncertaintyComponent.h:32
jet::LargeRTopologyUncertaintyComponent::getUncertaintyImpl
virtual double getUncertaintyImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition
LargeRTopologyUncertaintyComponent.cxx:61
jet::LargeRTopologyUncertaintyComponent::clone
virtual LargeRTopologyUncertaintyComponent * clone() const
Definition
LargeRTopologyUncertaintyComponent.cxx:44
jet::LargeRTopologyUncertaintyComponent::getValidityImpl
virtual bool getValidityImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition
LargeRTopologyUncertaintyComponent.cxx:56
jet::LargeRTopologyUncertaintyComponent::LargeRTopologyUncertaintyComponent
LargeRTopologyUncertaintyComponent(const ComponentHelper &component)
Definition
LargeRTopologyUncertaintyComponent.cxx:26
jet::UncertaintyComponent::m_energyScale
const float m_energyScale
Definition
UncertaintyComponent.h:55
jet::UncertaintyComponent::UncertaintyComponent
UncertaintyComponent(const ComponentHelper &component, const size_t numHist=1)
Definition
UncertaintyComponent.cxx:47
jet::UncertaintyComponent::getValidBool
virtual bool getValidBool(const double validity) const
Definition
UncertaintyComponent.cxx:301
jet::UncertaintyComponent::m_uncHistName
const TString m_uncHistName
Definition
UncertaintyComponent.h:51
jet::UncertaintyComponent::m_validHist
UncertaintyHistogram * m_validHist
Definition
UncertaintyComponent.h:61
jet::UncertaintyComponent::m_uncHist
UncertaintyHistogram * m_uncHist
Definition
UncertaintyComponent.h:60
LargeRJetTruthLabel::intToEnum
TypeEnum intToEnum(const int type)
Definition
LargeRJetLabelEnum.h:63
LargeRJetTruthLabel::TypeEnum
TypeEnum
Definition
LargeRJetLabelEnum.h:14
LargeRJetTruthLabel::UNKNOWN
@ UNKNOWN
Definition
LargeRJetLabelEnum.h:15
jet::CompParametrization
Definition
UncertaintyEnum.h:43
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::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
Generated on
for ATLAS Offline Software by
1.17.0