ATLAS Offline Software
Loading...
Searching...
No Matches
ElectronEfficiencyCorrectionAlg.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
19namespace CP
20{
21
22 StatusCode ElectronEfficiencyCorrectionAlg ::
23 initialize ()
24 {
25 if (m_scaleFactorDecoration.empty())
26 {
27 ANA_MSG_ERROR ("no scale factor decoration name set");
28 return StatusCode::FAILURE;
29 }
30
36 ANA_CHECK (m_systematicsList.initialize());
37 ANA_CHECK (m_outOfValidity.initialize());
38
39 return StatusCode::SUCCESS;
40 }
41
42
43
44 StatusCode ElectronEfficiencyCorrectionAlg ::
45 execute ()
46 {
47 for (const auto& sys : m_systematicsList.systematicsVector())
48 {
49 ANA_CHECK (m_efficiencyCorrectionTool->applySystematicVariation (sys));
50 const xAOD::ElectronContainer *electrons = nullptr;
51 ANA_CHECK (m_electronHandle.retrieve (electrons, sys));
52 for (const xAOD::Electron *electron : *electrons)
53 {
54 if (m_preselection.getBool (*electron, sys))
55 {
56 double sf = 0;
58 m_scaleFactorDecoration.set (*electron, sf, sys);
59 } else {
61 }
62 }
63 }
64 return StatusCode::SUCCESS;
65 }
66}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#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
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysListHandle m_systematicsList
the systematics list we run
SysReadHandle< xAOD::ElectronContainer > m_electronHandle
the electron collection we run on
ToolHandle< IAsgElectronEfficiencyCorrectionTool > m_efficiencyCorrectionTool
the smearing tool
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the electron scale factor
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Select isolated Photons, Electrons and Muons.
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Electron_v1 Electron
Definition of the current "egamma version".