ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
8#include "GaudiKernel/ThreadLocalContext.h"
9
10
14
15
17
19 ATH_MSG_ERROR("As the name suggests, ClusterAtMLScaleTool cannot operate on objects of type "
20 << m_inputType);
21 return StatusCode::FAILURE;
22 }
23
25 return StatusCode::SUCCESS;
26}
27
28
29
31
32 const EventContext& ctx = Gaudi::Hive::currentContext();
33
36
37 if (!dec.isValid()) {
38 ATH_MSG_ERROR("Decoration handle is not valid: "
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
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
Handle class for reading a decoration on an object.
StatusCode setClustersToMLScale(xAOD::CaloClusterContainer &cont) const
SG::ReadDecorHandleKey< xAOD::CaloClusterContainer > m_clusterMLCorrectedEnergyKey
ClusterAtMLScaleTool(const std::string &name)
virtual StatusCode process_impl(xAOD::IParticleContainer *cont) const override
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
JetConstituentModifierBase(const std::string &name)
Handle class for reading a decoration on an object.
@ CaloCluster
The object is a calorimeter cluster.
Definition ObjectType.h:39
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.