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 {
14 
15 public:
16 
19 
20  inline void split(const FastTrackerRecHit & hitIn,edm::OwnVector<TrackingRecHit> & hitsOut,bool alongMomentum) const
21  {
22 
23  if(hitIn.dimension()==1 || hitIn.isPixel())
24  {
25  hitsOut.push_back( hitIn.clone() );
26  }
27 
28  else if(hitIn.isProjected())
29  {
30  hitsOut.push_back(buildSplitStripHit(static_cast<const FastProjectedTrackerRecHit &>(hitIn).originalHit()));
31  }
32 
33  else if(hitIn.isMatched())
34  {
35  if(alongMomentum)
36  {
37  hitsOut.push_back(buildSplitStripHit( (static_cast<const FastMatchedTrackerRecHit &>(hitIn)).firstHit()));
38  hitsOut.push_back(buildSplitStripHit( (static_cast<const FastMatchedTrackerRecHit &>(hitIn)).secondHit()));
39  }
40  else
41  {
42  hitsOut.push_back(buildSplitStripHit( (static_cast<const FastMatchedTrackerRecHit &>(hitIn)).secondHit()));
43  hitsOut.push_back(buildSplitStripHit( (static_cast<const FastMatchedTrackerRecHit &>(hitIn)).firstHit()));
44  }
45  }
46 
47  else
48  {
49  hitsOut.push_back(buildSplitStripHit(static_cast<const FastSingleTrackerRecHit &>(hitIn)));
50  }
51  }
52 
53 
54 private:
55 
57  {
58  FastSingleTrackerRecHit * newHit = hit.clone();
59  newHit->set2D(newHit->detUnit()->type().isEndcap());
60  return newHit;
61  }
62 
63 };
64 
65 #endif
void set2D(bool is2D=true)
virtual const GeomDetType & type() const
Definition: GeomDet.cc:85
bool isEndcap() const
Definition: GeomDetType.cc:18
void push_back(D *&d)
Definition: OwnVector.h:290
virtual FastSingleTrackerRecHit * clone() const override
FastSingleTrackerRecHit * buildSplitStripHit(const FastSingleTrackerRecHit &hit) const
int dimension() const override
get the dimensions right
void split(const FastTrackerRecHit &hitIn, edm::OwnVector< TrackingRecHit > &hitsOut, bool alongMomentum) const
bool isProjected() const
bool isPixel() const override
pixel or strip?
bool isMatched() const
virtual const GeomDetUnit * detUnit() const
virtual FastTrackerRecHit * clone() const override