diff --git a/SimDataFormats/CaloAnalysis/interface/CaloParticle.h b/SimDataFormats/CaloAnalysis/interface/CaloParticle.h index 2549634143279..4fd454c72f7e6 100644 --- a/SimDataFormats/CaloAnalysis/interface/CaloParticle.h +++ b/SimDataFormats/CaloAnalysis/interface/CaloParticle.h @@ -184,14 +184,17 @@ class CaloParticle { float simEnergy() const { return simhit_energy_; } /** @brief add simhit's energy to cluster */ - void addSimHit(const PCaloHit &hit) { simhit_energy_ += hit.energy(); } + void addSimHit(const PCaloHit &hit) { + simhit_energy_ += hit.energy(); + ++nsimhits_; + } private: - uint64_t nsimhits_; + uint64_t nsimhits_{0}; EncodedEventId event_; - uint32_t particleId_; - float simhit_energy_; + uint32_t particleId_{0}; + float simhit_energy_{0.f}; std::vector hits_; std::vector fractions_; diff --git a/SimDataFormats/CaloAnalysis/interface/SimCluster.h b/SimDataFormats/CaloAnalysis/interface/SimCluster.h index 30b75545cc0dd..f9042c4c702df 100644 --- a/SimDataFormats/CaloAnalysis/interface/SimCluster.h +++ b/SimDataFormats/CaloAnalysis/interface/SimCluster.h @@ -213,14 +213,17 @@ class SimCluster { float simEnergy() const { return simhit_energy_; } /** @brief add simhit's energy to cluster */ - void addSimHit(const PCaloHit &hit) { simhit_energy_ += hit.energy(); } + void addSimHit(const PCaloHit &hit) { + simhit_energy_ += hit.energy(); + ++nsimhits_; + } private: - uint64_t nsimhits_; + uint64_t nsimhits_{0}; EncodedEventId event_; - uint32_t particleId_; - float simhit_energy_; + uint32_t particleId_{0}; + float simhit_energy_{0.f}; std::vector hits_; std::vector fractions_; std::vector energies_;