ATLAS Offline Software
SelectionReadAccessorInvert.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 
15 
16 //
17 // method implementations
18 //
19 
20 namespace CP
21 {
23  SelectionReadAccessorInvert (std::unique_ptr<ISelectionReadAccessor> val_base)
24  : m_base (std::move (val_base))
25  {}
26 
27 
28 
30  getBits (const SG::AuxElement& element,
31  const CP::SystematicSet *sys) const
32  {
33  if (m_base->getBool (element, sys) == false)
34  return selectionAccept();
35  else
36  return 0;
37  }
38 
39 
40 
42  getBool (const SG::AuxElement& element,
43  const CP::SystematicSet *sys) const
44  {
45  return m_base->getBool (element, sys) == false;
46  }
47 
48 
49 
51  label () const
52  {
53  return m_base->label() + ",invert";
54  }
55 
56 
57 
59  isBool () const
60  {
61  return true;
62  }
63 
64 
65 
68  const std::string& objectName) const
69  {
70  return m_base->getInputAffecting (svc, objectName);
71  }
72 
73 
74 
77  const std::vector<CP::SystematicSet>& sysList,
78  const std::string& objectName)
79  {
80  return m_base->fillSystematics (svc, sysList, objectName);
81  }
82 }
CP::SelectionReadAccessorInvert::label
virtual std::string label() const override
get the label of the accessor
Definition: SelectionReadAccessorInvert.cxx:51
CP::ISystematicsSvc
the interface for the central systematics service
Definition: ISystematicsSvc.h:25
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:446
CP::SelectionReadAccessorInvert::isBool
virtual bool isBool() const override
whether this accessor returns a simple boolean
Definition: SelectionReadAccessorInvert.cxx:59
CP::SelectionType
uint32_t SelectionType
the type for selection decorations that are meant to hold a asg::AcceptData
Definition: SelectionHelpers.h:26
CP::SelectionReadAccessorInvert::fillSystematics
virtual StatusCode fillSystematics(const ISystematicsSvc &svc, const std::vector< CP::SystematicSet > &sysList, const std::string &objectName) override
fill the systematic variations
Definition: SelectionReadAccessorInvert.cxx:76
SystematicSet.h
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::SelectionReadAccessorInvert::getBits
virtual SelectionType getBits(const SG::AuxElement &element, const CP::SystematicSet *sys) const override
get the selection decoration
Definition: SelectionReadAccessorInvert.cxx:30
CP::SelectionReadAccessorInvert::SelectionReadAccessorInvert
SelectionReadAccessorInvert(std::unique_ptr< ISelectionReadAccessor > val_base)
Definition: SelectionReadAccessorInvert.cxx:23
CP::SelectionReadAccessorInvert::getInputAffecting
virtual CP::SystematicSet getInputAffecting(const ISystematicsSvc &svc, const std::string &objectName) const override
get the systematics when reading from the decoration
Definition: SelectionReadAccessorInvert.cxx:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
CP::SelectionReadAccessorInvert::m_base
std::unique_ptr< ISelectionReadAccessor > m_base
the base selection accessors I invert
Definition: SelectionReadAccessorInvert.h:63
CP::SelectionReadAccessorInvert::getBool
virtual bool getBool(const SG::AuxElement &element, const CP::SystematicSet *sys) const override
get the selection decoration
Definition: SelectionReadAccessorInvert.cxx:42
CP::selectionAccept
constexpr SelectionType selectionAccept()
the selection decoration to apply for objects that are selected
Definition: SelectionHelpers.h:35
SelectionReadAccessorInvert.h