ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetUncertainties
Root
ClosebyUncertaintyComponent.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 "
JetUncertainties/ClosebyUncertaintyComponent.h
"
6
#include "
JetUncertainties/Helpers.h
"
7
8
namespace
jet
9
{
10
12
// //
13
// Constructor/destructor/initialization //
14
// //
16
17
ClosebyUncertaintyComponent::ClosebyUncertaintyComponent
(
const
std::string& name)
18
:
UncertaintyComponent
(
ComponentHelper
(name))
19
{
20
JESUNC_NO_DEFAULT_CONSTRUCTOR
;
21
}
22
23
ClosebyUncertaintyComponent::ClosebyUncertaintyComponent
(
const
ComponentHelper
& component)
24
:
UncertaintyComponent
(component)
25
{
26
ATH_MSG_DEBUG
(Form(
"Creating ClosebyUncertaintyComponent named %s"
,
m_uncHistName
.Data()));
27
}
28
29
ClosebyUncertaintyComponent::ClosebyUncertaintyComponent
(
const
ClosebyUncertaintyComponent
& toCopy)
30
:
UncertaintyComponent
(toCopy)
31
{
32
ATH_MSG_DEBUG
(Form(
"Creating copy of ClosebyUncertaintyComponent named %s"
,
m_uncHistName
.Data()));
33
}
34
35
ClosebyUncertaintyComponent
*
ClosebyUncertaintyComponent::clone
()
const
36
{
37
return
new
ClosebyUncertaintyComponent
(*
this
);
38
}
39
40
42
// //
43
// Validity and uncertainty retrieval //
44
// //
46
47
bool
ClosebyUncertaintyComponent::getValidityImpl
(
const
xAOD::Jet
&
jet
,
const
xAOD::EventInfo
&)
const
48
{
49
return
!
m_validHist
? true :
getValidBool
(
m_validHist
->getValue(
jet
.pt()*
m_energyScale
,
getMinDR
(
jet
)));
50
}
51
52
double
ClosebyUncertaintyComponent::getUncertaintyImpl
(
const
xAOD::Jet
&
jet
,
const
xAOD::EventInfo
&)
const
53
{
54
return
m_uncHist
->getValue(
jet
.pt()*
m_energyScale
,
getMinDR
(
jet
));
55
}
56
57
float
ClosebyUncertaintyComponent::getMinDR
(
const
xAOD::Jet
&
jet
)
const
58
{
59
static
const
SG::AuxElement::Accessor<float> accMinDR(
"MinDR"
);
60
61
if
(!accMinDR.isAvailable(
jet
))
62
{
63
ATH_MSG_ERROR
(
"Failed to retrieve MinDR attribute from the jet"
);
64
return
JESUNC_ERROR_CODE
;
65
}
66
return
accMinDR(
jet
);
67
}
68
69
}
// end jet namespace
70
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ClosebyUncertaintyComponent.h
Helpers.h
JESUNC_ERROR_CODE
#define JESUNC_ERROR_CODE
Definition
Reconstruction/Jet/JetUncertainties/JetUncertainties/Helpers.h:22
JESUNC_NO_DEFAULT_CONSTRUCTOR
#define JESUNC_NO_DEFAULT_CONSTRUCTOR
Definition
Reconstruction/Jet/JetUncertainties/JetUncertainties/Helpers.h:23
jet::ClosebyUncertaintyComponent::getValidityImpl
virtual bool getValidityImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition
ClosebyUncertaintyComponent.cxx:47
jet::ClosebyUncertaintyComponent::ClosebyUncertaintyComponent
ClosebyUncertaintyComponent(const ComponentHelper &component)
Definition
ClosebyUncertaintyComponent.cxx:23
jet::ClosebyUncertaintyComponent::clone
virtual ClosebyUncertaintyComponent * clone() const
Definition
ClosebyUncertaintyComponent.cxx:35
jet::ClosebyUncertaintyComponent::getUncertaintyImpl
virtual double getUncertaintyImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition
ClosebyUncertaintyComponent.cxx:52
jet::ClosebyUncertaintyComponent::getMinDR
float getMinDR(const xAOD::Jet &jet) const
Definition
ClosebyUncertaintyComponent.cxx:57
jet::ComponentHelper
Definition
ConfigHelper.h:24
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
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