ATLAS Offline Software
EgammaCalibrationAndSmearingAlg.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 
7 
8 
9 //
10 // includes
11 //
12 
14 
15 //
16 // method implementations
17 //
18 
19 namespace CP
20 {
21 
23  initialize ()
24  {
28  if (!m_noToolSystematics.value())
32  return StatusCode::SUCCESS;
33  }
34 
35 
36 
38  execute ()
39  {
40  for (const auto& sys : m_systematicsList.systematicsVector())
41  {
42  // always need to call `getCopy` first to ensure that the shallow copies
43  // are all there if requested
44  xAOD::EgammaContainer *egammas = nullptr;
45  ANA_CHECK (m_egammaHandle.getCopy (egammas, sys));
46 
47  if (sys.empty() && m_skipNominal.value())
48  continue;
49 
50  if (!m_noToolSystematics.value())
51  ANA_CHECK (m_calibrationAndSmearingTool->applySystematicVariation (sys));
52  for (xAOD::Egamma *egamma : *egammas)
53  {
55  {
57  }
58  }
59  }
60  return StatusCode::SUCCESS;
61  }
62 }
CP::EgammaCalibrationAndSmearingAlg::m_egammaHandle
SysCopyHandle< xAOD::EgammaContainer > m_egammaHandle
the egamma collection we run on
Definition: EgammaCalibrationAndSmearingAlg.h:64
CP::SysListHandle::addSystematics
StatusCode addSystematics(const CP::SystematicSet &recommended, const CP::SystematicSet &affecting)
register a set of affecting variables for the current algorithm (usually obtained from an CP::ISystem...
Definition: SysListHandle.cxx:48
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
egamma
Definition: egamma.h:58
CP::EgammaCalibrationAndSmearingAlg::initialize
StatusCode initialize() override
Definition: EgammaCalibrationAndSmearingAlg.cxx:23
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::EgammaCalibrationAndSmearingAlg::m_noToolSystematics
Gaudi::Property< bool > m_noToolSystematics
whether to ignore all tool systematics
Definition: EgammaCalibrationAndSmearingAlg.h:50
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CP::EgammaCalibrationAndSmearingAlg::m_skipNominal
Gaudi::Property< bool > m_skipNominal
whether to skip the nominal correction (for PHYSLITE)
Definition: EgammaCalibrationAndSmearingAlg.h:55
ANA_CHECK_CORRECTION
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
Definition: OutOfValidityHelper.h:132
CP::EgammaCalibrationAndSmearingAlg::m_outOfValidity
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Definition: EgammaCalibrationAndSmearingAlg.h:74
CP::OutOfValidityHelper::initialize
::StatusCode initialize()
standard initialize
Definition: OutOfValidityHelper.cxx:25
EgammaCalibrationAndSmearingAlg.h
CP::EgammaCalibrationAndSmearingAlg::m_calibrationAndSmearingTool
ToolHandle< CP::IEgammaCalibrationAndSmearingTool > m_calibrationAndSmearingTool
the smearing tool
Definition: EgammaCalibrationAndSmearingAlg.h:38
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
CP::EgammaCalibrationAndSmearingAlg::execute
StatusCode execute() override
Definition: EgammaCalibrationAndSmearingAlg.cxx:38
CP::EgammaCalibrationAndSmearingAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: EgammaCalibrationAndSmearingAlg.h:60
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CP::EgammaCalibrationAndSmearingAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition: EgammaCalibrationAndSmearingAlg.h:69