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_WARNING("No ML energy decoration '" << m_clusterMLCorrectedEnergyKey.value()
35 << "' found for cluster with index " << cl->index()
36 << ". Cluster energy is set to EM energy.");
37 cl->setCalE( cl->rawE() );
38 }
39
40 cl->setCalM( cl->rawM() );
41 cl->setCalPhi( cl->rawPhi() );
42 cl->setCalEta( cl->rawEta() );
43 }
44
45 return StatusCode::SUCCESS;
46}
47
49 xAOD::CaloClusterContainer* clust = dynamic_cast<xAOD::CaloClusterContainer*> (cont); // Get CaloCluster container
50 if(clust)
51 return setClustersToMLScale(*clust);
52
53 return StatusCode::FAILURE;
54}
55
56
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(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:572
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.