ATLAS Offline Software
Loading...
Searching...
No Matches
JetCalibrationAlg.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//
9// includes
10//
11
13
14//
15// method implementations
16//
17
18namespace CP
19{
20
21 JetCalibrationAlg ::
22 JetCalibrationAlg (const std::string& name, ISvcLocator* pSvcLocator)
23 : EL::AnaAlgorithm (name, pSvcLocator)
24 {
25 }
26
27 StatusCode JetCalibrationAlg ::
28 initialize ()
29 {
30 ANA_CHECK (m_calibrationTool.retrieve());
32 ANA_CHECK (m_systematicsList.initialize());
33 return StatusCode::SUCCESS;
34 }
35
36
37
38 StatusCode JetCalibrationAlg ::
39 execute (const EventContext& ctx)
40 {
41 static const std::string subtractedStr{"JetSubtractedScaleMomentum"};
42 static const std::string constitStr{"JetConstitScaleMomentum"};
43 static const std::string emScaleStr{"JetEMScaleMomentum"};
44 for (const auto& sys : m_systematicsList.systematicsVector())
45 {
46 xAOD::JetContainer *jets = nullptr;
47 ANA_CHECK (m_jetHandle.getCopy (jets, sys, ctx));
48
49 if (m_HIsetup.value())
50 {
51 for(auto jet : *jets )
52 {
53 xAOD::JetFourMom_t jet_4mom_subtracted = (*jet).jetP4(subtractedStr);
54 (*jet).setJetP4(constitStr,jet_4mom_subtracted);
55 (*jet).setJetP4(emScaleStr,jet_4mom_subtracted);
56 }
57 }
58
59 ANA_CHECK (m_calibrationTool->applyCalibration(*jets));
60 }
61
62 return StatusCode::SUCCESS;
63 }
64}
#define ANA_CHECK(EXP)
check whether the given expression was successful
SysListHandle m_systematicsList
the systematics list we run
PublicToolHandle< IJetCalibrationTool > m_calibrationTool
the calibration tool
Gaudi::Property< bool > m_HIsetup
whether we run on the HIJets collection
SysCopyHandle< xAOD::JetContainer > m_jetHandle
the jet collection we run on
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Select isolated Photons, Electrons and Muons.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17