11 : base_class(
type, name, parent) {}
18 return StatusCode::SUCCESS;
25 if (!clusterMLReadHandle.isValid()) {
26 throw std::runtime_error(
"Invalid decoration handle: " +
42 throw std::runtime_error(
"Charged FlowElement found in neutral FlowElementContainer with index " + std::to_string(neutral_pfo.index()));
48 const double cluster_EM_energy = cls->rawE();
52 if (apply_ML_correction)
54 const double cluster_ML_energy = clusterMLReadHandle(*cls);
55 neutral_pfo.
setP4(cluster_ML_energy / cosh(neutral_pfo.
eta()), neutral_pfo.
eta(), neutral_pfo.
phi(), neutral_pfo.
m());
66 const std::vector<ElementLink<xAOD::IParticleContainer>> &otherObjectLinks = neutral_pfo.
otherObjectLinks();
67 if (otherObjectLinks.size() > 1)
68 throw std::runtime_error(
"NeutralPFOClusterMLCorrectionTool: Multiple links found for neutral FlowElement with index " + std::to_string(neutral_pfo.index()));
70 bool hasValidLink = !otherObjectLinks.empty() && otherObjectLinks[0].isValid();
75 throw std::runtime_error(
"NeutralPFOClusterMLCorrectionTool: Link for neutral FlowElement with index " + std::to_string(neutral_pfo.index()) +
" is not of type CaloCluster");
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading a decoration on an object.
Handle class for reading a decoration on an object.
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".