ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
JetAnalysisAlgorithms
Root
ReclusteredJetCalibrationAlg.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
12
#include <
JetAnalysisAlgorithms/ReclusteredJetCalibrationAlg.h
>
13
#include <vector>
14
#include <string>
15
//
16
// method implementations
17
//
18
19
namespace
CP
20
{
21
22
StatusCode ReclusteredJetCalibrationAlg ::
23
initialize ()
24
{
25
ANA_CHECK
(
m_reclusteredJetHandle
.initialize(
m_systematicsList
));
26
ANA_CHECK
(
m_smallRJetHandle
.initialize(
m_systematicsList
));
27
28
ANA_CHECK
(
m_systematicsList
.initialize());
29
return
StatusCode::SUCCESS;
30
}
31
32
33
34
StatusCode ReclusteredJetCalibrationAlg ::
35
execute (
const
EventContext &ctx)
const
36
{
37
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
38
{
39
// container we read in
40
xAOD::JetContainer
*reclusteredJets =
nullptr
;
41
ATH_CHECK
(
m_reclusteredJetHandle
.getCopy(reclusteredJets, sys, ctx));
42
43
const
xAOD::JetContainer
*smallRJets =
nullptr
;
44
ATH_CHECK
(
m_smallRJetHandle
.retrieve(smallRJets, sys, ctx));
45
46
// loop over jets
47
// construct constant string before loops
48
const
std::string manualCalibScaleStr{
"JetManualCalibScaleMomentum"
};
49
for
(
xAOD::Jet
*
jet
: *reclusteredJets)
50
{
51
const
std::vector< ElementLink< xAOD::IParticleContainer > >& element_links =
jet
->constituentLinks();
52
53
xAOD::JetFourMom_t
calibP4;
54
calibP4.SetPxPyPzE(0,0,0,0);
55
for
(
const
auto
& element_link: element_links){
56
if
(! element_link.isValid() ) {
57
ATH_MSG_WARNING
(
"Subjet element link invalid !!!!"
);
58
continue
;
59
}
60
const
auto
subjet = *element_link;
61
int
index
= subjet->index();
62
const
xAOD::Jet
* subjetCal = smallRJets->
at
(
index
);
63
calibP4 += subjetCal->
jetP4
();
64
}
65
// Set calibrated P4
66
jet
->setAttribute<
xAOD::JetFourMom_t
>(manualCalibScaleStr,calibP4);
67
jet
->setJetP4( calibP4 );
68
}
69
}
70
71
return
StatusCode::SUCCESS;
72
}
73
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ReclusteredJetCalibrationAlg.h
CP::ReclusteredJetCalibrationAlg::m_reclusteredJetHandle
SysCopyHandle< xAOD::JetContainer > m_reclusteredJetHandle
the jet collection we run on
Definition
ReclusteredJetCalibrationAlg.h:35
CP::ReclusteredJetCalibrationAlg::m_smallRJetHandle
SysReadHandle< xAOD::JetContainer > m_smallRJetHandle
Definition
ReclusteredJetCalibrationAlg.h:37
CP::ReclusteredJetCalibrationAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
ReclusteredJetCalibrationAlg.h:31
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
xAOD::Jet_v1::jetP4
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
Definition
Jet_v1.cxx:76
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
index
Definition
index.py:1
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition
JetTypes.h:17
Generated on
for ATLAS Offline Software by
1.17.0