CMS 3D CMS Logo

FastTrackerRecHit.h
Go to the documentation of this file.
1 
10 #ifndef FastTrackerRecHit_H
11 #define FastTrackerRecHit_H
12 
14 
16  enum HitType {
17  siPixel = 0,
18  siStrip1D = 1,
19  siStrip2D = 2,
23  };
24  inline trackerHitRTTI::RTTI rtti(HitType hitType) {
25  if (hitType >= siPixel && hitType <= siStrip2D)
27  else if (hitType == siStripMatched2D)
29  else if (hitType == siStripProjectedMono2D)
31  else if (hitType == siStripProjectedStereo2D)
33  else
34  return trackerHitRTTI::undef;
35  }
36  inline bool is2D(HitType hitType) { return hitType != siStrip1D; }
37  inline bool isPixel(HitType hitType) { return hitType == siPixel; }
38 } // namespace fastTrackerRecHitType
39 
41 public:
45 
48  ~FastTrackerRecHit() override {}
49 
54  const LocalError& e,
55  GeomDet const& idet,
57  : BaseTrackerRecHit(p, e, idet, fastTrackerRecHitType::rtti(hitType)),
59  is2D_(fastTrackerRecHitType::is2D(hitType)),
61  energyLoss_(0.0) //holy golden seal
62  {
63  store();
64  }
65 
66  FastTrackerRecHit* clone() const override {
68  p->load();
69  return p;
70  }
71 
74 
75  float energyLoss() const { return energyLoss_; } // holy golden seal
76  void setEnergyLoss(float e) { energyLoss_ = e; } // holy golden seal was a virtual void...
77  void getKfComponents(KfComponentsHolder& holder) const override {
78  if (is2D_)
79  getKfComponents2D(holder);
80  else
81  getKfComponents1D(holder);
82  }
83 
86  int dimension() const override { return is2D_ ? 2 : 1; }
87 
90  bool canImproveWithTrack() const override { return false; }
91 
92  /* getters */
93 
94  virtual size_t nIds() const { return 0; }
95  virtual int32_t id(size_t i = 0) const { return -1; }
96  virtual int32_t eventId(size_t i = 0) const { return -1; }
97 
98  virtual size_t nSimTrackIds() const { return 0; }
99  virtual int32_t simTrackId(size_t i) const { return -1; }
100  virtual int32_t simTrackEventId(size_t i) const { return -1; }
101 
102  virtual int32_t recHitCombinationIndex() const { return recHitCombinationIndex_; }
103 
104  bool isPixel() const override { return isPixel_; }
105 
106  /* setters */
107 
108  virtual void setEventId(int32_t eventId){};
109 
110  void set2D(bool is2D = true) { is2D_ = is2D; }
111 
114  }
115 
118  std::vector<const TrackingRecHit*> recHits() const override { return std::vector<TrackingRecHit const*>(); }
119 
122  std::vector<TrackingRecHit*> recHits() override { return std::vector<TrackingRecHit*>(); }
123 
126  OmniClusterRef const& firstClusterRef() const override;
127 
132  // used by functions
133  // - FastTrackerSingleRecHit::sharesInput
134  // - FastSiStripMatchedRecHit::sharesInput
135  // - FastProjectedSiStripRecHit2D::sharesInput
136  inline bool sameId(const FastTrackerRecHit* other, size_t i = 0, size_t j = 0) const {
137  return id(i) == other->id(j) && eventId(i) == other->eventId(j);
138  }
139  inline bool sharesInput(const TrackingRecHit* other, SharedInputType what) const override {
140  // cast other hit
142  return false;
143  const FastTrackerRecHit* otherCast = static_cast<const FastTrackerRecHit*>(other);
144 
145  // checks
146  if (this->nIds() == 1) { // this hit is single/projected
147  if (otherCast->nIds() == 1) { // other hit is single/projected
148  return this->sameId(otherCast, 0, 0);
149  } else { // other hit is matched
150  if (what == all) {
151  return false;
152  } else {
153  return (this->sameId(otherCast, 0, 0) || this->sameId(otherCast, 0, 1));
154  }
155  }
156  } else { // this hit is matched
157  if (otherCast->nIds() == 1) { // other hit is single/projected
158  if (what == all) {
159  return false;
160  } else {
161  return (this->sameId(otherCast, 0, 0) || this->sameId(otherCast, 1, 0));
162  }
163  } else { // other hit is matched
164  if (what == all) {
165  return (this->sameId(otherCast, 0, 0) && this->sameId(otherCast, 1, 1));
166  } else {
167  return (this->sameId(otherCast, 0, 0) || this->sameId(otherCast, 1, 1));
168  }
169  }
170  }
171  }
172 
173 protected:
174  const bool isPixel_;
175  bool is2D_;
176 
179 
180  void store() {
181  myPos_ = pos_;
182  myErr_ = err_;
183  }
184  void load() {
185  pos_ = myPos_;
186  err_ = myErr_;
187  }
188 
190  float energyLoss_; //holy golden seal
191 
192 protected:
193  FastTrackerRecHit* clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
194  return this->clone();
195  }
196 };
197 
201  return (one.geographicalId() < other.geographicalId());
202 }
203 
204 #endif
FastTrackerRecHit::~FastTrackerRecHit
~FastTrackerRecHit() override
Definition: FastTrackerRecHit.h:48
FastTrackerRecHit::setRecHitCombinationIndex
virtual void setRecHitCombinationIndex(int32_t recHitCombinationIndex)
Definition: FastTrackerRecHit.h:112
FastTrackerRecHit::set2D
void set2D(bool is2D=true)
Definition: FastTrackerRecHit.h:110
FastTrackerRecHit::recHits
std::vector< TrackingRecHit * > recHits() override
Definition: FastTrackerRecHit.h:122
mps_fire.i
i
Definition: mps_fire.py:428
trackerHitRTTI::undef
Definition: trackerHitRTTI.h:9
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
funct::false
false
Definition: Factorize.h:29
GeomDet
Definition: GeomDet.h:27
fastTrackerRecHitType::siPixel
Definition: FastTrackerRecHit.h:17
BaseTrackerRecHit::err_
LocalError err_
Definition: BaseTrackerRecHit.h:127
FastTrackerRecHit::is2D_
bool is2D_
hit is either one dimensional (is2D_ = false) or two dimensions (is2D_ = true)
Definition: FastTrackerRecHit.h:175
trackerHitRTTI::fastSingle
Definition: trackerHitRTTI.h:15
fastTrackerRecHitType::HitType
HitType
Definition: FastTrackerRecHit.h:16
FastTrackerRecHit::sameId
bool sameId(const FastTrackerRecHit *other, size_t i=0, size_t j=0) const
Definition: FastTrackerRecHit.h:136
fastTrackerRecHitType::siStripMatched2D
Definition: FastTrackerRecHit.h:20
FastTrackerRecHit
Definition: FastTrackerRecHit.h:40
fastTrackerRecHitType
Definition: FastTrackerRecHit.h:15
OmniClusterRef
Definition: OmniClusterRef.h:12
FastTrackerRecHit::id
virtual int32_t id(size_t i=0) const
Definition: FastTrackerRecHit.h:95
FastTrackerRecHit::setEventId
virtual void setEventId(int32_t eventId)
Definition: FastTrackerRecHit.h:108
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TrackingRecHit::SharedInputType
SharedInputType
definition of equality via shared input
Definition: TrackingRecHit.h:59
TkCloner
Definition: TkCloner.h:16
FastTrackerRecHit::store
void store()
helps making the hit postion and error persistent
Definition: FastTrackerRecHit.h:180
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
BaseTrackerRecHit::pos_
LocalPoint pos_
Definition: BaseTrackerRecHit.h:126
FastTrackerRecHit::recHitCombinationIndex_
uint32_t recHitCombinationIndex_
Definition: FastTrackerRecHit.h:189
FastTrackerRecHit::myErr_
LocalError myErr_
helps making the hit postion and error persistent
Definition: FastTrackerRecHit.h:178
FastTrackerRecHit::simTrackId
virtual int32_t simTrackId(size_t i) const
Definition: FastTrackerRecHit.h:99
trackerHitRTTI::RTTI
RTTI
Definition: trackerHitRTTI.h:8
trackingPlots.other
other
Definition: trackingPlots.py:1464
FastTrackerRecHit::load
void load()
helps making the hit postion and error persistent
Definition: FastTrackerRecHit.h:184
Point3DBase< float, LocalTag >
FastTrackerRecHit::nSimTrackIds
virtual size_t nSimTrackIds() const
Definition: FastTrackerRecHit.h:98
FastTrackerRecHit::recHits
std::vector< const TrackingRecHit * > recHits() const override
Definition: FastTrackerRecHit.h:118
trackerHitRTTI::fastProjMono
Definition: trackerHitRTTI.h:17
funct::true
true
Definition: Factorize.h:173
FastTrackerRecHit::nIds
virtual size_t nIds() const
Definition: FastTrackerRecHit.h:94
FastTrackerRecHit::dimension
int dimension() const override
get the dimensions right
Definition: FastTrackerRecHit.h:86
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrackingRecHit::all
Definition: TrackingRecHit.h:59
BaseTrackerRecHit::rtti
trackerHitRTTI::RTTI rtti() const
Definition: BaseTrackerRecHit.h:37
FastTrackerRecHit::simTrackEventId
virtual int32_t simTrackEventId(size_t i) const
Definition: FastTrackerRecHit.h:100
fastTrackerRecHitType::isPixel
bool isPixel(HitType hitType)
Definition: FastTrackerRecHit.h:37
LocalError
Definition: LocalError.h:12
FastTrackerRecHit::recHitCombinationIndex
virtual int32_t recHitCombinationIndex() const
Definition: FastTrackerRecHit.h:102
fastTrackerRecHitType::siStripProjectedMono2D
Definition: FastTrackerRecHit.h:21
FastTrackerRecHit::firstClusterRef
OmniClusterRef const & firstClusterRef() const override
Definition: FastTrackerRecHit.cc:8
FastTrackerRecHit::FastTrackerRecHit
FastTrackerRecHit()
Definition: FastTrackerRecHit.h:44
operator<
bool operator<(const FastTrackerRecHit &one, const FastTrackerRecHit &other)
Definition: FastTrackerRecHit.h:200
KfComponentsHolder
Definition: KfComponentsHolder.h:13
FastTrackerRecHit::canImproveWithTrack
bool canImproveWithTrack() const override
Definition: FastTrackerRecHit.h:90
fastTrackerRecHitType::siStrip2D
Definition: FastTrackerRecHit.h:19
TrackingRecHit
Definition: TrackingRecHit.h:21
BaseTrackerRecHit.h
FastTrackerRecHit::energyLoss_
float energyLoss_
Definition: FastTrackerRecHit.h:190
FastTrackerRecHit::eventId
virtual int32_t eventId(size_t i=0) const
Definition: FastTrackerRecHit.h:96
FastTrackerRecHit::energyLoss
float energyLoss() const
Definition: FastTrackerRecHit.h:75
FastTrackerRecHit::getKfComponents
void getKfComponents(KfComponentsHolder &holder) const override
Definition: FastTrackerRecHit.h:77
fastTrackerRecHitType::rtti
trackerHitRTTI::RTTI rtti(HitType hitType)
Definition: FastTrackerRecHit.h:24
fastTrackerRecHitType::siStrip1D
Definition: FastTrackerRecHit.h:18
fastTrackerRecHitType::is2D
bool is2D(HitType hitType)
Definition: FastTrackerRecHit.h:36
FastTrackerRecHit::clone_
FastTrackerRecHit * clone_(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const override
Definition: FastTrackerRecHit.h:193
trackerHitRTTI::fastProjStereo
Definition: trackerHitRTTI.h:16
FastTrackerRecHit::isPixel
bool isPixel() const override
pixel or strip?
Definition: FastTrackerRecHit.h:104
trackerHitRTTI::fastMatch
Definition: trackerHitRTTI.h:18
BaseTrackerRecHit::getKfComponents2D
void getKfComponents2D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:53
FastTrackerRecHit::setEnergyLoss
void setEnergyLoss(float e)
Definition: FastTrackerRecHit.h:76
FastTrackerRecHit::sharesInput
bool sharesInput(const TrackingRecHit *other, SharedInputType what) const override
Definition: FastTrackerRecHit.h:139
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
FastTrackerRecHit::myPos_
LocalPoint myPos_
helps making the hit postion and error persistent
Definition: FastTrackerRecHit.h:177
FastTrackerRecHit::clone
FastTrackerRecHit * clone() const override
Definition: FastTrackerRecHit.h:66
FastTrackerRecHit::FastTrackerRecHit
FastTrackerRecHit(const LocalPoint &p, const LocalError &e, GeomDet const &idet, fastTrackerRecHitType::HitType hitType)
Definition: FastTrackerRecHit.h:53
BaseTrackerRecHit::getKfComponents1D
void getKfComponents1D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:35
fastTrackerRecHitType::siStripProjectedStereo2D
Definition: FastTrackerRecHit.h:22
FastTrackerRecHit::isPixel_
const bool isPixel_
hit is either on pixel modul (isPixel_ = true) or strip module (isPixel_ = false)
Definition: FastTrackerRecHit.h:174
trackerHitRTTI::isFast
bool isFast(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:37
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37