ATLAS Offline Software
Loading...
Searching...
No Matches
EgammaCalibrationAndSmearingAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
19namespace CP
20{
21
22 StatusCode EgammaCalibrationAndSmearingAlg ::
23 initialize ()
24 {
29 if (!m_noToolSystematics.value())
31 ANA_CHECK (m_systematicsList.initialize());
32 ANA_CHECK (m_outOfValidity.initialize());
33 return StatusCode::SUCCESS;
34 }
35
36
37
38 StatusCode EgammaCalibrationAndSmearingAlg ::
39 execute ()
40 {
41 for (const auto& sys : m_systematicsList.systematicsVector())
42 {
43 // always need to call `getCopy` first to ensure that the shallow copies
44 // are all there if requested
45 xAOD::EgammaContainer *egammas = nullptr;
46 ANA_CHECK (m_egammaHandle.getCopy (egammas, sys));
47
48 if (sys.empty() && m_skipNominal.value())
49 continue;
50
51 if (!m_noToolSystematics.value())
52 ANA_CHECK (m_calibrationAndSmearingTool->applySystematicVariation (sys));
53 for (xAOD::Egamma *egamma : *egammas)
54 {
55 if (m_preselection.getBool (*egamma, sys))
56 {
58 float caloClusterEnergyReso = m_calibrationAndSmearingTool->getResolution (*egamma);
59 m_caloClusterEnergyResoHandle.set(*egamma, caloClusterEnergyReso, sys);
60 }
61 }
62 }
63 return StatusCode::SUCCESS;
64 }
65}
#define ANA_CHECK(EXP)
check whether the given expression was successful
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
ToolHandle< CP::IEgammaCalibrationAndSmearingTool > m_calibrationAndSmearingTool
the smearing tool
Gaudi::Property< bool > m_skipNominal
whether to skip the nominal correction (for PHYSLITE)
SysListHandle m_systematicsList
the systematics list we run
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Gaudi::Property< bool > m_noToolSystematics
whether to ignore all tool systematics
SysWriteDecorHandle< float > m_caloClusterEnergyResoHandle
decoration for calorimeter cluster energy resolution
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysCopyHandle< xAOD::EgammaContainer > m_egammaHandle
the egamma collection we run on
elec/gamma data class.
Definition egamma.h:58
Select isolated Photons, Electrons and Muons.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".