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
Vector3DBase
Definition: Vector3DBase.h:8
TkGluedMeasurementDet::HitCollectorForFastMeasurements::clearNewMatchedHitsFlag
void clearNewMatchedHitsFlag()
Definition: TkGluedMeasurementDet.h:152
TkGluedMeasurementDet::HitCollectorForSimpleHits::size
size_t size() const
Definition: TkGluedMeasurementDet.h:122
MeasurementEstimator
Definition: MeasurementEstimator.h:19
Visibility.h
init
int init
Definition: HydjetWrapper.h:64
TkGluedMeasurementDet::HitCollectorForSimpleHits::matcher_
const SiStripRecHitMatcher * matcher_
Definition: TkGluedMeasurementDet.h:127
TkGluedMeasurementDet::HitCollectorForFastMeasurements::hasNewMatchedHits
bool hasNewMatchedHits() const
Definition: TkGluedMeasurementDet.h:151
GeomDet
Definition: GeomDet.h:27
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
MeasurementDet::RecHitContainer
TrackingRecHit::ConstRecHitContainer RecHitContainer
Definition: MeasurementDet.h:19
TkGluedMeasurementDet::monoDet
const TkStripMeasurementDet * monoDet() const
Definition: TkGluedMeasurementDet.h:39
TkGluedMeasurementDet::HitCollectorForRecHits::hasNewHits_
bool hasNewHits_
Definition: TkGluedMeasurementDet.h:101
TkGluedMeasurementDet::HitCollectorForFastMeasurements::est_
const MeasurementEstimator & est_
Definition: TkGluedMeasurementDet.h:164
TrackerTopology
Definition: TrackerTopology.h:16
TkGluedMeasurementDet::HitCollectorForSimpleHits::stateOnThisDet_
const TrajectoryStateOnSurface & stateOnThisDet_
Definition: TkGluedMeasurementDet.h:129
TkGluedMeasurementDet::HitCollectorForRecHits
Definition: TkGluedMeasurementDet.h:72
SiStripRecHitMatcher::Collector
std::function< void(SiStripMatchedRecHit2D const &)> Collector
Definition: SiStripRecHitMatcher.h:33
MeasurementDet::hasBadComponents
virtual bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const =0
TkGluedMeasurementDet::HitCollectorForFastMeasurements::estimator
const MeasurementEstimator & estimator()
Definition: TkGluedMeasurementDet.h:157
TkGluedMeasurementDet::HitCollectorForRecHits::estimator
static const MeasurementEstimator & estimator()
Definition: TkGluedMeasurementDet.h:90
TkGluedMeasurementDet::theStereoDet
const TkStripMeasurementDet * theStereoDet
Definition: TkGluedMeasurementDet.h:58
TkGluedMeasurementDet::HitCollectorForSimpleHits::Collector
SiStripRecHitMatcher::Collector Collector
Definition: TkGluedMeasurementDet.h:107
TkGluedMeasurementDet::HitCollectorForSimpleHits::cpe_
const StripClusterParameterEstimator * cpe_
Definition: TkGluedMeasurementDet.h:128
TrajectoryMeasurement.h
TkGluedMeasurementDet::HitCollectorForSimpleHits::estimator
const MeasurementEstimator & estimator()
Definition: TkGluedMeasurementDet.h:123
TkGluedMeasurementDet::HitCollectorForSimpleHits::est_
const MeasurementEstimator & est_
Definition: TkGluedMeasurementDet.h:130
TkGluedMeasurementDet::HitCollectorForFastMeasurements::geomDet_
const GeomDet * geomDet_
Definition: TkGluedMeasurementDet.h:160
MeasurementDet
Definition: MeasurementDet.h:16
MeasurementDet::measurements
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const =0
TrackingRecHit::RecHitPointer
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: TrackingRecHit.h:24
tracking::TempMeasurements
Definition: TempMeasurements.h:10
TkGluedMeasurementDet::theTopology
const TrackerTopology * theTopology
Definition: TkGluedMeasurementDet.h:59
TkGluedMeasurementDet::HitCollectorForFastMeasurements::collector
SiStripRecHitMatcher::Collector & collector()
Definition: TkGluedMeasurementDet.h:150
StripClusterParameterEstimator
Definition: StripClusterParameterEstimator.h:25
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TkGluedMeasurementDet::HitCollectorForSimpleHits::geomDet_
const GeomDet * geomDet_
Definition: TkGluedMeasurementDet.h:126
TkGluedMeasurementDet::HitCollectorForFastMeasurements::target_
TempMeasurements & target_
Definition: TkGluedMeasurementDet.h:165
TkGluedMeasurementDet::HitCollectorForRecHits::target_
RecHitContainer & target_
Definition: TkGluedMeasurementDet.h:99
MeasurementEstimator.h
TkGluedMeasurementDet::HitCollectorForSimpleHits::target_
SimpleHitContainer & target_
Definition: TkGluedMeasurementDet.h:131
TkGluedMeasurementDet::HitCollectorForFastMeasurements::RecHitPointer
TransientTrackingRecHit::RecHitPointer RecHitPointer
Definition: TkGluedMeasurementDet.h:138
dso_hidden
#define dso_hidden
Definition: Visibility.h:12
GluedGeomDet
Definition: GluedGeomDet.h:7
TkGluedMeasurementDet::HitCollectorForRecHits::Collector
SiStripRecHitMatcher::Collector Collector
Definition: TkGluedMeasurementDet.h:74
TkGluedMeasurementDet::rawId
unsigned int rawId() const
Definition: TkGluedMeasurementDet.h:42
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
TkGluedMeasurementDet::HitCollectorForSimpleHits::hasNewMatchedHits
bool hasNewMatchedHits() const
Definition: TkGluedMeasurementDet.h:117
TkGluedMeasurementDet
Definition: TkGluedMeasurementDet.h:17
TkStripMeasurementDet
Definition: TkStripMeasurementDet.h:74
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
TkGluedMeasurementDet::HitCollectorForRecHits::hasNewMatchedHits
bool hasNewMatchedHits() const
Definition: TkGluedMeasurementDet.h:85
MeasurementDet::isActive
virtual bool isActive(const MeasurementTrackerEvent &data) const =0
TkGluedMeasurementDet::hasBadComponents
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
return TRUE if at least one of the mono and stereo components has badChannels
Definition: TkGluedMeasurementDet.h:50
TkGluedMeasurementDet::HitCollectorForFastMeasurements::cpe_
const StripClusterParameterEstimator * cpe_
Definition: TkGluedMeasurementDet.h:162
TkStripMeasurementDet.h
MeasurementDet::SimpleHitContainer
std::vector< BaseTrackerRecHit * > SimpleHitContainer
Definition: MeasurementDet.h:21
PVValHelper::add
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
Definition: PVValidationHelpers.cc:12
dso_internal
#define dso_internal
Definition: Visibility.h:13
TkGluedMeasurementDet::HitCollectorForFastMeasurements::matcher_
const SiStripRecHitMatcher * matcher_
Definition: TkGluedMeasurementDet.h:161
TkGluedMeasurementDet::theCPE
const StripClusterParameterEstimator * theCPE
Definition: TkGluedMeasurementDet.h:56
TkGluedMeasurementDet::HitCollectorForRecHits::filter
static bool filter()
Definition: TkGluedMeasurementDet.h:87
TkGluedMeasurementDet::HitCollectorForFastMeasurements
Definition: TkGluedMeasurementDet.h:136
TkGluedMeasurementDet::HitCollectorForSimpleHits::collector
SiStripRecHitMatcher::Collector & collector()
Definition: TkGluedMeasurementDet.h:116
TkGluedMeasurementDet::stereoDet
const TkStripMeasurementDet * stereoDet() const
Definition: TkGluedMeasurementDet.h:40
TrackingRecHit
Definition: TrackingRecHit.h:21
TkGluedMeasurementDet::HitCollectorForFastMeasurements::Collector
SiStripRecHitMatcher::Collector Collector
Definition: TkGluedMeasurementDet.h:139
TkGluedMeasurementDet::theMatcher
const SiStripRecHitMatcher * theMatcher
Definition: TkGluedMeasurementDet.h:55
SiStripRecHitMatcher.h
TkGluedMeasurementDet::HitCollectorForRecHits::size
size_t size() const
always fast as no estimator available here!
Definition: TkGluedMeasurementDet.h:88
TkGluedMeasurementDet::HitCollectorForFastMeasurements::size
size_t size() const
Definition: TkGluedMeasurementDet.h:156
TkGluedMeasurementDet::HitCollectorForRecHits::geomDet_
const GeomDet * geomDet_
Definition: TkGluedMeasurementDet.h:96
TkGluedMeasurementDet::theMonoDet
const TkStripMeasurementDet * theMonoDet
Definition: TkGluedMeasurementDet.h:57
TkGluedMeasurementDet::HitCollectorForFastMeasurements::filter
bool filter() const
Definition: TkGluedMeasurementDet.h:153
TSiStripMatchedRecHit.h
TkGluedMeasurementDet::HitCollectorForRecHits::cpe_
const StripClusterParameterEstimator * cpe_
Definition: TkGluedMeasurementDet.h:98
TkGluedMeasurementDet::HitCollectorForRecHits::matcher_
const SiStripRecHitMatcher * matcher_
Definition: TkGluedMeasurementDet.h:97
SiStripMatchedRecHit2D
Definition: SiStripMatchedRecHit2D.h:8
TkGluedMeasurementDet::HitCollectorForRecHits::add
void add(SiStripMatchedRecHit2D const &hit)
Definition: TkGluedMeasurementDet.h:79
TkGluedMeasurementDet::HitCollectorForSimpleHits
Definition: TkGluedMeasurementDet.h:105
TkGluedMeasurementDet::isActive
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both mono and stereo components are active
Definition: TkGluedMeasurementDet.h:45
TkGluedMeasurementDet::HitCollectorForRecHits::collector
SiStripRecHitMatcher::Collector & collector()
Definition: TkGluedMeasurementDet.h:84
BoundPlane
TkGluedMeasurementDet::HitCollectorForFastMeasurements::stateOnThisDet_
const TrajectoryStateOnSurface & stateOnThisDet_
Definition: TkGluedMeasurementDet.h:163
TkGluedMeasurementDet::HitCollectorForSimpleHits::collector_
SiStripRecHitMatcher::Collector collector_
Definition: TkGluedMeasurementDet.h:132
StripClusterParameterEstimator.h
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
mps_fire.result
result
Definition: mps_fire.py:311
TkGluedMeasurementDet::HitCollectorForFastMeasurements::collector_
SiStripRecHitMatcher::Collector collector_
Definition: TkGluedMeasurementDet.h:166
TkGluedMeasurementDet::HitCollectorForRecHits::collector_
SiStripRecHitMatcher::Collector collector_
Definition: TkGluedMeasurementDet.h:100
TkGluedMeasurementDet::HitCollectorForSimpleHits::hasNewHits_
bool hasNewHits_
Definition: TkGluedMeasurementDet.h:133
dummy
Definition: DummySelector.h:38
TkGluedMeasurementDet::HitCollectorForFastMeasurements::hasNewHits_
bool hasNewHits_
Definition: TkGluedMeasurementDet.h:167
SiStripRecHitMatcher
Definition: SiStripRecHitMatcher.h:24
TkGluedMeasurementDet::HitCollectorForSimpleHits::clearNewMatchedHitsFlag
void clearNewMatchedHitsFlag()
Definition: TkGluedMeasurementDet.h:118
TkGluedMeasurementDet::HitCollectorForRecHits::clearNewMatchedHitsFlag
void clearNewMatchedHitsFlag()
Definition: TkGluedMeasurementDet.h:86
MeasurementDet::fastGeomDet
const GeomDet & fastGeomDet() const
Definition: MeasurementDet.h:80
TkGluedMeasurementDet::HitCollectorForSimpleHits::filter
bool filter() const
Definition: TkGluedMeasurementDet.h:119
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MeasurementDet.h
MeasurementDet::recHits
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &) const =0
TkGluedMeasurementDet::specificGeomDet
const GluedGeomDet & specificGeomDet() const
Definition: TkGluedMeasurementDet.h:32