Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
18 namespace CP {
19 
21  ANA_CHECK(m_FFSmearingTool.retrieve());
25 
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 
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
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
CP::SysListHandle::addSystematics
StatusCode addSystematics(const CP::SystematicSet &recommended, const CP::SystematicSet &affecting)
register a set of affecting variables for the current algorithm (usually obtained from an CP::ISystem...
Definition: SysListHandle.cxx:48
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
CP::SysReadSelectionHandle::getBool
bool getBool(const SG::AuxElement &element, const CP::SystematicSet &sys) const
get the selection as a bool
CP::JetFFSmearingAlg::m_systematicsVector
std::vector< CP::SystematicSet > m_systematicsVector
FIXME: vector of FFJetSmearingTool systematics, while the tool is unable to handle external systemati...
Definition: JetFFSmearingAlg.h:38
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::JetFFSmearingAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: JetFFSmearingAlg.h:34
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CP::JetFFSmearingAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition: JetFFSmearingAlg.h:47
ANA_CHECK_CORRECTION
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
Definition: OutOfValidityHelper.h:132
CP::JetFFSmearingAlg::m_outOfValidity
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Definition: JetFFSmearingAlg.h:52
CP::JetFFSmearingAlg::m_jetHandle
SysCopyHandle< xAOD::JetContainer > m_jetHandle
the large-R jet collection we run on
Definition: JetFFSmearingAlg.h:42
CP::OutOfValidityHelper::initialize
::StatusCode initialize()
standard initialize
Definition: OutOfValidityHelper.cxx:25
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CP::JetFFSmearingAlg::initialize
virtual StatusCode initialize() override
Definition: JetFFSmearingAlg.cxx:20
CP::JetFFSmearingAlg::m_FFSmearingTool
ToolHandle< ICPJetCorrectionTool > m_FFSmearingTool
the large-R jet FF smearing tool
Definition: JetFFSmearingAlg.h:29
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
JetFFSmearingAlg.h
CP::JetFFSmearingAlg::execute
virtual StatusCode execute() override
Definition: JetFFSmearingAlg.cxx:38
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30