ATLAS Offline Software
Loading...
Searching...
No Matches
DiTauEfficiencyCorrectionsAlg.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 DiTauEfficiencyCorrectionsAlg ::
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 DiTauEfficiencyCorrectionsAlg ::
44 execute ()
45 {
46 for (const auto& sys : m_systematicsList.systematicsVector())
47 {
48 ANA_CHECK (m_efficiencyCorrectionsTool->applySystematicVariation (sys));
49 const xAOD::DiTauJetContainer *taus = nullptr;
50 ANA_CHECK (m_tauHandle.retrieve (taus, sys));
51 for (const xAOD::DiTauJet *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
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
ToolHandle< TauAnalysisTools::IDiTauEfficiencyCorrectionsTool > m_efficiencyCorrectionsTool
the smearing tool
SysListHandle m_systematicsList
the systematics list we run
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the muon scale factor
SysReadHandle< xAOD::DiTauJetContainer > m_tauHandle
the tau collection we run on
Select isolated Photons, Electrons and Muons.
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
DiTauJetContainer_v1 DiTauJetContainer
Definition of the current DiTauJet container version.
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17