ATLAS Offline Software
SysFilterReporterParams.cxx
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 // includes
10 //
11 
14 
17 
18 //
19 // method implementations
20 //
21 
22 namespace CP
23 {
25  initialize (SysListHandle &sysListHandle)
26  {
27  if (m_isInitialized)
28  {
29  ANA_MSG_FATAL ("calling initialize twice on SysFilterReporterParams, aborting");
30  return StatusCode::FAILURE;
31  }
32 
33  ANA_CHECK (m_eventInfoHandle.initialize(sysListHandle));
35 
37  {
38  ANA_MSG_ERROR ("no event filter decoration name set");
39  return StatusCode::FAILURE;
40  }
41 
42 #ifndef XAOD_STANDALONE
43  if (!m_cutFlowSvc.empty())
44  {
45  ANA_CHECK (m_cutFlowSvc.retrieve());
46  m_cutID = m_cutFlowSvc->registerFilter (m_cutFlowSvc.parentName(), m_filterDescription + " (nominal only)", false);
47  if (m_cutID == 0)
48  {
49  ANA_MSG_ERROR ("problem registering myself with cutflow-svc");
50  return StatusCode::FAILURE;
51  }
52  }
53 #endif
54 
55 
56  m_isInitialized = true;
57  return StatusCode::SUCCESS;
58  }
59 
60 
61 
63  finalize ()
64  {
65  if (!m_isInitialized)
66  {
67  ANA_MSG_FATAL ("using unitialized SysFilterReporterParams, aborting");
68  return StatusCode::FAILURE;
69  }
70 
71  ATH_MSG_INFO ("Events passing selection for at least one systematic: " << m_passedOne << " / " << m_total << " for " << m_filterDescription);
72  ATH_MSG_INFO ("Events passing selection for at nominal: " << m_passedNominal << " / " << m_total << " for " << m_filterDescription);
73  ATH_MSG_INFO ("Events passing selection for all systematics: " << m_passedAll << " / " << m_total << " for " << m_filterDescription);
74  return StatusCode::SUCCESS;
75  }
76 }
CP::SysListHandle
a class managing the property to configure the list of systematics to process
Definition: SysListHandle.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CP::SysFilterReporterParams::m_total
unsigned m_total
counter for total events
Definition: SysFilterReporterParams.h:104
SysListHandle.h
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
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
CP::SysFilterReporterParams::m_filterDescription
std::string m_filterDescription
description what this filter does
Definition: SysFilterReporterParams.h:112
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
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::SysWriteDecorHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize this handle
MessageCheck.h
macros for messaging and checking status codes
CP::SysFilterReporterParams::m_isInitialized
bool m_isInitialized
whether the handle was initialized
Definition: SysFilterReporterParams.h:108
ANA_MSG_FATAL
#define ANA_MSG_FATAL(xmsg)
Macro printing fatal messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:296
StatusCode.h
SysFilterReporterParams.h
CP::SysWriteDecorHandle::empty
virtual bool empty() const noexcept override
whether we have a name configured
CP::SysFilterReporterParams::initialize
StatusCode initialize(SysListHandle &sysListHandle)
do anything we need to do in initialize
Definition: SysFilterReporterParams.cxx:25
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