CMS 3D CMS Logo

MeasurementDet.h
Go to the documentation of this file.
1 #ifndef MeasurementDet_H
2 #define MeasurementDet_H
3 
5 
10 
12 class Propagator;
15 
17 public:
20 
21  using SimpleHitContainer = std::vector<BaseTrackerRecHit*>;
22 
23  MeasurementDet(const GeomDet* gdet)
24  : theGeomDet(gdet),
26  theInactiveHit(std::make_shared<InvalidTrackingRecHit>(fastGeomDet(), TrackingRecHit::inactive)) {}
27 
28  virtual ~MeasurementDet() = default;
30 
31  // use a MeasurementEstimator to filter the hits (same algo as below..)
32  // default as above
33  virtual bool recHits(const TrajectoryStateOnSurface& stateOnThisDet,
34  const MeasurementEstimator&,
37  std::vector<float>&) const {
38  result = recHits(stateOnThisDet, data);
39  return !result.empty();
40  }
41 
42  // default for non-tracker dets...
44  const TrajectoryStateOnSurface& stateOnThisDet,
45  const MeasurementEstimator&,
46  const MeasurementTrackerEvent& data) const {
47  return false;
48  }
49 
56  std::vector<TrajectoryMeasurement> fastMeasurements(const TrajectoryStateOnSurface& stateOnThisDet,
58  const Propagator&,
59  const MeasurementEstimator& est,
60  const MeasurementTrackerEvent& data) const {
61  TempMeasurements tmps;
62  measurements(stateOnThisDet, est, data, tmps);
63  std::vector<TrajectoryMeasurement> result;
64  result.reserve(tmps.size());
65  int index[tmps.size()];
66  tmps.sortIndex(index);
67  for (std::size_t i = 0; i != tmps.size(); ++i) {
68  auto j = index[i];
69  result.emplace_back(stateOnThisDet, std::move(tmps.hits[j]), tmps.distances[j]);
70  }
71  return result;
72  }
73 
74  // return false if missing ( if inactive is true and one hit)
75  virtual bool measurements(const TrajectoryStateOnSurface& stateOnThisDet,
76  const MeasurementEstimator& est,
78  TempMeasurements& result) const = 0;
79 
80  const GeomDet& fastGeomDet() const { return *theGeomDet; }
81  virtual const GeomDet& geomDet() const { return *theGeomDet; }
82 
83  const Surface& surface() const { return geomDet().surface(); }
84 
85  const Surface::PositionType& position() const { return geomDet().position(); }
86 
87  virtual bool isActive(const MeasurementTrackerEvent& data) const = 0;
88  virtual bool hasBadComponents(const TrajectoryStateOnSurface& tsos, const MeasurementTrackerEvent& data) const = 0;
89 
90 private:
92 
93 protected:
96 };
97 
98 #endif
const GeomDet * theGeomDet
tracking::TempMeasurements TempMeasurements
virtual const GeomDet & geomDet() const
virtual bool recHits(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data, RecHitContainer &result, std::vector< float > &) const
MeasurementDet(const GeomDet *gdet)
void sortIndex(int *index) const
missing
Definition: combine.py:5
TrackingRecHit::ConstRecHitPointer theMissingHit
const Surface::PositionType & position() const
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &) const =0
std::vector< ConstRecHitPointer > ConstRecHitContainer
virtual ~MeasurementDet()=default
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &est, const MeasurementTrackerEvent &data) const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrackingRecHit::ConstRecHitPointer theInactiveHit
const GeomDet & fastGeomDet() const
virtual bool recHits(SimpleHitContainer &result, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data) const
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
const Surface & surface() const
TrackingRecHit::ConstRecHitContainer RecHitContainer
virtual bool isActive(const MeasurementTrackerEvent &data) const =0
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::vector< BaseTrackerRecHit * > SimpleHitContainer
std::size_t size() const
def move(src, dest)
Definition: eostools.py:511
virtual bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const =0
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const =0