ATLAS Offline Software
Loading...
Searching...
No Matches
JetFFSmearingAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7//
8// includes
9//
10
12
13//
14// method implementations
15//
16
17namespace CP {
18
19StatusCode JetFFSmearingAlg ::initialize() {
20 ANA_CHECK(m_FFSmearingTool.retrieve());
24
26 ANA_CHECK(m_systematicsList.initialize());
27 ANA_CHECK(m_outOfValidity.initialize());
28
29 // FIXME: while the FFJetSmearingTool is unable to accept external systematics,
30 // we make our own set of systematics names
31 const CP::SystematicSet& recommendedSysts = m_FFSmearingTool->recommendedSystematics();
32 for (const auto &sys : recommendedSysts) m_systematicsNames.insert(CP::SystematicSet({sys}).name());
33
34 return StatusCode::SUCCESS;
35}
36
37StatusCode JetFFSmearingAlg ::execute(const EventContext& ctx) {
38 for (const auto &sys : m_systematicsList.systematicsVector()) {
39 xAOD::JetContainer *jets = nullptr;
40 ANA_CHECK(m_jetHandle.getCopy(jets, sys, ctx));
41
42 // FIXME: while the FFJetSmearingTool is unable to accept external systematics,
43 // only run over the internal ones
44 if ( !m_systematicsNames.contains(sys.name()) ) continue;
45
46 ANA_CHECK(m_FFSmearingTool->applySystematicVariation(sys));
47
48 for (xAOD::Jet *jet : *jets) {
49 if (m_preselection.getBool(*jet, sys)) {
51 m_FFSmearingTool->applyCorrection(*jet));
52 }
53 }
54 }
55 return StatusCode::SUCCESS;
56}
57} // namespace CP
#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
ToolHandle< ICPJetCorrectionTool > m_FFSmearingTool
the large-R jet FF smearing tool
std::unordered_set< std::string > m_systematicsNames
FIXME: names of FFJetSmearingTool systematics, while the tool is unable to handle external systematic...
SysCopyHandle< xAOD::JetContainer > m_jetHandle
the large-R jet collection we run on
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysListHandle m_systematicsList
the systematics list we run
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Class to wrap a set of SystematicVariations.
std::string name() const
returns: the systematics joined into a single string.
Select isolated Photons, Electrons and Muons.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".