CMS 3D CMS Logo

FastSingleTrackerRecHit.h
Go to the documentation of this file.
1 #ifndef FastSingleTrackerRecHit_H
2 #define FastSingleTrackerRecHit_H
3 
5 #include <cstdint>
6 
8 
9  public:
10 
13  , id_(-1)
14  , eventId_(0) {}
15 
16 
18  : FastTrackerRecHit(p,e,idet,hitType)
19  , id_(-1)
20  , eventId_(0) {}
21 
22  public:
23 
24  FastSingleTrackerRecHit * clone() const override {FastSingleTrackerRecHit * p = new FastSingleTrackerRecHit( * this); p->load(); return p;}
25 
26  size_t nIds() const override { return 1;}
27  int32_t id(size_t i =0) const override { return i == 0 ? id_ : -1;}
28  int32_t eventId(size_t i = 0) const override { return i == 0 ? eventId_ : -1;}
29  size_t nSimTrackIds() const override { return simTrackIds_.size();}
30  int32_t simTrackId(size_t i) const override { return i < simTrackIds_.size() ? simTrackIds_[i] : -1;}
31  int32_t simTrackEventId(size_t i) const override { return i < simTrackIds_.size() ? eventId_ : -1;}
32 
33 
36  void addSimTrackId(int32_t simTrackId) {simTrackIds_.push_back(simTrackId);}
37 
40  // the hit id number must be unique within the list of hits in the event
41  void setId(int32_t id) {id_ = id;}
42 
46  void setEventId(int32_t eventId) override {eventId_ = eventId;}
47 
48  private:
49 
50  int32_t id_;
51  int32_t eventId_;
52  std::vector<int32_t> simTrackIds_;
53 
54 };
55 
56 #endif
FastSingleTrackerRecHit(const LocalPoint &p, const LocalError &e, GeomDet const &idet, fastTrackerRecHitType::HitType hitType)
FastSingleTrackerRecHit * clone() const override
int32_t simTrackId(size_t i) const override
see addSimTrackId(int32_t simTrackId)
void load()
helps making the hit postion and error persistent
int32_t id(size_t i=0) const override
int32_t eventId(size_t i=0) const override
std::vector< int32_t > simTrackIds_
see addSimTrackIds(int32_t)
size_t nIds() const override
size_t nSimTrackIds() const override
see addSimTrackId(int32_t simTrackId)
int32_t eventId_
see setEeId(int32_t eeid)
void setEventId(int32_t eventId) override
int32_t id_
see setId(int32_t id)
void addSimTrackId(int32_t simTrackId)
int32_t simTrackEventId(size_t i) const override
see addSimTrackId(int32_t simTrackId)