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
BaseTrackerRecHit::isMatched
bool isMatched() const
Definition: BaseTrackerRecHit.h:39
FastTrackerRecHit::set2D
void set2D(bool is2D=true)
Definition: FastTrackerRecHit.h:110
FastTrackerRecHitSplitter::FastTrackerRecHitSplitter
FastTrackerRecHitSplitter()
Definition: FastTrackerRecHitSplitter.h:14
GeomDet::type
virtual const GeomDetType & type() const
Definition: GeomDet.cc:69
FastProjectedTrackerRecHit.h
FastTrackerRecHit
Definition: FastTrackerRecHit.h:40
TrackingRecHit.h
TrajectorySeedHitCandidate.h
FastTrackerRecHitSplitter::split
void split(const FastTrackerRecHit &hitIn, edm::OwnVector< TrackingRecHit > &hitsOut, bool alongMomentum) const
Definition: FastTrackerRecHitSplitter.h:17
FastTrackerRecHitSplitter::buildSplitStripHit
FastSingleTrackerRecHit * buildSplitStripHit(const FastSingleTrackerRecHit &hit) const
Definition: FastTrackerRecHitSplitter.h:42
FastTrackerRecHit::dimension
int dimension() const override
get the dimensions right
Definition: FastTrackerRecHit.h:86
FastSingleTrackerRecHit.h
FastSingleTrackerRecHit
Definition: FastSingleTrackerRecHit.h:7
FastTrackerRecHitSplitter::~FastTrackerRecHitSplitter
~FastTrackerRecHitSplitter()
Definition: FastTrackerRecHitSplitter.h:15
GeomDetType::isEndcap
bool isEndcap() const
Definition: GeomDetType.cc:11
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
BaseTrackerRecHit::isProjected
bool isProjected() const
Definition: BaseTrackerRecHit.h:40
FastTrackerRecHit::isPixel
bool isPixel() const override
pixel or strip?
Definition: FastTrackerRecHit.h:104
FastMatchedTrackerRecHit.h
FastTrackerRecHit.h
TrackingRecHit::detUnit
virtual const GeomDetUnit * detUnit() const
Definition: TrackingRecHit.cc:29
FastTrackerRecHit::clone
FastTrackerRecHit * clone() const override
Definition: FastTrackerRecHit.h:66
alongMomentum
Definition: PropagationDirection.h:4
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
FastTrackerRecHitSplitter
Definition: FastTrackerRecHitSplitter.h:12