CMS 3D CMS Logo

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