ATLAS Offline Software
Loading...
Searching...
No Matches
SysReadSelectionHandle.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
18
19//
20// method implementations
21//
22
23namespace CP
24{
25 SysReadSelectionHandle ::
26 operator bool () const noexcept
27 {
28 return !m_selection.empty();
29 }
30
31
32
33 StatusCode SysReadSelectionHandle ::
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;
48 return sysListHandle.addHandle (*this);
49 }
50
51
52
53 StatusCode SysReadSelectionHandle ::
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<SelectionReadAccessorNull>(true);
61 return StatusCode::SUCCESS;
62 }
63 }
64
65
66
67 bool SysReadSelectionHandle ::
68 empty () const noexcept
69 {
70 return m_selection.empty();
71 }
72
73 const std::string& SysReadSelectionHandle ::
74 getSelectionName () const
75 {
76 return m_selection;
77 }
78
79
80 CP::SystematicSet SysReadSelectionHandle ::
81 getInputAffecting (const ISystematicsSvc& svc) const
82 {
83 return m_accessor->getInputAffecting (svc, m_objectHandle->getNamePattern());
84 }
85
86
87
88 StatusCode SysReadSelectionHandle ::
89 fillSystematics (const ISystematicsSvc& svc,
90 const CP::SystematicSet& /*fullAffecting*/,
91 const std::vector<CP::SystematicSet>& sysList)
92 {
93 ANA_CHECK (m_accessor->fillSystematics (svc, sysList, *m_objectHandle));
94 return StatusCode::SUCCESS;
95 }
96}
macros for messaging and checking status codes
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
static const Attributes_t empty
a ISysHandleBase for a handle to a specific object/container
the interface for the central systematics service
a class managing the property to configure the list of systematics to process
StatusCode addHandle(ISysHandleBase &handle)
register an input handle we are using
std::unique_ptr< ISelectionReadAccessor > m_accessor
the accessor we use
std::string m_selection
the selection we use
ISysObjectHandleBase * m_objectHandle
the object handle we use
Class to wrap a set of SystematicVariations.
Select isolated Photons, Electrons and Muons.
StatusCode makeSelectionReadAccessor(const std::string &expr, std::unique_ptr< ISelectionReadAccessor > &accessor, bool defaultToChar)
make the ISelectionReadAccessor for the given name
setBGCode setTAP setLVL2ErrorBits bool
void initialize()