diff --git a/Phys/ParticleMaker/src/NeutralMakers.cpp b/Phys/ParticleMaker/src/NeutralMakers.cpp index 43d39bdea1ac8a234b5f659d406c11d36374a3f5..036d35204d44aedc6a578001810b2632cd9225cb 100644 --- a/Phys/ParticleMaker/src/NeutralMakers.cpp +++ b/Phys/ParticleMaker/src/NeutralMakers.cpp @@ -246,6 +246,7 @@ namespace LHCb::Phys::ParticleMakers { mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_invalid_energy{this, "Negative energies are not allowed"}; mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_not_neutral{this, "Track(s) found. Particle must be neutral"}; mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_empty_hypotheses{this, "No hypotheses found"}; + mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_null_calohypo{this, "CaloHypos point to null"}; // ==================== // List of functions @@ -322,6 +323,10 @@ namespace LHCb::Phys::ParticleMakers { // ---- Check the hypothesis. Nothing wrong if it's not matched to a photon, just skip const auto& hypo = hypos.front(); + if ( !hypo ) { + ++m_null_calohypo; + return {}; + } if ( LHCb::CaloHypo::Hypothesis::Photon != hypo->hypothesis() ) { return {}; } // ---- skip negative energy @@ -460,6 +465,7 @@ namespace LHCb::Phys::ParticleMakers { mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_not_neutral{this, "Track(s) found. Particle must be neutral"}; mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_empty_hypotheses{this, "No hypotheses found"}; mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_null_caloposition{this, "CaloPosition point to null"}; + mutable Gaudi::Accumulators::MsgCounter<MSG::ERROR> m_null_calohypo{this, "CaloHypos point to null"}; // ==================== // List of functions @@ -537,6 +543,11 @@ namespace LHCb::Phys::ParticleMakers { // ---- Check the hypothesis. Nothing wrong if it's not matched to a photon, just skip const auto& hypo = hypos.front(); + if ( !hypo ) { + ++m_null_calohypo; + return {}; + } + if ( LHCb::CaloHypo::Hypothesis::Pi0Merged != hypo->hypothesis() ) { return {}; } // Add to total pi0s