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