ATLAS Offline Software
Loading...
Searching...
No Matches
JetFFSmearingAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7//
8// includes
9//
10
12#include <algorithm>
13
14//
15// method implementations
16//
17
18namespace CP {
19
20StatusCode JetFFSmearingAlg ::initialize() {
21 ANA_CHECK(m_FFSmearingTool.retrieve());
25
27 ANA_CHECK(m_systematicsList.initialize());
28 ANA_CHECK(m_outOfValidity.initialize());
29
30 // FIXME: while the FFJetSmearingTool is unable to accept external systematics,
31 // we make our own vector of systematics
32 const CP::SystematicSet& recommendedSysts = m_FFSmearingTool->recommendedSystematics();
33 for (const auto &sys : recommendedSysts) m_systematicsVector.push_back(CP::SystematicSet({sys}));
34
35 return StatusCode::SUCCESS;
36}
37
38StatusCode JetFFSmearingAlg ::execute() {
39 for (const auto &sys : m_systematicsList.systematicsVector()) {
40 xAOD::JetContainer *jets = nullptr;
41 ANA_CHECK(m_jetHandle.getCopy(jets, sys));
42
43 // FIXME: while the FFJetSmearingTool is unable to accept external systematics,
44 // only run over the internal ones
45 if ( std::find(m_systematicsVector.begin(), m_systematicsVector.end(), sys) == m_systematicsVector.end() ) continue;
46
47 ANA_CHECK(m_FFSmearingTool->applySystematicVariation(sys));
48
49 for (xAOD::Jet *jet : *jets) {
50 if (m_preselection.getBool(*jet, sys)) {
52 m_FFSmearingTool->applyCorrection(*jet));
53 }
54 }
55 }
56 return StatusCode::SUCCESS;
57}
58} // 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
SysCopyHandle< xAOD::JetContainer > m_jetHandle
the large-R jet collection we run on
std::vector< CP::SystematicSet > m_systematicsVector
FIXME: vector of FFJetSmearingTool systematics, while the tool is unable to handle external systemati...
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.
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".