ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
SelectionHelpers
Root
SysWriteSelectionHandle.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
//
9
// includes
10
//
11
12
#include <
SelectionHelpers/SysWriteSelectionHandle.h
>
13
14
#include <
AsgMessaging/MessageCheck.h
>
15
#include <
AsgMessaging/StatusCode.h
>
16
#include <
SelectionHelpers/SelectionWriteAccessorNull.h
>
17
#include <
SystematicsHandles/SysListHandle.h
>
18
19
//
20
// method implementations
21
//
22
23
namespace
CP
24
{
25
SysWriteSelectionHandle ::
26
operator
bool
()
const
noexcept
27
{
28
return
!
m_selection
.empty();
29
}
30
31
32
33
StatusCode SysWriteSelectionHandle ::
34
initialize (
SysListHandle
& sysListHandle,
ISysObjectHandleBase
& objectHandle)
35
{
36
if
(
m_selection
.empty())
37
{
38
ANA_MSG_ERROR
(
"trying to initialize empty handle"
);
39
return
StatusCode::FAILURE;
40
}
41
if
(
m_objectHandle
!=
nullptr
)
42
{
43
ANA_MSG_ERROR
(
"trying to initialize handle twice"
);
44
return
StatusCode::FAILURE;
45
}
46
m_objectHandle
= &objectHandle;
47
ANA_CHECK
(
makeSelectionWriteAccessor
(
m_selection
,
m_accessor
));
48
return
sysListHandle.
addHandle
(*
this
);
49
}
50
51
52
53
StatusCode SysWriteSelectionHandle ::
54
initialize (
SysListHandle
& sysListHandle,
ISysObjectHandleBase
& objectHandle,
SG::AllowEmptyEnum
)
55
{
56
if
(!
empty
())
57
return
initialize
(sysListHandle, objectHandle);
58
else
59
{
60
m_accessor
= std::make_unique<SelectionWriteAccessorNull>();
61
return
StatusCode::SUCCESS;
62
}
63
}
64
65
66
67
bool
SysWriteSelectionHandle ::
68
empty ()
const
noexcept
69
{
70
return
m_selection
.empty();
71
}
72
73
74
75
std::string SysWriteSelectionHandle ::
76
getLabel ()
const
77
{
78
return
m_accessor
->label();
79
}
80
81
82
83
const
std::string& SysWriteSelectionHandle ::
84
getSelection ()
const
85
{
86
return
m_selection
;
87
}
88
89
90
91
CP::SystematicSet
SysWriteSelectionHandle ::
92
getInputAffecting (
const
ISystematicsSvc
&
/*svc*/
)
const
93
{
94
return
CP::SystematicSet
();
95
}
96
97
98
99
StatusCode SysWriteSelectionHandle ::
100
fillSystematics (
const
ISystematicsSvc
& svc,
101
const
CP::SystematicSet
& fullAffecting,
102
const
std::vector<CP::SystematicSet>& sysList)
103
{
104
ANA_CHECK
(
m_accessor
->fillSystematics (svc, fullAffecting, sysList, *
m_objectHandle
));
105
return
StatusCode::SUCCESS;
106
}
107
}
MessageCheck.h
macros for messaging and checking status codes
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
StatusCode.h
SelectionWriteAccessorNull.h
SysListHandle.h
SysWriteSelectionHandle.h
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
CP::ISysObjectHandleBase
a ISysHandleBase for a handle to a specific object/container
Definition
ISysHandleBase.h:58
CP::ISystematicsSvc
the interface for the central systematics service
Definition
ISystematicsSvc.h:26
CP::SysListHandle
a class managing the property to configure the list of systematics to process
Definition
SysListHandle.h:33
CP::SysListHandle::addHandle
StatusCode addHandle(ISysHandleBase &handle)
register an input handle we are using
Definition
SysListHandle.cxx:29
CP::SysWriteSelectionHandle::m_objectHandle
ISysObjectHandleBase * m_objectHandle
the object handle we use
Definition
SysWriteSelectionHandle.h:102
CP::SysWriteSelectionHandle::m_selection
std::string m_selection
the selection we use
Definition
SysWriteSelectionHandle.h:98
CP::SysWriteSelectionHandle::m_accessor
std::unique_ptr< ISelectionWriteAccessor > m_accessor
the accessor we use
Definition
SysWriteSelectionHandle.h:106
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition
SystematicSet.h:31
const
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
CP::makeSelectionWriteAccessor
StatusCode makeSelectionWriteAccessor(const std::string &name, std::unique_ptr< ISelectionWriteAccessor > &accessor, bool defaultToChar)
Produces a simple ISelectionWriteAccessor accessing the given decoration.
Definition
ISelectionAccessor.cxx:169
SG::AllowEmptyEnum
AllowEmptyEnum
Definition
StoreGate/StoreGate/VarHandleKey.h:26
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition
TrigDecision_v1.cxx:60
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.17.0