ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMomentTools
Root
JetGroomMRatio.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetMomentTools/JetGroomMRatio.h
"
6
7
#include "
xAODJet/JetAccessorMap.h
"
8
#include "
AsgDataHandles/WriteDecorHandle.h
"
9
10
//**********************************************************************
11
12
JetGroomMRatio::JetGroomMRatio
(
const
std::string& name)
13
:
AsgTool
(name) { }
14
15
//**********************************************************************
16
17
StatusCode
JetGroomMRatio::initialize
() {
18
ATH_MSG_INFO
(
"Initializing JetGroomMRatio "
<< name());
19
20
if
(
m_jetContainerName
.empty()){
21
ATH_MSG_ERROR
(
"JetGroomMRatio needs to have its input jet container configured!"
);
22
return
StatusCode::FAILURE;
23
}
24
25
m_groomMRatioKey
=
m_jetContainerName
+
"."
+
m_groomMRatioKey
.key();
26
27
ATH_CHECK
(
m_groomMRatioKey
.initialize());
28
29
return
StatusCode::SUCCESS;
30
}
31
32
//**********************************************************************
33
34
StatusCode
JetGroomMRatio::decorate
(
const
xAOD::JetContainer
& jets)
const
{
35
ATH_MSG_VERBOSE
(
"Begin decorating jets."
);
36
const
SG::AuxElement::ConstAccessor< ElementLink<xAOD::JetContainer> > parentAcc(
"Parent"
);
37
const
std::string uncalP4Str{
"JetConstitScaleMomentum"
};
38
for
(
const
xAOD::Jet
*
jet
: jets) {
39
const
xAOD::Jet
* parent = *parentAcc(*
jet
);
40
41
if
(parent==
nullptr
) {
42
ATH_MSG_ERROR
(
"No ungroomed parent jet available"
);
43
return
StatusCode::FAILURE;
44
}
45
46
SG::WriteDecorHandle<xAOD::JetContainer, float>
groomMRatioHandle(
m_groomMRatioKey
);
47
48
// Get jet p4 at constituent scale to compute ratio
49
xAOD::JetFourMom_t
uncalP4;
50
jet
->getAttribute<
xAOD::JetFourMom_t
>(uncalP4Str,uncalP4);
51
52
groomMRatioHandle(*
jet
) = uncalP4.M()/parent->m();
53
54
}
55
56
return
StatusCode::SUCCESS;
57
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
WriteDecorHandle.h
Handle class for adding a decoration to an object.
JetAccessorMap.h
JetGroomMRatio.h
JetGroomMRatio::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition
JetGroomMRatio.h:31
JetGroomMRatio::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
JetGroomMRatio.cxx:17
JetGroomMRatio::m_groomMRatioKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_groomMRatioKey
Definition
JetGroomMRatio.h:33
JetGroomMRatio::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Definition
JetGroomMRatio.cxx:34
JetGroomMRatio::JetGroomMRatio
JetGroomMRatio(const std::string &t)
Definition
JetGroomMRatio.cxx:12
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
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