ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetRecTools
Root
ClusterAtMLScaleTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetRecTools/ClusterAtMLScaleTool.h
"
6
7
#include "
StoreGate/ReadDecorHandle.h
"
8
#include "GaudiKernel/ThreadLocalContext.h"
9
10
11
ClusterAtMLScaleTool::ClusterAtMLScaleTool
(
const
std::string& name) :
JetConstituentModifierBase
(name)
12
{
13
}
14
15
16
StatusCode
ClusterAtMLScaleTool::initialize
() {
17
18
if
(
m_inputType
!=
xAOD::Type::CaloCluster
) {
19
ATH_MSG_ERROR
(
"As the name suggests, ClusterAtMLScaleTool cannot operate on objects of type "
20
<<
m_inputType
);
21
return
StatusCode::FAILURE;
22
}
23
24
ATH_CHECK
(
m_clusterMLCorrectedEnergyKey
.initialize());
25
return
StatusCode::SUCCESS;
26
}
27
28
29
30
StatusCode
ClusterAtMLScaleTool::setClustersToMLScale
(
xAOD::CaloClusterContainer
& cont)
const
{
31
32
const
EventContext& ctx = Gaudi::Hive::currentContext();
33
34
SG::ReadDecorHandle<xAOD::CaloClusterContainer, double>
dec(
35
m_clusterMLCorrectedEnergyKey
, ctx);
36
37
if
(!dec.isValid()) {
38
ATH_MSG_ERROR
(
"Decoration handle is not valid: "
39
<<
m_clusterMLCorrectedEnergyKey
.key());
40
return
StatusCode::FAILURE;
41
}
42
43
for
(
xAOD::CaloCluster
* cl : cont) {
44
if
(!cl)
continue
;
45
46
cl->setCalE(dec(*cl));
47
cl->setCalM(cl->rawM());
48
cl->setCalPhi(cl->rawPhi());
49
cl->setCalEta(cl->rawEta());
50
}
51
52
return
StatusCode::SUCCESS;
53
}
54
55
56
StatusCode
ClusterAtMLScaleTool::process_impl
(
xAOD::IParticleContainer
* cont)
const
{
57
xAOD::CaloClusterContainer
* clust =
dynamic_cast<
xAOD::CaloClusterContainer
*
>
(cont);
// Get CaloCluster container
58
if
(clust)
59
return
setClustersToMLScale
(*clust);
60
61
return
StatusCode::FAILURE;
62
}
63
64
65
ClusterAtMLScaleTool::~ClusterAtMLScaleTool
()=
default
;
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
ClusterAtMLScaleTool.h
ReadDecorHandle.h
Handle class for reading a decoration on an object.
ClusterAtMLScaleTool::setClustersToMLScale
StatusCode setClustersToMLScale(xAOD::CaloClusterContainer &cont) const
Definition
ClusterAtMLScaleTool.cxx:30
ClusterAtMLScaleTool::m_clusterMLCorrectedEnergyKey
SG::ReadDecorHandleKey< xAOD::CaloClusterContainer > m_clusterMLCorrectedEnergyKey
Definition
ClusterAtMLScaleTool.h:40
ClusterAtMLScaleTool::~ClusterAtMLScaleTool
~ClusterAtMLScaleTool()
ClusterAtMLScaleTool::ClusterAtMLScaleTool
ClusterAtMLScaleTool(const std::string &name)
Definition
ClusterAtMLScaleTool.cxx:11
ClusterAtMLScaleTool::process_impl
virtual StatusCode process_impl(xAOD::IParticleContainer *cont) const override
Definition
ClusterAtMLScaleTool.cxx:56
ClusterAtMLScaleTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
ClusterAtMLScaleTool.cxx:16
JetConstituentModifierBase::JetConstituentModifierBase
JetConstituentModifierBase(const std::string &name)
Definition
JetConstituentModifierBase.cxx:14
JetConstituentModifierBase::m_inputType
unsigned int m_inputType
Definition
JetConstituentModifierBase.h:60
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition
StoreGate/StoreGate/ReadDecorHandle.h:94
xAODType::CaloCluster
@ CaloCluster
The object is a calorimeter cluster.
Definition
ObjectType.h:39
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition
xAOD/xAODBase/xAODBase/IParticleContainer.h:32
Generated on
for ATLAS Offline Software by
1.17.0