ATLAS Offline Software
Loading...
Searching...
No Matches
SelectionWriteAccessorBits.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
13
17
18//
19// method implementations
20//
21
22namespace CP
23{
24 SelectionWriteAccessorBits ::
25 SelectionWriteAccessorBits (const std::string& name)
27 {}
28
29
30
31 void SelectionWriteAccessorBits ::
32 setBits (const SG::AuxElement& element,
34 const CP::SystematicSet * /*sys*/) const
35 {
36 m_accessor (element) = selection;
37 }
38
39
40
41 void SelectionWriteAccessorBits ::
42 setBool (const SG::AuxElement& element,
43 bool selection,
44 const CP::SystematicSet * /*sys*/) const
45 {
46 if (selection)
47 m_accessor (element) = selectionAccept();
48 else
49 m_accessor (element) = selectionAccept() ^ 0x1;
50 }
51
52
53
54 std::string SelectionWriteAccessorBits ::
55 label () const
56 {
57 return m_label;
58 }
59
60
61
62 StatusCode SelectionWriteAccessorBits ::
63 fillSystematics (const ISystematicsSvc& svc,
64 const CP::SystematicSet& fullAffecting,
65 const std::vector<CP::SystematicSet>& /*sysList*/,
66 ISysObjectHandleBase& objectHandle)
67 {
68 using namespace msgSelectionHelpers;
69
70 ANA_CHECK (svc.setDecorSystematics (objectHandle.getNamePattern(), m_label, fullAffecting));
71 ANA_CHECK (objectHandle.addDecorationDependency (svc, m_label, true));
72 return StatusCode::SUCCESS;
73 }
74}
#define ANA_CHECK(EXP)
check whether the given expression was successful
a ISysHandleBase for a handle to a specific object/container
virtual StatusCode addDecorationDependency(const ISystematicsSvc &svc, const std::string &decoName, bool decoWrite)=0
add dependency information for the given decoration
virtual std::string getNamePattern() const =0
get the name pattern before substitution
the interface for the central systematics service
SG::Decorator< SelectionType > m_accessor
the underlying accessor
std::string m_label
the label of the accessor
Class to wrap a set of SystematicVariations.
Base class for elements of a container that can have aux data.
Definition AuxElement.h:484
const std::string selection
Select isolated Photons, Electrons and Muons.
uint32_t SelectionType
the type for selection decorations that are meant to hold a asg::AcceptData
constexpr SelectionType selectionAccept()
the selection decoration to apply for objects that are selected