CMS 3D CMS Logo

SimpleDAFHitCollector.h
Go to the documentation of this file.
1 #ifndef SiTrackerMRHTools_SimpleDAFHitCollector_h
2 #define SiTrackerMRHTools_SimpleDAFHitCollector_h
9 #include <vector>
10 #include <memory>
11 
12 class Propagator;
14 //class SiTrackerMultiRecHitUpdator;
15 class StripRecHit1D;
16 
18  public:
21  const MeasurementEstimator* est,
22  const Propagator* propagator, bool debug
23  ):MultiRecHitCollector(measurementTracker), theUpdator(updator), theEstimator(est), thePropagator(propagator), debug_(debug){
24  theHitCloner = static_cast<TkTransientTrackingRecHitBuilder const *>(theUpdator->getBuilder())->cloner();
25 }
26 
27 
29 
30  //given a trajectory it returns a collection
31  //of SiTrackerMultiRecHits and InvalidTransientRecHits.
32  //For each measurement in the trajectory, measurements are looked for according to the
33  //MeasurementDet::fastMeasurements method only in the detector where the original measurement lays.
34  //If measurements are found a SiTrackerMultiRecHit is built.
35  //All the components will lay on the same detector
36 
37  virtual std::vector<TrajectoryMeasurement> recHits(const Trajectory&, const MeasurementTrackerEvent *theMTE) const override;
38 
41  const Propagator* getPropagator() const {return thePropagator;}
42 
43  void Debug( const std::vector<TrajectoryMeasurement> TM ) const;
44 
45  private:
46  //TransientTrackingRecHit::ConstRecHitContainer buildMultiRecHits(const std::vector<TrajectoryMeasurementGroup>& measgroup) const;
47  //void buildMultiRecHits(const std::vector<TrajectoryMeasurement>& measgroup, std::vector<TrajectoryMeasurement>& result) const;
48 
49  std::unique_ptr<TrackingRecHit> rightdimension( TrackingRecHit const & hit ) const{
50  if( !hit.isValid() || ( hit.dimension()!=2) ) {
51  return std::unique_ptr<TrackingRecHit>{hit.clone()};
52  }
53  auto const & thit = static_cast<BaseTrackerRecHit const&>(hit);
54  auto const & clus = thit.firstClusterRef();
55  if (clus.isPixel()) return std::unique_ptr<TrackingRecHit>{hit.clone()};
56  else if (clus.isPhase2()) return std::unique_ptr<TrackingRecHit>{hit.clone()};
57  else if (thit.isMatched()) {
58  LogDebug("MultiRecHitCollector") << " SiStripMatchedRecHit2D to check!!!";
59  return std::unique_ptr<TrackingRecHit>{hit.clone()};
60  } else if (thit.isProjected()) {
61  edm::LogError("MultiRecHitCollector") << " ProjectedSiStripRecHit2D should not be present at this stage!!!";
62  return std::unique_ptr<TrackingRecHit>{hit.clone()};
63  } else return clone(thit);
64  }
65 
66  std::unique_ptr<TrackingRecHit> clone(BaseTrackerRecHit const & hit2D ) const {
67  auto const & detU = *hit2D.detUnit();
68  //Use 2D SiStripRecHit in endcap
69  bool endcap = detU.type().isEndcap();
70  if (endcap) return std::unique_ptr<TrackingRecHit>{hit2D.clone()};
71  return std::unique_ptr<TrackingRecHit>{
72  new SiStripRecHit1D(hit2D.localPosition(),
74  *hit2D.det(), hit2D.firstClusterRef()) };
75 
76  }
77 
78  private:
81  //this actually is not used in the fastMeasurement method
84  const bool debug_;
85 
86 
87 };
88 
89 
90 #endif
#define LogDebug(id)
SimpleDAFHitCollector(const MeasurementTracker *measurementTracker, const SiTrackerMultiRecHitUpdator *updator, const MeasurementEstimator *est, const Propagator *propagator, bool debug)
float xx() const
Definition: LocalError.h:24
void Debug(const std::vector< TrajectoryMeasurement > TM) const
const MeasurementEstimator * getEstimator() const
const SiTrackerMultiRecHitUpdator * getUpdator() const
std::unique_ptr< TrackingRecHit > rightdimension(TrackingRecHit const &hit) const
const MeasurementEstimator * theEstimator
const GeomDet * det() const
virtual int dimension() const =0
std::unique_ptr< TrackingRecHit > clone(BaseTrackerRecHit const &hit2D) const
virtual TrackingRecHit * clone() const =0
const Propagator * thePropagator
const Propagator * getPropagator() const
virtual LocalPoint localPosition() const final
#define debug
Definition: HDRShower.cc:19
bool isValid() const
virtual std::vector< TrajectoryMeasurement > recHits(const Trajectory &, const MeasurementTrackerEvent *theMTE) const override
virtual const GeomDetUnit * detUnit() const
virtual OmniClusterRef const & firstClusterRef() const =0
const TransientTrackingRecHitBuilder * getBuilder() const
virtual LocalError localPositionError() const final
const SiTrackerMultiRecHitUpdator * theUpdator