File indexing completed on 2024-04-06 12:29:40
0001
0002
0003
0004 #ifndef SimDataFormats_CaloAnalysis_MtdSimLayerCluster_h
0005 #define SimDataFormats_CaloAnalysis_MtdSimLayerCluster_h
0006
0007 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0008 #include "SimDataFormats/CaloAnalysis/interface/MtdSimCluster.h"
0009 #include <vector>
0010
0011 class MtdSimLayerCluster : public MtdSimCluster {
0012 friend std::ostream &operator<<(std::ostream &s, MtdSimLayerCluster const &tp);
0013
0014 public:
0015 MtdSimLayerCluster();
0016 MtdSimLayerCluster(const SimTrack &simtrk);
0017 MtdSimLayerCluster(EncodedEventId eventID, uint32_t particleID);
0018
0019
0020 ~MtdSimLayerCluster();
0021
0022
0023 float computeClusterTime() {
0024 simLC_time_ = 0.;
0025 float tot_en = 0.;
0026 for (uint32_t i = 0; i < times_.size(); i++) {
0027 simLC_time_ += times_[i] * energies_[i];
0028 tot_en += energies_[i];
0029 }
0030 if (tot_en != 0.)
0031 simLC_time_ = simLC_time_ / tot_en;
0032 return simLC_time_;
0033 }
0034
0035
0036 void addCluEnergy(float energy) { simLC_energy_ = energy; }
0037
0038
0039 void addCluLocalPos(LocalPoint pos) { simLC_pos_ = pos; }
0040
0041
0042 void addCluIndex(const uint32_t index) { seedId_ = index; }
0043
0044
0045 float simLCTime() const { return simLC_time_; }
0046
0047
0048 LocalPoint simLCPos() const { return simLC_pos_; }
0049
0050
0051 float simLCEnergy() const { return simLC_energy_; }
0052
0053 uint32_t seedId() const { return seedId_; }
0054
0055 private:
0056
0057 uint32_t seedId_;
0058
0059 float simLC_time_{0.f};
0060 float simLC_energy_{0.f};
0061 LocalPoint simLC_pos_;
0062 };
0063
0064 #endif