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
10
13 ATH_MSG_ERROR("As the name suggests, ClusterAtMLScaleTool cannot operate on objects of type "
14 << m_inputType);
15 return StatusCode::FAILURE;
16 }
17 return StatusCode::SUCCESS;
18}
19
21
22 const SG::AuxElement::Accessor<double> clusterMLCorrectedEnergyAccessor(m_clusterMLCorrectedEnergyKey.value());
23
24 for(xAOD::CaloCluster* cl : cont ) {
25 if (!cl)
26 continue;
27
28 if (clusterMLCorrectedEnergyAccessor.isAvailable(*cl))
29 {
30 cl->setCalE( clusterMLCorrectedEnergyAccessor(*cl) );
31 }
32 else
33 {
34 ATH_MSG_ERROR("No ML energy decoration '" << m_clusterMLCorrectedEnergyKey.value() << "' found for cluster with index " << cl->index() << ".");
35 return StatusCode::FAILURE;
36 }
37
38 cl->setCalM( cl->rawM() );
39 cl->setCalPhi( cl->rawPhi() );
40 cl->setCalEta( cl->rawEta() );
41 }
42
43 return StatusCode::SUCCESS;
44}
45
47 xAOD::CaloClusterContainer* clust = dynamic_cast<xAOD::CaloClusterContainer*> (cont); // Get CaloCluster container
48 if(clust)
49 return setClustersToMLScale(*clust);
50
51 return StatusCode::FAILURE;
52}
53
54
#define ATH_MSG_ERROR(x)
Gaudi::Property< std::string > m_clusterMLCorrectedEnergyKey
StatusCode setClustersToMLScale(xAOD::CaloClusterContainer &cont) const
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)
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
@ 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.