Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-04 01:26:21

0001 #ifndef SimTracker_Common_SimHitInfoForLinks
0002 #define SimTracker_Common_SimHitInfoForLinks
0003 
0004 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0005 #include <vector>
0006 
0007 // A stripped down version of PSimHit used to save memory.
0008 // Contains only the information needed to be make DigiSimLinks.
0009 // Include the simHit's index in the source collection, collection name suffix
0010 // index.
0011 
0012 class SimHitInfoForLinks {
0013 public:
0014   explicit SimHitInfoForLinks(PSimHit const *hitp, size_t hitindex, unsigned int tofbin, size_t hitInd4CR, float amp)
0015       : eventId_(hitp->eventId()),
0016         trackIds_(1, hitp->trackId()),
0017         hitIndex_(hitindex),
0018         tofBin_(tofbin),
0019         hitInd4CR_(hitInd4CR),
0020         ampl_(amp) {}
0021 
0022   const EncodedEventId &eventId() const { return eventId_; }
0023   const std::vector<unsigned int> &trackIds() const { return trackIds_; }
0024   std::vector<unsigned int> &trackIds() { return trackIds_; }  // needed ATM in phase2 digitizer
0025   const unsigned int trackId() const { return trackIds_[0]; }
0026   const size_t hitIndex() const { return hitIndex_; }
0027   const unsigned int tofBin() const { return tofBin_; }
0028   const size_t hitIndex4ChargeRew() const { return hitInd4CR_; }
0029   const float getAmpl() const { return ampl_; }
0030 
0031 private:
0032   EncodedEventId eventId_;
0033   std::vector<unsigned int> trackIds_;
0034   size_t hitIndex_;
0035   unsigned int tofBin_;
0036   size_t hitInd4CR_;
0037   float ampl_;
0038 };
0039 #endif