ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
Root
PMGTruthWeightAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
//
9
// includes
10
//
11
12
#include <
AsgAnalysisAlgorithms/PMGTruthWeightAlg.h
>
13
14
//
15
// method implementations
16
//
17
18
namespace
CP
19
{
20
21
StatusCode PMGTruthWeightAlg ::
22
initialize ()
23
{
24
if
(
m_decoration
.empty())
25
{
26
ANA_MSG_ERROR
(
"no decoration name set"
);
27
return
StatusCode::FAILURE;
28
}
29
30
ANA_CHECK
(
m_truthWeightTool
.retrieve());
31
ANA_CHECK
(
m_systematicsList
.addSystematics (*
m_truthWeightTool
));
32
ANA_CHECK
(
m_eventInfoHandle
.initialize (
m_systematicsList
));
33
ANA_CHECK
(
m_decoration
.initialize (
m_systematicsList
,
m_eventInfoHandle
));
34
ANA_CHECK
(
m_systematicsList
.initialize());
35
36
return
StatusCode::SUCCESS;
37
}
38
39
40
StatusCode PMGTruthWeightAlg ::
41
execute (
const
EventContext& ctx)
42
{
43
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
44
{
45
const
xAOD::EventInfo
*eventInfo =
nullptr
;
46
ANA_CHECK
(
m_eventInfoHandle
.retrieve (eventInfo, sys, ctx));
47
48
m_decoration
.set (*eventInfo,
m_truthWeightTool
->getSysWeight(eventInfo,sys), sys);
49
}
50
51
return
StatusCode::SUCCESS;
52
}
53
}
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
PMGTruthWeightAlg.h
CP::PMGTruthWeightAlg::m_truthWeightTool
ToolHandle< PMGTools::IPMGTruthWeightTool > m_truthWeightTool
the tool
Definition
PMGTruthWeightAlg.h:30
CP::PMGTruthWeightAlg::m_eventInfoHandle
SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info we decorate
Definition
PMGTruthWeightAlg.h:38
CP::PMGTruthWeightAlg::m_decoration
SysWriteDecorHandle< float > m_decoration
the decoration for the truth weights
Definition
PMGTruthWeightAlg.h:43
CP::PMGTruthWeightAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
PMGTruthWeightAlg.h:34
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
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