CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  public:
15 
18 
19  inline void split(const FastTrackerRecHit & hitIn,edm::OwnVector<TrackingRecHit> & hitsOut,bool reverseHits) const {
20 
21  if(hitIn.dimension()==1 || hitIn.isPixel())
22  hitsOut.push_back( hitIn.clone() );
23 
24  else if(hitIn.isProjected())
25  hitsOut.push_back(buildSplitStripHit(static_cast<const FastProjectedTrackerRecHit &>(hitIn).originalHit()));
26 
27  else if(hitIn.isMatched()){
28  const FastSingleTrackerRecHit & firstHit = (static_cast<const FastMatchedTrackerRecHit &>(hitIn)).firstHit();
29  const FastSingleTrackerRecHit & secondHit = (static_cast<const FastMatchedTrackerRecHit &>(hitIn)).secondHit();
30  hitsOut.push_back(buildSplitStripHit(reverseHits ? secondHit : firstHit));
31  hitsOut.push_back(buildSplitStripHit(reverseHits ? firstHit : secondHit));
32  }
33 
34  else{
35  hitsOut.push_back(buildSplitStripHit(static_cast<const FastSingleTrackerRecHit &>(hitIn)));
36  }
37  }
38 
39 
40  private:
41 
43  FastSingleTrackerRecHit * newHit = hit.clone();
44  newHit->set2D(newHit->detUnit()->type().isEndcap());
45  return newHit;
46  }
47 
48 };
49 
50 #endif
virtual FastTrackerRecHit * clone() const override
virtual FastSingleTrackerRecHit * clone() const override
void set2D(bool is2D=true)
virtual const GeomDetType & type() const
Definition: GeomDet.cc:90
bool isEndcap() const
Definition: GeomDetType.cc:18
void split(const FastTrackerRecHit &hitIn, edm::OwnVector< TrackingRecHit > &hitsOut, bool reverseHits) const
void push_back(D *&d)
Definition: OwnVector.h:290
FastSingleTrackerRecHit * buildSplitStripHit(const FastSingleTrackerRecHit &hit) const
int dimension() const override
get the dimensions right
bool isPixel() const override
pixel or strip?
bool isProjected() const
bool isMatched() const
virtual const GeomDetUnit * detUnit() const