CMS 3D CMS Logo

MtdSimLayerCluster.h
Go to the documentation of this file.
1 // Author: Aurora Perego, Fabio Cossutti - aurora.perego@cern.ch, fabio.cossutti@ts.infn.it
2 // Date: 05/2023
3 
4 #ifndef SimDataFormats_CaloAnalysis_MtdSimLayerCluster_h
5 #define SimDataFormats_CaloAnalysis_MtdSimLayerCluster_h
6 
9 #include <vector>
10 
12  friend std::ostream &operator<<(std::ostream &s, MtdSimLayerCluster const &tp);
13 
14 public:
16  MtdSimLayerCluster(const SimTrack &simtrk);
17  MtdSimLayerCluster(EncodedEventId eventID, uint32_t particleID); // for PU
18 
19  // destructor
21 
24  simLC_time_ = 0.;
25  float tot_en = 0.;
26  for (uint32_t i = 0; i < times_.size(); i++) {
28  tot_en += energies_[i];
29  }
30  if (tot_en != 0.)
31  simLC_time_ = simLC_time_ / tot_en;
32  return simLC_time_;
33  }
34 
37 
40 
42  void addCluIndex(const uint32_t index) { seedId_ = index; }
43 
45  float simLCTime() const { return simLC_time_; }
46 
48  LocalPoint simLCPos() const { return simLC_pos_; }
49 
51  float simLCEnergy() const { return simLC_energy_; }
52 
53  uint32_t seedId() const { return seedId_; }
54 
55 private:
56  // id of the simCluster it comes from
57  uint32_t seedId_;
58 
59  float simLC_time_{0.f};
60  float simLC_energy_{0.f};
62 };
63 
64 #endif
float simLCEnergy() const
returns the accumulated sim energy in the cluster
float computeClusterTime()
computes the time of the cluster
LocalPoint simLCPos() const
returns the local position of the cluster
void addCluIndex(const uint32_t index)
add the index of the simcluster
std::vector< float > times_
uint32_t seedId() const
void addCluEnergy(float energy)
computes the energy of the cluster
float simLCTime() const
returns the time of the cluster
friend std::ostream & operator<<(std::ostream &s, MtdSimLayerCluster const &tp)
void addCluLocalPos(LocalPoint pos)
computes the position of the cluster
float energy() const
Energy. Note this is taken from the first SimTrack only.
Definition: SimCluster.h:104
std::vector< float > energies_
Definition: SimCluster.h:229