ATLAS Offline Software
Loading...
Searching...
No Matches
TauSmearingAlg.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 // do this accessor at the file level to ensure it gets constructed
22 // before we configure the output
23 static const SG::Accessor<char> accTESCompatibility("TESCompatibility");
24
25 StatusCode TauSmearingAlg ::
26 initialize ()
27 {
28 ANA_CHECK (m_smearingTool.retrieve());
31 ANA_CHECK (m_systematicsList.addSystematics (*m_smearingTool));
32 ANA_CHECK (m_systematicsList.initialize());
33 ANA_CHECK (m_outOfValidity.initialize());
34 return StatusCode::SUCCESS;
35 }
36
37
38
39 StatusCode TauSmearingAlg ::
40 execute ()
41 {
42 for (const auto& sys : m_systematicsList.systematicsVector())
43 {
44 ANA_CHECK (m_smearingTool->applySystematicVariation (sys));
45 xAOD::TauJetContainer *taus = nullptr;
46 ANA_CHECK (m_tauHandle.getCopy (taus, sys));
47 for (xAOD::TauJet *tau : *taus)
48 {
49 if (m_preselection.getBool (*tau, sys))
50 {
51 ANA_CHECK_CORRECTION (m_outOfValidity, *tau, m_smearingTool->applyCorrection (*tau));
52 } else {
53 accTESCompatibility(*tau) = char(0);
54 }
55 }
56 }
57 return StatusCode::SUCCESS;
58 }
59}
#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
ToolHandle< TauAnalysisTools::ITauSmearingTool > m_smearingTool
the smearing tool
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
SysCopyHandle< xAOD::TauJetContainer > m_tauHandle
the tau collection we run on
SysListHandle m_systematicsList
the systematics list we run
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Helper class to provide type-safe access to aux data.
Select isolated Photons, Electrons and Muons.
static const SG::Accessor< char > accTESCompatibility("TESCompatibility")
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".