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 
15 
17 
18 
20 public:
21 
23  void init(const MeasurementDet* monoDet,
24  const MeasurementDet* stereoDet,
25  const TrackerTopology* tTopo);
26 
28 
29  // simple hits
31  const TrajectoryStateOnSurface& stateOnThisDet, const MeasurementEstimator&, const MeasurementTrackerEvent & data) const override;
32 
33 
34 
35  const GluedGeomDet& specificGeomDet() const {return static_cast<GluedGeomDet const&>(fastGeomDet());}
36 
37  bool measurements( const TrajectoryStateOnSurface& stateOnThisDet,
38  const MeasurementEstimator& est, const MeasurementTrackerEvent & data,
39  TempMeasurements & result) const override;
40 
41  const TkStripMeasurementDet* monoDet() const{ return theMonoDet;}
42  const TkStripMeasurementDet* stereoDet() const{ return theStereoDet;}
43 
44  unsigned int rawId() const { return fastGeomDet().geographicalId(); }
45 
46 
48  bool isActive(const MeasurementTrackerEvent & data) const override {return monoDet()->isActive(data) && stereoDet()->isActive(data); }
49 
51  bool hasBadComponents( const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent & data ) const override {
52  return (monoDet()->hasBadComponents(tsos,data) || stereoDet()->hasBadComponents(tsos,data));}
53 
54 private:
60 
61 
62  template<typename Collector>
63  void doubleMatch(const TrajectoryStateOnSurface& ts, const MeasurementTrackerEvent & data, Collector & collector) const dso_internal;
64 
65  template<typename Collector>
66  void collectRecHits(const TrajectoryStateOnSurface&, const MeasurementTrackerEvent & data, Collector &coll) const dso_internal;
67 
68  // for TTRH
69  class dso_internal HitCollectorForRecHits {
70  public:
72  HitCollectorForRecHits(const GeomDet * geomDet,
73  const SiStripRecHitMatcher * matcher,
77  target_.emplace_back(hit.cloneSH());
78  hasNewHits_ = true;
79  }
80  void addProjected(const TrackingRecHit& hit,
81  const GlobalVector & gdir) ;
82  SiStripRecHitMatcher::Collector & collector() { return collector_; }
83  bool hasNewMatchedHits() const { return hasNewHits_; }
84  void clearNewMatchedHitsFlag() { hasNewHits_ = false; }
85  static bool filter() { return false;}
86  size_t size() const { return target_.size();}
87 
88  static const MeasurementEstimator & estimator() { static const MeasurementEstimator * dummy=nullptr; return *dummy;}
89 
90  private:
91  const GeomDet * geomDet_;
97  };
98 
99  // for TRH
100  class dso_internal HitCollectorForSimpleHits {
101  public:
103  HitCollectorForSimpleHits(const GeomDet * geomDet,
104  const SiStripRecHitMatcher * matcher,
106  const TrajectoryStateOnSurface& stateOnThisDet,
107  const MeasurementEstimator& est,
109  void add(SiStripMatchedRecHit2D const & hit);
110  void addProjected(const TrackingRecHit& hit,
111  const GlobalVector & gdir) ;
112  SiStripRecHitMatcher::Collector & collector() { return collector_; }
113  bool hasNewMatchedHits() const { return hasNewHits_; }
114  void clearNewMatchedHitsFlag() { hasNewHits_ = false; }
115  bool filter() const { return matcher_->preFilter();} // if true mono-colection will been filter using the estimator before matching
116  size_t size() const { return target_.size();}
117  const MeasurementEstimator & estimator() { return est_;}
118  private:
119  const GeomDet * geomDet_;
127  };
128 
129 
130 
131  class dso_internal HitCollectorForFastMeasurements {
132  public:
135 
136  HitCollectorForFastMeasurements(const GeomDet * geomDet,
137  const SiStripRecHitMatcher * matcher,
139  const TrajectoryStateOnSurface& stateOnThisDet,
140  const MeasurementEstimator& est,
142  void add(SiStripMatchedRecHit2D const& hit) ;
143  void addProjected(const TrackingRecHit& hit,
144  const GlobalVector & gdir) ;
145 
146  SiStripRecHitMatcher::Collector & collector() { return collector_; }
147  bool hasNewMatchedHits() const { return hasNewHits_; }
148  void clearNewMatchedHitsFlag() { hasNewHits_ = false; }
149  bool filter() const { return matcher_->preFilter();} // if true mono-colection will been filter using the estimator before matching
150  size_t size() const { return target_.size();}
151  const MeasurementEstimator & estimator() { return est_;}
152  private:
153  const GeomDet * geomDet_;
161  };
162 
163 
164 
166  projectOnGluedDet( const std::vector<SiStripRecHit2D>& hits,
167  const TrajectoryStateOnSurface& ts) const dso_internal;
168  template<typename HitCollector>
169  void
170  projectOnGluedDet( HitCollector & collector,
171  const std::vector<SiStripRecHit2D>& hits,
172  const GlobalVector & gdir ) const dso_internal;
173 
174 
176  projectOnGluedDet( const RecHitContainer& hits,
177  const TrajectoryStateOnSurface& ts) const dso_internal;
178  template<typename HitCollector>
179  void
180  projectOnGluedDet( HitCollector & collector,
181  const RecHitContainer& hits,
182  const GlobalVector & gdir ) const dso_internal;
183 
184 
185  void checkProjection(const TrajectoryStateOnSurface& ts,
186  const RecHitContainer& monoHits,
187  const RecHitContainer& stereoHits) const;
188  void checkHitProjection(const TrackingRecHit& hit,
189  const TrajectoryStateOnSurface& ts,
190  const GeomDet& det) const dso_internal;
191 
193  bool testStrips(const TrajectoryStateOnSurface& tsos,
194  const BoundPlane &gluedPlane,
195  const TkStripMeasurementDet &mdet) const dso_internal;
196 
197 };
198 
199 #endif
const TkStripMeasurementDet * theMonoDet
const StripClusterParameterEstimator * cpe_
RecHitPointer cloneSH() const override
unsigned int rawId() const
int init
Definition: HydjetWrapper.h:67
static const MeasurementEstimator & estimator()
const TkStripMeasurementDet * monoDet() const
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &) const =0
const GeomDet & fastGeomDet() const
size_t size() const
always fast as no estimator available here!
const GluedGeomDet & specificGeomDet() const
TransientTrackingRecHit::RecHitPointer RecHitPointer
#define dso_internal
Definition: Visibility.h:13
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
virtual bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const =0
virtual bool isActive(const MeasurementTrackerEvent &data) const =0
std::shared_ptr< TrackingRecHit const > RecHitPointer
const StripClusterParameterEstimator * cpe_
const SiStripRecHitMatcher * theMatcher
SiStripRecHitMatcher::Collector & collector()
#define dso_hidden
Definition: Visibility.h:12
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
JetCorrectorParametersCollection coll
Definition: classes.h:10
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both mono and stereo components are active
const TkStripMeasurementDet * theStereoDet
TrackingRecHit::ConstRecHitContainer RecHitContainer
std::vector< BaseTrackerRecHit * > SimpleHitContainer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
return TRUE if at least one of the mono and stereo components has badChannels
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const =0
void add(SiStripMatchedRecHit2D const &hit)
boost::function< void(SiStripMatchedRecHit2D const &)> Collector
const TkStripMeasurementDet * stereoDet() const
const TrackerTopology * theTopology
const StripClusterParameterEstimator * theCPE