Skip to content

Commit

Permalink
Initialisation of data members
Browse files Browse the repository at this point in the history
  • Loading branch information
civanch committed Dec 3, 2021
1 parent a9a7b7e commit a20f595
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions SimDataFormats/CaloAnalysis/interface/CaloParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class CaloParticle {
void addRecHitAndFraction(uint32_t hit, float fraction) {
hits_.emplace_back(hit);
fractions_.emplace_back(fraction);
++nsimhits_;
}

/** @brief Returns list of rechit IDs and fractions for this CaloParticle */
Expand All @@ -187,11 +188,11 @@ class CaloParticle {
void addSimHit(const PCaloHit &hit) { simhit_energy_ += hit.energy(); }

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
7 changes: 4 additions & 3 deletions SimDataFormats/CaloAnalysis/interface/SimCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class SimCluster {
void addRecHitAndFraction(uint32_t hit, float fraction) {
hits_.emplace_back(hit);
fractions_.emplace_back(fraction);
++nsimhits_;
}

/** @brief add rechit energy */
Expand Down Expand Up @@ -216,11 +217,11 @@ class SimCluster {
void addSimHit(const PCaloHit &hit) { simhit_energy_ += hit.energy(); }

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 a20f595

Please sign in to comment.