CMS 3D CMS Logo

TkGluedMeasurementDet.h
Go to the documentation of this file.
1 #ifndef TkGluedMeasurementDet_H
2 #define TkGluedMeasurementDet_H
3 
6 
7 class GluedGeomDet;
8 //class SiStripRecHitMatcher;
14 
16 
18 public:
20  const SiStripRecHitMatcher* matcher,
22  void init(const MeasurementDet* monoDet, const MeasurementDet* stereoDet, const TrackerTopology* tTopo);
23 
25 
26  // simple hits
28  const TrajectoryStateOnSurface& stateOnThisDet,
29  const MeasurementEstimator&,
30  const MeasurementTrackerEvent& data) const override;
31 
32  const GluedGeomDet& specificGeomDet() const { return static_cast<GluedGeomDet const&>(fastGeomDet()); }
33 
34  bool measurements(const TrajectoryStateOnSurface& stateOnThisDet,
35  const MeasurementEstimator& est,
37  TempMeasurements& result) const override;
38 
39  const TkStripMeasurementDet* monoDet() const { return theMonoDet; }
40  const TkStripMeasurementDet* stereoDet() const { return theStereoDet; }
41 
42  unsigned int rawId() const { return fastGeomDet().geographicalId(); }
43 
45  bool isActive(const MeasurementTrackerEvent& data) const override {
46  return monoDet()->isActive(data) && stereoDet()->isActive(data);
47  }
48 
50  bool hasBadComponents(const TrajectoryStateOnSurface& tsos, const MeasurementTrackerEvent& data) const override {
51  return (monoDet()->hasBadComponents(tsos, data) || stereoDet()->hasBadComponents(tsos, data));
52  }
53 
54 private:
60 
61  template <typename Collector>
62  void doubleMatch(const TrajectoryStateOnSurface& ts,
64  Collector& collector) const dso_internal;
65 
66  template <typename Collector>
67  void collectRecHits(const TrajectoryStateOnSurface&,
69  Collector& coll) const dso_internal;
70 
71  // for TTRH
73  public:
75  HitCollectorForRecHits(const GeomDet* geomDet,
76  const SiStripRecHitMatcher* matcher,
80  target_.emplace_back(hit.cloneSH());
81  hasNewHits_ = true;
82  }
83  void addProjected(const TrackingRecHit& hit, const GlobalVector& gdir);
84  SiStripRecHitMatcher::Collector& collector() { return collector_; }
85  bool hasNewMatchedHits() const { return hasNewHits_; }
86  void clearNewMatchedHitsFlag() { hasNewHits_ = false; }
87  static bool filter() { return false; }
88  size_t size() const { return target_.size(); }
89 
90  static const MeasurementEstimator& estimator() {
91  static const MeasurementEstimator* dummy = nullptr;
92  return *dummy;
93  }
94 
95  private:
96  const GeomDet* geomDet_;
102  };
103 
104  // for TRH
106  public:
108  HitCollectorForSimpleHits(const GeomDet* geomDet,
109  const SiStripRecHitMatcher* matcher,
111  const TrajectoryStateOnSurface& stateOnThisDet,
112  const MeasurementEstimator& est,
114  void add(SiStripMatchedRecHit2D const& hit);
115  void addProjected(const TrackingRecHit& hit, const GlobalVector& gdir);
116  SiStripRecHitMatcher::Collector& collector() { return collector_; }
117  bool hasNewMatchedHits() const { return hasNewHits_; }
118  void clearNewMatchedHitsFlag() { hasNewHits_ = false; }
119  bool filter() const {
120  return matcher_->preFilter();
121  } // if true mono-colection will been filter using the estimator before matching
122  size_t size() const { return target_.size(); }
123  const MeasurementEstimator& estimator() { return est_; }
124 
125  private:
134  };
135 
137  public:
140 
142  const SiStripRecHitMatcher* matcher,
144  const TrajectoryStateOnSurface& stateOnThisDet,
145  const MeasurementEstimator& est,
147  void add(SiStripMatchedRecHit2D const& hit);
148  void addProjected(const TrackingRecHit& hit, const GlobalVector& gdir);
149 
150  SiStripRecHitMatcher::Collector& collector() { return collector_; }
151  bool hasNewMatchedHits() const { return hasNewHits_; }
152  void clearNewMatchedHitsFlag() { hasNewHits_ = false; }
153  bool filter() const {
154  return matcher_->preFilter();
155  } // if true mono-colection will been filter using the estimator before matching
156  size_t size() const { return target_.size(); }
157  const MeasurementEstimator& estimator() { return est_; }
158 
159  private:
168  };
169 
170  RecHitContainer projectOnGluedDet(const std::vector<SiStripRecHit2D>& hits,
171  const TrajectoryStateOnSurface& ts) const dso_internal;
172  template <typename HitCollector>
173  void projectOnGluedDet(HitCollector& collector,
174  const std::vector<SiStripRecHit2D>& hits,
175  const GlobalVector& gdir) const dso_internal;
176 
177  RecHitContainer projectOnGluedDet(const RecHitContainer& hits, const TrajectoryStateOnSurface& ts) const dso_internal;
178  template <typename HitCollector>
179  void projectOnGluedDet(HitCollector& collector,
180  const RecHitContainer& hits,
181  const GlobalVector& gdir) const dso_internal;
182 
183  void checkProjection(const TrajectoryStateOnSurface& ts,
184  const RecHitContainer& monoHits,
185  const RecHitContainer& stereoHits) const;
186  void checkHitProjection(const TrackingRecHit& hit,
187  const TrajectoryStateOnSurface& ts,
188  const GeomDet& det) const dso_internal;
189 
191  bool testStrips(const TrajectoryStateOnSurface& tsos,
192  const BoundPlane& gluedPlane,
193  const TkStripMeasurementDet& mdet) const dso_internal;
194 };
195 
196 #endif
const TkStripMeasurementDet * theMonoDet
const StripClusterParameterEstimator * cpe_
const TkStripMeasurementDet * stereoDet() const
int init
Definition: HydjetWrapper.h:64
static const MeasurementEstimator & estimator()
std::function< void(SiStripMatchedRecHit2D const &)> Collector
const GluedGeomDet & specificGeomDet() const
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
return TRUE if at least one of the mono and stereo components has badChannels
TransientTrackingRecHit::RecHitPointer RecHitPointer
#define dso_internal
Definition: Visibility.h:13
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &) const =0
const StripClusterParameterEstimator * cpe_
const SiStripRecHitMatcher * theMatcher
SiStripRecHitMatcher::Collector & collector()
#define dso_hidden
Definition: Visibility.h:12
const GeomDet & fastGeomDet() const
const TkStripMeasurementDet * theStereoDet
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both mono and stereo components are active
TrackingRecHit::ConstRecHitContainer RecHitContainer
virtual bool isActive(const MeasurementTrackerEvent &data) const =0
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
unsigned int rawId() const
void add(SiStripMatchedRecHit2D const &hit)
std::vector< BaseTrackerRecHit * > SimpleHitContainer
const TrackerTopology * theTopology
size_t size() const
always fast as no estimator available here!
const StripClusterParameterEstimator * theCPE
const TkStripMeasurementDet * monoDet() const
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