CMS 3D CMS Logo

SimHitInfoForLinks.h
Go to the documentation of this file.
1 #ifndef SimTracker_Common_SimHitInfoForLinks
2 #define SimTracker_Common_SimHitInfoForLinks
3 
5 #include <vector>
6 
7 // A stripped down version of PSimHit used to save memory.
8 // Contains only the information needed to be make DigiSimLinks.
9 // Include the simHit's index in the source collection, collection name suffix
10 // index.
11 
13 public:
14  explicit SimHitInfoForLinks(PSimHit const *hitp, size_t hitindex, unsigned int tofbin, size_t hitInd4CR, float amp)
15  : eventId_(hitp->eventId()),
16  trackIds_(1, hitp->trackId()),
17  hitIndex_(hitindex),
18  tofBin_(tofbin),
19  hitInd4CR_(hitInd4CR),
20  ampl_(amp) {}
21 
22  const EncodedEventId &eventId() const { return eventId_; }
23  const std::vector<unsigned int> &trackIds() const { return trackIds_; }
24  std::vector<unsigned int> &trackIds() { return trackIds_; } // needed ATM in phase2 digitizer
25  const unsigned int trackId() const { return trackIds_[0]; }
26  const size_t hitIndex() const { return hitIndex_; }
27  const unsigned int tofBin() const { return tofBin_; }
28  const size_t hitIndex4ChargeRew() const { return hitInd4CR_; }
29  const float getAmpl() const { return ampl_; }
30 
31 private:
33  std::vector<unsigned int> trackIds_;
34  size_t hitIndex_;
35  unsigned int tofBin_;
36  size_t hitInd4CR_;
37  float ampl_;
38 };
39 #endif