ATLAS Offline Software
Loading...
Searching...
No Matches
TauEfficiencyCorrectionsAlg.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 TauEfficiencyCorrectionsAlg ::
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 return StatusCode::SUCCESS;
39 }
40
41
42
43 StatusCode TauEfficiencyCorrectionsAlg ::
44 execute ()
45 {
46 for (const auto& sys : m_systematicsList.systematicsVector())
47 {
48 ANA_CHECK (m_efficiencyCorrectionsTool->applySystematicVariation (sys));
49 const xAOD::TauJetContainer *taus = nullptr;
50 ANA_CHECK (m_tauHandle.retrieve (taus, sys));
51 for (const xAOD::TauJet *tau : *taus)
52 {
53 if (m_preselection.getBool (*tau, sys))
54 {
55 double sf = 0;
56 ANA_CHECK_CORRECTION (m_outOfValidity, *tau, m_efficiencyCorrectionsTool->getEfficiencyScaleFactor (*tau, sf));
57 m_scaleFactorDecoration.set (*tau, sf, sys);
58 } else {
60 }
61 }
62 }
63 return StatusCode::SUCCESS;
64 }
65}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
static Double_t taus
#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
SysReadHandle< xAOD::TauJetContainer > m_tauHandle
the tau collection we run on
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
SysListHandle m_systematicsList
the systematics list we run
ToolHandle< TauAnalysisTools::ITauEfficiencyCorrectionsTool > m_efficiencyCorrectionsTool
the smearing tool
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the tau scale factor
Select isolated Photons, Electrons and Muons.
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".