8 : base_class(
type, name, parent) {}
12 return StatusCode::SUCCESS;
22 ATH_MSG_WARNING(
"NeutralPFOClusterMLCorrectionTool: Charged FlowElement found in neutral FlowElementContainer with index " + std::to_string(pfo->index()));
38 const double clusterEMEnergy = cls.rawE();
39 if (!clusterMLCorrectedEnergyAccessor.
isAvailable(cls))
42 <<
"' found for cluster with index " << cls.index()
43 <<
". PFO energy will not be scaled.");
45 const double clusterDecorEnergy = clusterMLCorrectedEnergyAccessor.
isAvailable(cls) ? clusterMLCorrectedEnergyAccessor(cls) : clusterEMEnergy;
46 const double scaleFactor = clusterEMEnergy > FLT_MIN ? clusterDecorEnergy / clusterEMEnergy : 1.0;
48 ATH_MSG_DEBUG(
"NeutralPFOClusterMLCorrectionTool: Scaling PFO with index " << pfo.
index()
49 <<
" energy from " << pfo.
e() <<
" to " << (pfo.
e() * scaleFactor)
50 <<
" using cluster index " << cls.index()
51 <<
" EM energy " << clusterEMEnergy
52 <<
" Decor energy " << clusterDecorEnergy
53 <<
" scale factor " << scaleFactor);
55 pfo.
setP4(pfo.
pt() * scaleFactor, pfo.
eta(), pfo.
phi(), pfo.
m() * scaleFactor);
63 const std::vector<ElementLink<xAOD::IParticleContainer>> &otherObjectLinks = pfo.
otherObjectLinks();
64 if (otherObjectLinks.size() > 1)
65 ATH_MSG_ERROR(
"NeutralPFOClusterMLCorrectionTool: Multiple links found for neutral FlowElement with index " + std::to_string(pfo.
index()));
67 bool hasValidLink = !otherObjectLinks.empty() && otherObjectLinks[0].isValid();
71 ATH_MSG_ERROR(
"NeutralPFOClusterMLCorrectionTool: Link for neutral FlowElement with index " + std::to_string(pfo.
index()) +
" is not of type CaloCluster");
#define ATH_MSG_WARNING(x)
SG::Accessor< T, ALLOC > Accessor
size_t index() const
Return the index of this element within its container.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual double pt() const override
void setP4(float pt, float eta, float phi, float m)
virtual double m() const override
The invariant mass of the particle.
const std::vector< ElementLink< IParticleContainer > > & otherObjectLinks() const
virtual double phi() const override
The azimuthal angle ( ) of the particle.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
virtual double e() const override
The total energy of the particle.
@ CaloCluster
The object is a calorimeter cluster.
FlowElementContainer_v1 FlowElementContainer
Definition of the current "pfo container version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
FlowElement_v1 FlowElement
Definition of the current "pfo version".