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,
22  const MeasurementEstimator* est,
23  const Propagator* propagator,
24  bool debug)
26  theTopology(trackerTopology),
28  theEstimator(est),
30  debug_(debug) {
31  theHitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(theUpdator->getBuilder())->cloner();
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
MeasurementEstimator
Definition: MeasurementEstimator.h:19
SimpleDAFHitCollector::theTopology
const TrackerTopology * theTopology
Definition: SimpleDAFHitCollector.h:89
SimpleDAFHitCollector::Debug
void Debug(const std::vector< TrajectoryMeasurement > TM) const
Definition: SimpleDAFHitCollector.cc:156
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
TrackerTopology
Definition: TrackerTopology.h:16
TrackingRecHit::det
const GeomDet * det() const
Definition: TrackingRecHit.h:122
SimpleDAFHitCollector::theEstimator
const MeasurementEstimator * theEstimator
Definition: SimpleDAFHitCollector.h:91
GeomDetType.h
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
TkTransientTrackingRecHitBuilder.h
SiTrackerMultiRecHitUpdator
Definition: SiTrackerMultiRecHitUpdator.h:27
Propagator
Definition: Propagator.h:44
MeasurementTracker
Definition: MeasurementTracker.h:21
SiTrackerMultiRecHitUpdator::getBuilder
const TransientTrackingRecHitBuilder * getBuilder() const
Definition: SiTrackerMultiRecHitUpdator.h:71
debug
#define debug
Definition: HDRShower.cc:19
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
MultiRecHitCollector
Definition: MultiRecHitCollector.h:10
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
LocalError::xx
float xx() const
Definition: LocalError.h:22
SimpleDAFHitCollector::getPropagator
const Propagator * getPropagator() const
Definition: SimpleDAFHitCollector.h:47
BaseTrackerRecHit::localPositionError
LocalError localPositionError() const override
Definition: BaseTrackerRecHit.h:61
SimpleDAFHitCollector::clone
std::unique_ptr< TrackingRecHit > clone(BaseTrackerRecHit const &hit2D) const
Definition: SimpleDAFHitCollector.h:75
HLT_FULL_cff.updator
updator
Definition: HLT_FULL_cff.py:123
SimpleDAFHitCollector::theHitCloner
TkClonerImpl theHitCloner
Definition: SimpleDAFHitCollector.h:94
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
LocalError
Definition: LocalError.h:12
SimpleDAFHitCollector::~SimpleDAFHitCollector
~SimpleDAFHitCollector() override
Definition: SimpleDAFHitCollector.h:34
SimpleDAFHitCollector::theUpdator
const SiTrackerMultiRecHitUpdator * theUpdator
Definition: SimpleDAFHitCollector.h:90
SimpleDAFHitCollector::debug_
const bool debug_
Definition: SimpleDAFHitCollector.h:95
BaseTrackerRecHit::firstClusterRef
virtual OmniClusterRef const & firstClusterRef() const =0
TkClonerImpl.h
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiStripRecHit1D
Definition: SiStripRecHit1D.h:8
TrackingRecHit::clone
virtual TrackingRecHit * clone() const =0
TrackingRecHit
Definition: TrackingRecHit.h:21
SiStripRecHit1D.h
SimpleDAFHitCollector
Definition: SimpleDAFHitCollector.h:17
SimpleDAFHitCollector::rightdimension
std::unique_ptr< TrackingRecHit > rightdimension(TrackingRecHit const &hit) const
Definition: SimpleDAFHitCollector.h:55
BaseTrackerRecHit::localPosition
LocalPoint localPosition() const override
Definition: BaseTrackerRecHit.h:56
MultiRecHitCollector.h
TkClonerImpl
Definition: TkClonerImpl.h:12
Trajectory
Definition: Trajectory.h:38
SimpleDAFHitCollector::recHits
std::vector< TrajectoryMeasurement > recHits(const Trajectory &, const MeasurementTrackerEvent *theMTE) const override
Definition: SimpleDAFHitCollector.cc:28
SimpleDAFHitCollector::thePropagator
const Propagator * thePropagator
Definition: SimpleDAFHitCollector.h:93
SimpleDAFHitCollector::SimpleDAFHitCollector
SimpleDAFHitCollector(const TrackerTopology *trackerTopology, const MeasurementTracker *measurementTracker, const SiTrackerMultiRecHitUpdator *updator, const MeasurementEstimator *est, const Propagator *propagator, bool debug)
Definition: SimpleDAFHitCollector.h:19
TrackingRecHit::detUnit
virtual const GeomDetUnit * detUnit() const
Definition: TrackingRecHit.cc:29
hit
Definition: SiStripHitEffFromCalibTree.cc:88
SimpleDAFHitCollector::getUpdator
const SiTrackerMultiRecHitUpdator * getUpdator() const
Definition: SimpleDAFHitCollector.h:45
SiTrackerMultiRecHitUpdator.h
SimpleDAFHitCollector::getEstimator
const MeasurementEstimator * getEstimator() const
Definition: SimpleDAFHitCollector.h:46