ATLAS Offline Software
Loading...
Searching...
No Matches
JetCalibrationAlg.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// 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 declareProperty ("calibrationTool", m_calibrationTool, "The calibration tool we apply");
26 }
27
28 StatusCode JetCalibrationAlg ::
29 initialize ()
30 {
31 ANA_CHECK (m_calibrationTool.retrieve());
33 ANA_CHECK (m_systematicsList.initialize());
34 return StatusCode::SUCCESS;
35 }
36
37
38
39 StatusCode JetCalibrationAlg ::
40 execute ()
41 {
42 for (const auto& sys : m_systematicsList.systematicsVector())
43 {
44 xAOD::JetContainer *jets = nullptr;
45 ANA_CHECK (m_jetHandle.getCopy (jets, sys));
46
47 if (m_HIsetup.value())
48 {
49 for(auto jet : *jets )
50 {
51 xAOD::JetFourMom_t jet_4mom_subtracted = (*jet).jetP4("JetSubtractedScaleMomentum");
52 (*jet).setJetP4("JetConstitScaleMomentum",jet_4mom_subtracted);
53 (*jet).setJetP4("JetEMScaleMomentum",jet_4mom_subtracted);
54 }
55 }
56
57 ANA_CHECK (m_calibrationTool->applyCalibration(*jets));
58 }
59
60 return StatusCode::SUCCESS;
61 }
62}
#define ANA_CHECK(EXP)
check whether the given expression was successful
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< IJetCalibrationTool > m_calibrationTool
the calibration tool
SysListHandle m_systematicsList
the systematics list we run
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