Skip to content

Commit

Permalink
Merge pull request #36346 from civanch/initialisation_calo_particles
Browse files Browse the repository at this point in the history
Initialisation of CaloParticle data members
  • Loading branch information
cmsbuild authored Dec 4, 2021
2 parents 239f053 + 4f47e47 commit ad121a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions SimDataFormats/CaloAnalysis/interface/CaloParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t> hits_;
std::vector<float> fractions_;

Expand Down
11 changes: 7 additions & 4 deletions SimDataFormats/CaloAnalysis/interface/SimCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t> hits_;
std::vector<float> fractions_;
std::vector<float> energies_;
Expand Down

0 comments on commit ad121a5

Please sign in to comment.