ATLAS Offline Software
SysFilterReporterParams.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 #ifndef SYSTEMATICS_HANDLES__FILTER_REPORTER_PARAMS_H
10 #define SYSTEMATICS_HANDLES__FILTER_REPORTER_PARAMS_H
11 
16 #include <functional>
17 
18 #ifndef XAOD_STANDALONE
20 #include <GaudiKernel/ServiceHandle.h>
21 #endif
22 
23 class StatusCode;
24 
25 namespace CP
26 {
27  class SysListHandle;
36 
38  {
39  //
40  // public interface
41  //
42 
48  public:
49  template<typename T>
50  explicit SysFilterReporterParams (T *owner, std::string val_filterDescription);
51 
52 
58  public:
59  StatusCode initialize (SysListHandle &sysListHandle);
60 
61 
67  public:
69 
70 
71 
72  //
73  // private interface
74  //
75 
76  // this class does most of the actual work and acts as accessor to
77  // our private data members, and needs our internals for that.
79  friend class SysFilterReporter;
80 
85  private:
86  std::function<void(bool)> m_setFilterPassed;
87 
89  private:
91 
93  private:
95 
97  private:
98  unsigned m_passedOne {0};
99  unsigned m_passedNominal {0};
100  unsigned m_passedAll {0};
101 
103  private:
104  unsigned m_total {0};
105 
107  private:
108  bool m_isInitialized {false};
109 
111  private:
112  std::string m_filterDescription;
113 
114 
115 #ifndef XAOD_STANDALONE
116 
118  private:
120 
123  private:
125 
126 #endif
127  };
128 
129 
130 
131  //
132  // inline/template methods
133  //
134 
135  template<typename T> SysFilterReporterParams ::
136  SysFilterReporterParams (T *owner, std::string val_filterDescription)
137  : AsgMessagingForward (owner)
138  , m_setFilterPassed ([owner] (bool val_setFilterPassed) {owner->setFilterPassed (val_setFilterPassed);})
139  , m_eventInfoHandle (owner, "eventInfo", "EventInfo", "the event info object to run on")
140  , m_eventDecisionOutputDecoration (owner, "eventDecisionOutputDecoration", "", "the decoration for the event decision")
141  , m_filterDescription (std::move (val_filterDescription))
142 #ifndef XAOD_STANDALONE
143  , m_cutFlowSvc ("CutFlowSvc/CutFlowSvc", owner->name())
144 #endif
145  {
146  owner->declareProperty("FilterDescription", m_filterDescription,
147  "describe to the cutflowsvc what this filter does.");
148 
149 #ifndef XAOD_STANDALONE
150  owner->declareProperty("CutFlowSvc", m_cutFlowSvc,
151  "handle to the ICutFlowSvc instance this filtering algorithm"
152  " will use for building the flow of cuts.");
153 #endif
154  }
155 }
156 
157 #endif
CP::SysFilterReporterCombiner
a reporter class that combines the filter decisions for all systematics
Definition: SysFilterReporterCombiner.h:34
CP::SysListHandle
a class managing the property to configure the list of systematics to process
Definition: SysListHandle.h:33
SysWriteDecorHandle.h
asg::AsgMessagingForward
base class to forward messages to another class
Definition: AsgMessagingForward.h:29
CP::SysFilterReporterParams::m_total
unsigned m_total
counter for total events
Definition: SysFilterReporterParams.h:104
CP::SysFilterReporterParams::m_passedNominal
unsigned m_passedNominal
Definition: SysFilterReporterParams.h:99
CP::SysFilterReporterParams::m_eventInfoHandle
SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info we run on
Definition: SysFilterReporterParams.h:90
AsgMessagingForward.h
CP::SysFilterReporterParams::m_filterDescription
std::string m_filterDescription
description what this filter does
Definition: SysFilterReporterParams.h:112
CP::SysFilterReporterParams::m_setFilterPassed
std::function< void(bool)> m_setFilterPassed
the function to call setFilterPassed() on the algorithm
Definition: SysFilterReporterParams.h:86
CP::SysReadHandle
a data handle for reading systematics varied input data
Definition: SysReadHandle.h:32
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::SysFilterReporterParams::finalize
StatusCode finalize()
do anything we need to do in finalize
Definition: SysFilterReporterParams.cxx:63
CP::SysFilterReporterParams::m_passedOne
unsigned m_passedOne
counter for passed events
Definition: SysFilterReporterParams.h:98
SysReadHandle.h
CP::SysFilterReporterParams::m_cutFlowSvc
ServiceHandle< ICutFlowSvc > m_cutFlowSvc
the handle to the service holding tables of cut-flows for filtering algs.
Definition: SysFilterReporterParams.h:124
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::SysFilterReporter
a systematics aware filter reporter
Definition: SysFilterReporter.h:44
CutIdentifier
uint32_t CutIdentifier
InstanceIdentifier is a unique identifer used for every AthFilterAlgorithm instance.
Definition: ICutFlowSvc.h:22
CP::SysFilterReporterParams::m_isInitialized
bool m_isInitialized
whether the handle was initialized
Definition: SysFilterReporterParams.h:108
CP::SysFilterReporterParams::initialize
StatusCode initialize(SysListHandle &sysListHandle)
do anything we need to do in initialize
Definition: SysFilterReporterParams.cxx:25
ICutFlowSvc.h
EventInfo.h
CP::SysFilterReporterParams::m_eventDecisionOutputDecoration
SysWriteDecorHandle< char > m_eventDecisionOutputDecoration
the decoration for writing the event decision
Definition: SysFilterReporterParams.h:94
CP::SysFilterReporterParams::m_cutID
CutIdentifier m_cutID
the CutIdentifier for this filter algorithm
Definition: SysFilterReporterParams.h:119
CP::SysFilterReporterParams::m_passedAll
unsigned m_passedAll
Definition: SysFilterReporterParams.h:100
CP::SysFilterReporterParams
the properties and persistent data for systematics aware filter reporters
Definition: SysFilterReporterParams.h:38
CP::SysFilterReporterParams::SysFilterReporterParams
SysFilterReporterParams(T *owner, std::string val_filterDescription)
standard constructor
Definition: SysFilterReporterParams.h:136
CP::SysWriteDecorHandle< char >
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
ServiceHandle< ICutFlowSvc >