ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMomentTools
Root
JetNumConstitsTool.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/JetNumConstitTool.h
"
6
#include "
AsgDataHandles/WriteDecorHandle.h
"
7
8
//**********************************************************************
9
10
JetNumConstitTool::JetNumConstitTool
(
const
std::string& myname)
11
:
asg
::
AsgTool
(myname)
12
{}
13
14
//**********************************************************************
15
16
StatusCode
JetNumConstitTool::initialize
(){
17
18
if
(
m_jetContainerName
.empty()){
19
ATH_MSG_ERROR
(
"JetNumConstitTool needs to have its input jet container name configured!"
);
20
return
StatusCode::FAILURE;
21
}
22
23
// Prepend jet container name
24
m_numConstitKey
=
m_jetContainerName
+
"."
+
m_numConstitKey
.key();
25
ATH_CHECK
(
m_numConstitKey
.initialize());
26
27
return
StatusCode::SUCCESS;
28
}
29
30
//**********************************************************************
31
32
StatusCode
JetNumConstitTool::decorate
(
const
xAOD::JetContainer
& jets)
const
{
33
34
SG::WriteDecorHandle<xAOD::JetContainer, int>
numConstitHandle(
m_numConstitKey
);
35
36
for
(
const
xAOD::Jet
*
jet
: jets){
37
numConstitHandle(*
jet
) =
jet
->numConstituents();
38
}
39
40
return
StatusCode::SUCCESS;
41
}
42
43
//**********************************************************************
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
WriteDecorHandle.h
Handle class for adding a decoration to an object.
JetNumConstitTool.h
JetNumConstitTool::JetNumConstitTool
JetNumConstitTool(const std::string &myname)
Definition
JetNumConstitsTool.cxx:10
JetNumConstitTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
JetNumConstitsTool.cxx:16
JetNumConstitTool::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Definition
JetNumConstitsTool.cxx:32
JetNumConstitTool::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition
JetNumConstitTool.h:34
JetNumConstitTool::m_numConstitKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_numConstitKey
Definition
JetNumConstitTool.h:36
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
asg
Definition
DataHandleTestTool.h:28
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
Generated on
for ATLAS Offline Software by
1.17.0