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
22 StatusCode TauSmearingAlg ::
23 initialize ()
24 {
25 ANA_CHECK (m_smearingTool.retrieve());
28 ANA_CHECK (m_systematicsList.addSystematics (*m_smearingTool));
29 ANA_CHECK (m_systematicsList.initialize());
30 ANA_CHECK (m_outOfValidity.initialize());
31 return StatusCode::SUCCESS;
32 }
33
34
35
36 StatusCode TauSmearingAlg ::
37 execute ()
38 {
39 for (const auto& sys : m_systematicsList.systematicsVector())
40 {
41 ANA_CHECK (m_smearingTool->applySystematicVariation (sys));
42 xAOD::TauJetContainer *taus = nullptr;
43 ANA_CHECK (m_tauHandle.getCopy (taus, sys));
44 static const SG::Accessor<char> accTESCompatibility("TESCompatibility");
45 for (xAOD::TauJet *tau : *taus)
46 {
47 if (m_preselection.getBool (*tau, sys))
48 {
49 ANA_CHECK_CORRECTION (m_outOfValidity, *tau, m_smearingTool->applyCorrection (*tau));
50 } else {
51 accTESCompatibility(*tau) = char(0);
52 }
53 }
54 }
55 return StatusCode::SUCCESS;
56 }
57}
#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.
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".