8 : base_class(
type, name, parent) {}
14 return StatusCode::SUCCESS;
31 throw std::runtime_error(
"Charged FlowElement found in neutral FlowElementContainer with index " + std::to_string(neutral_pfo.index()));
37 const double cluster_EM_energy = cls->rawE();
41 if (apply_ML_correction)
44 neutral_pfo.
setP4(cluster_ML_energy / cosh(neutral_pfo.
eta()), neutral_pfo.
eta(), neutral_pfo.
phi(), neutral_pfo.
m());
55 const std::vector<ElementLink<xAOD::IParticleContainer>> &otherObjectLinks = neutral_pfo.
otherObjectLinks();
56 if (otherObjectLinks.size() > 1)
57 throw std::runtime_error(
"NeutralPFOClusterMLCorrectionTool: Multiple links found for neutral FlowElement with index " + std::to_string(neutral_pfo.index()));
59 bool hasValidLink = !otherObjectLinks.empty() && otherObjectLinks[0].isValid();
64 throw std::runtime_error(
"NeutralPFOClusterMLCorrectionTool: Link for neutral FlowElement with index " + std::to_string(neutral_pfo.index()) +
" is not of type CaloCluster");
72 if (!clusterMLCorrectedEnergyAccessor.
isAvailable(cls))
75 +
"' found for cluster with index " + std::to_string(cls.index())
76 +
". Returning EM energy.");
78 return clusterMLCorrectedEnergyAccessor(cls);
Helper class to provide type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
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".