CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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:
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 (thit.isMatched()) {
57  LogDebug("MultiRecHitCollector") << " SiStripMatchedRecHit2D to check!!!";
58  return std::unique_ptr<TrackingRecHit>{hit.clone()};
59  } else if (thit.isProjected()) {
60  edm::LogError("MultiRecHitCollector") << " ProjectedSiStripRecHit2D should not be present at this stage!!!";
61  return std::unique_ptr<TrackingRecHit>{hit.clone()};
62  } else return clone(thit);
63  }
64 
65  std::unique_ptr<TrackingRecHit> clone(BaseTrackerRecHit const & hit2D ) const {
66  auto const & detU = *hit2D.detUnit();
67  //Use 2D SiStripRecHit in endcap
68  bool endcap = detU.type().isEndcap();
69  if (endcap) return std::unique_ptr<TrackingRecHit>{hit2D.clone()};
70  return std::unique_ptr<TrackingRecHit>{
71  new SiStripRecHit1D(hit2D.localPosition(),
73  *hit2D.det(), hit2D.firstClusterRef()) };
74 
75  }
76 
77  private:
80  //this actually is not used in the fastMeasurement method
83  const bool debug_;
84 
85 
86 };
87 
88 
89 #endif
#define LogDebug(id)
virtual int dimension() const =0
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
virtual LocalError localPositionError() const
virtual 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
virtual TrackingRecHit * clone() const =0
#define debug
Definition: HDRShower.cc:19
virtual OmniClusterRef const & firstClusterRef() const =0
bool isValid() const
string const
Definition: compareJSON.py:14
virtual const GeomDetUnit * detUnit() const
const TransientTrackingRecHitBuilder * getBuilder() const
virtual LocalPoint localPosition() const
const SiTrackerMultiRecHitUpdator * theUpdator