Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:49

0001 #ifndef FastProjectedTrackerRecHit_H
0002 #define FastProjectedTrackerRecHit_H
0003 
0004 #include "DataFormats/TrackerRecHit2D/interface/FastTrackerRecHit.h"
0005 #include "DataFormats/TrackerRecHit2D/interface/FastSingleTrackerRecHit.h"
0006 #include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h"
0007 
0008 class FastProjectedTrackerRecHit : public FastTrackerRecHit {
0009 public:
0010   FastProjectedTrackerRecHit(){};
0011 
0012   ~FastProjectedTrackerRecHit() override{};
0013 
0014   FastProjectedTrackerRecHit(const LocalPoint& pos,
0015                              const LocalError& err,
0016                              GeomDet const& idet,
0017                              FastSingleTrackerRecHit const& originalHit)
0018       : FastTrackerRecHit(pos,
0019                           err,
0020                           idet,
0021                           ProjectedSiStripRecHit2D::isMono(idet, *originalHit.det())
0022                               ? fastTrackerRecHitType::siStripProjectedMono2D
0023                               : fastTrackerRecHitType::siStripProjectedStereo2D),
0024         originalHit_(originalHit) {}
0025 
0026   const FastSingleTrackerRecHit& originalHit() const { return originalHit_; }
0027   FastProjectedTrackerRecHit* clone() const override {
0028     FastProjectedTrackerRecHit* p = new FastProjectedTrackerRecHit(*this);
0029     p->load();
0030     return p;
0031   }
0032   size_t nIds() const override { return 1; }
0033   int32_t id(size_t i = 0) const override { return originalHit().id(i); }
0034   int32_t eventId(size_t i = 0) const override { return originalHit().eventId(i); }
0035   size_t nSimTrackIds() const override {
0036     return originalHit_.nSimTrackIds();
0037   }  ///< see addSimTrackId(int32_t simTrackId)
0038   int32_t simTrackId(size_t i) const override {
0039     return originalHit_.simTrackId(i);
0040   }  ///< see addSimTrackId(int32_t simTrackId)
0041   int32_t simTrackEventId(size_t i) const override {
0042     return originalHit_.simTrackEventId(i);
0043     ;
0044   }  ///< see addSimTrackId(int32_t simTrackId)
0045 
0046   void setEventId(int32_t eventId) override { originalHit_.setEventId(eventId); }
0047 
0048   void setRecHitCombinationIndex(int32_t recHitCombinationIndex) override {
0049     FastTrackerRecHit::setRecHitCombinationIndex(recHitCombinationIndex);
0050     originalHit_.setRecHitCombinationIndex(recHitCombinationIndex);
0051   }
0052 
0053 private:
0054   FastSingleTrackerRecHit originalHit_;
0055 };
0056 
0057 #endif