ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
14//
15// method implementations
16//
17
18namespace 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());
34 ANA_CHECK (m_systematicsList.initialize());
35
36 return StatusCode::SUCCESS;
37 }
38
39
40 StatusCode PMGTruthWeightAlg ::
41 execute ()
42 {
43 for (const auto& sys : m_systematicsList.systematicsVector())
44 {
45 const xAOD::EventInfo *eventInfo = nullptr;
46 ANA_CHECK (m_eventInfoHandle.retrieve (eventInfo, sys));
47
48 m_decoration.set (*eventInfo, m_truthWeightTool->getSysWeight(eventInfo,sys), sys);
49 }
50
51 return StatusCode::SUCCESS;
52 }
53}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
ToolHandle< PMGTools::IPMGTruthWeightTool > m_truthWeightTool
the tool
SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info we decorate
SysWriteDecorHandle< float > m_decoration
the decoration for the truth weights
SysListHandle m_systematicsList
the systematics list we run
Select isolated Photons, Electrons and Muons.
EventInfo_v1 EventInfo
Definition of the latest event info version.