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 
14 class Propagator;
17 
19 public:
22 
23  using SimpleHitContainer=std::vector<BaseTrackerRecHit *>;
24 
25 
26  MeasurementDet( const GeomDet* gdet) :
27  theGeomDet(gdet),
30 
31  virtual ~MeasurementDet() = default;
32  virtual RecHitContainer recHits( const TrajectoryStateOnSurface&, const MeasurementTrackerEvent &) const = 0;
33 
34  // use a MeasurementEstimator to filter the hits (same algo as below..)
35  // default as above
36  virtual bool recHits( const TrajectoryStateOnSurface& stateOnThisDet, const MeasurementEstimator&, const MeasurementTrackerEvent & data,
37  RecHitContainer & result, 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, const MeasurementEstimator&, const MeasurementTrackerEvent & data) const { return false;}
45 
52  std::vector<TrajectoryMeasurement>
53  fastMeasurements( const TrajectoryStateOnSurface& stateOnThisDet,
55  const Propagator&,
56  const MeasurementEstimator& est,
57  const MeasurementTrackerEvent & data) const {
58 
59  TempMeasurements tmps;
60  measurements(stateOnThisDet, est, data, tmps);
61  std::vector<TrajectoryMeasurement> result;
62  result.reserve(tmps.size());
63  int index[tmps.size()]; tmps.sortIndex(index);
64  for (std::size_t i=0; i!=tmps.size(); ++i) {
65  auto j=index[i];
66  result.emplace_back(stateOnThisDet,std::move(tmps.hits[j]),tmps.distances[j]);
67  }
68  return result;
69  }
70 
71  // return false if missing ( if inactive is true and one hit)
72  virtual bool measurements( const TrajectoryStateOnSurface& stateOnThisDet,
73  const MeasurementEstimator& est,
75  TempMeasurements & result) const =0;
76 
77 
78  const GeomDet& fastGeomDet() const { return *theGeomDet;}
79  virtual const GeomDet& geomDet() const { return *theGeomDet;}
80 
81  const Surface& surface() const {return geomDet().surface();}
82 
83  const Surface::PositionType& position() const {return geomDet().position();}
84 
85  virtual bool isActive(const MeasurementTrackerEvent & data) const=0;
86  virtual bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent & data) const=0;
87 
88  private:
89 
91 protected:
94 
95 };
96 
97 
98 #endif
const GeomDet * theGeomDet
tracking::TempMeasurements TempMeasurements
std::size_t size() const
MeasurementDet(const GeomDet *gdet)
virtual const GeomDet & geomDet() const
const Surface & surface() const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &) const =0
TrackingRecHit::ConstRecHitPointer theMissingHit
const GeomDet & fastGeomDet() const
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
virtual bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const =0
virtual bool isActive(const MeasurementTrackerEvent &data) const =0
const Surface::PositionType & position() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
virtual bool recHits(SimpleHitContainer &result, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data) const
virtual ~MeasurementDet()=default
TrackingRecHit::ConstRecHitPointer theInactiveHit
void sortIndex(int *index) const
virtual bool recHits(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data, RecHitContainer &result, std::vector< float > &) const
TrackingRecHit::ConstRecHitContainer RecHitContainer
std::vector< BaseTrackerRecHit * > SimpleHitContainer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const =0
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &est, const MeasurementTrackerEvent &data) const
def move(src, dest)
Definition: eostools.py:511