CMS 3D CMS Logo

FastTrackerRecHitSplitter.h
Go to the documentation of this file.
1 #ifndef FASTSIMULATION_TRACKING_FASTTRACKERRECHITSPLITTER_H
2 #define FASTSIMULATION_TRACKING_FASTTRACKERRECHITSPLITTER_H
3 
4 #include <vector>
11 
13 public:
16 
17  inline void split(const FastTrackerRecHit &hitIn, edm::OwnVector<TrackingRecHit> &hitsOut, bool alongMomentum) const {
18  if (hitIn.dimension() == 1 || hitIn.isPixel()) {
19  hitsOut.push_back(hitIn.clone());
20  }
21 
22  else if (hitIn.isProjected()) {
23  hitsOut.push_back(buildSplitStripHit(static_cast<const FastProjectedTrackerRecHit &>(hitIn).originalHit()));
24  }
25 
26  else if (hitIn.isMatched()) {
27  if (alongMomentum) {
28  hitsOut.push_back(buildSplitStripHit((static_cast<const FastMatchedTrackerRecHit &>(hitIn)).firstHit()));
29  hitsOut.push_back(buildSplitStripHit((static_cast<const FastMatchedTrackerRecHit &>(hitIn)).secondHit()));
30  } else {
31  hitsOut.push_back(buildSplitStripHit((static_cast<const FastMatchedTrackerRecHit &>(hitIn)).secondHit()));
32  hitsOut.push_back(buildSplitStripHit((static_cast<const FastMatchedTrackerRecHit &>(hitIn)).firstHit()));
33  }
34  }
35 
36  else {
37  hitsOut.push_back(buildSplitStripHit(static_cast<const FastSingleTrackerRecHit &>(hitIn)));
38  }
39  }
40 
41 private:
43  FastSingleTrackerRecHit *newHit = hit.clone();
44  newHit->set2D(newHit->detUnit()->type().isEndcap());
45  return newHit;
46  }
47 };
48 
49 #endif
FastSingleTrackerRecHit * buildSplitStripHit(const FastSingleTrackerRecHit &hit) const
void set2D(bool is2D=true)
virtual const GeomDetType & type() const
Definition: GeomDet.cc:69
void push_back(D *&d)
Definition: OwnVector.h:326
virtual const GeomDetUnit * detUnit() const
int dimension() const override
get the dimensions right
bool isPixel() const override
pixel or strip?
bool isEndcap() const
Definition: GeomDetType.cc:11
bool isProjected() const
bool isMatched() const
FastTrackerRecHit * clone() const override
void split(const FastTrackerRecHit &hitIn, edm::OwnVector< TrackingRecHit > &hitsOut, bool alongMomentum) const