ATLAS Offline Software
SaveFilterAlg.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 
10 
11 namespace CP {
12 
13  SaveFilterAlg::SaveFilterAlg(const std::string &name, ISvcLocator *pSvcLocator)
14  : EL::AnaAlgorithm(name, pSvcLocator)
15  {}
16 
19 
21 
25 
27 
28  return StatusCode::SUCCESS;
29  }
30 
32  // the event-level filter
34 
35  for (const auto& sys : m_systematicsList.systematicsVector()) {
36  // the per-systematic filter
37  CP::SysFilterReporter filter(filterCombiner, sys);
38 
39  // retrieve the EventInfo
40  const xAOD::EventInfo *evtInfo {nullptr};
41  ANA_CHECK(m_eventInfoHandle.retrieve(evtInfo, sys));
42 
43  // default-decorate EventInfo
44  m_outputselection.setBool(*evtInfo, 0, sys);
45  m_decoration.set(*evtInfo, 0, sys);
46 
47  // check the selections
48  bool passSelection = m_inputselection.getBool(*evtInfo, sys);
49  if (passSelection) {
50  filter.setPassed(true);
51  m_outputselection.setBool(*evtInfo, passSelection, sys);
52  m_decoration.set(*evtInfo, passSelection, sys);
53  }
54  }
55 
56  return StatusCode::SUCCESS;
57  }
58 
61  return StatusCode::SUCCESS;
62  }
63 
64 } // namespace CP
CP::SysFilterReporterCombiner
a reporter class that combines the filter decisions for all systematics
Definition: SysFilterReporterCombiner.h:34
CP::SaveFilterAlg::m_decoration
CP::SysWriteDecorHandle< char > m_decoration
the output selection decoration for the event filter
Definition: SaveFilterAlg.h:65
CP::SysWriteDecorHandle::set
void set(const SG::AuxElement &object, const T &value, const CP::SystematicSet &sys) const
set the object decoration for the given systematic
CP::SaveFilterAlg::SaveFilterAlg
SaveFilterAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
Definition: SaveFilterAlg.cxx:13
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SaveFilterAlg::m_systematicsList
CP::SysListHandle m_systematicsList
the systematics
Definition: SaveFilterAlg.h:39
CP::SaveFilterAlg::m_outputselection
CP::SysWriteSelectionHandle m_outputselection
the output selection decoration
Definition: SaveFilterAlg.h:60
CP::SaveFilterAlg::m_filterParams
CP::SysFilterReporterParams m_filterParams
the save filter
Definition: SaveFilterAlg.h:52
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
SaveFilterAlg.h
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::SaveFilterAlg::execute
virtual StatusCode execute() override
Definition: SaveFilterAlg.cxx:31
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::SaveFilterAlg::m_eventInfoHandle
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info handle
Definition: SaveFilterAlg.h:47
SysFilterReporter.h
CP::SysWriteSelectionHandle::setBool
void setBool(const SG::AuxElement &element, bool selection, const CP::SystematicSet &sys) const
set the selection decoration
CP::SaveFilterAlg::finalize
virtual StatusCode finalize() override
Definition: SaveFilterAlg.cxx:59
covarianceTool.filter
filter
Definition: covarianceTool.py:514
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
CP::SysReadSelectionHandle::getBool
bool getBool(const SG::AuxElement &element, const CP::SystematicSet &sys) const
get the selection as a bool
CP::SaveFilterAlg::initialize
virtual StatusCode initialize() override
Definition: SaveFilterAlg.cxx:17
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
CP::SysFilterReporter
a systematics aware filter reporter
Definition: SysFilterReporter.h:44
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
SysFilterReporterCombiner.h
CP::SaveFilterAlg::m_inputselection
CP::SysReadSelectionHandle m_inputselection
the input selections
Definition: SaveFilterAlg.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CP::SysFilterReporterParams::initialize
StatusCode initialize(SysListHandle &sysListHandle)
do anything we need to do in initialize
Definition: SysFilterReporterParams.cxx:25
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
CP::SaveFilterAlg::m_noFilter
Gaudi::Property< bool > m_noFilter
whether to not apply an event filter
Definition: SaveFilterAlg.h:57
CP::SysWriteSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysWriteSelectionHandle.cxx:34