40 double delta = gluedPlane.localZ(hitPlane.position());
43 LocalPoint projectedHitPos = lhitPos - ldir * delta / ldir.
z();
47 if (gluedPlane.normalVector().dot(hitPlane.normalVector()) < 0) {
53 return std::make_pair(projectedHitPos, rotatedError);
69 theStereoDet(nullptr),
70 theTopology(nullptr) {}
81 "TkGluedMeasurementDet ERROR: Trying to glue a det which is not a TkStripMeasurementDet");
100 auto oldSize = result.size();
104 return result.size() > oldSize;
117 auto oldSize = result.
size();
122 if (result.
size() > oldSize)
127 bool killHIP = (1 ==
l) && (2 ==
id);
155 template <
typename T>
162 template <
typename Collector>
165 Collector& collector)
const {
169 template <
typename Collector>
172 Collector& collector)
const {
183 if (monoHits.empty()) {
188 std::vector<SiStripRecHit2D> simpleSteroHitsByValue;
191 if (simpleSteroHitsByValue.empty()) {
196 vsStereoHits.resize(simpleSteroHitsByValue.size());
198 simpleSteroHitsByValue.begin(), simpleSteroHitsByValue.end(), vsStereoHits.begin(),
take_address());
201 for (RecHitContainer::const_iterator monoHit = monoHits.begin(); monoHit != monoHits.end(); ++monoHit) {
205 vsStereoHits.begin(),
207 collector.collector(),
211 if (collector.hasNewMatchedHits()) {
212 collector.clearNewMatchedHitsFlag();
214 collector.addProjected(**monoHit, glbDir);
232 double totStereo = 0;
234 double totMatched = 0;
236 double filtStereo = 0;
261 if (fm != 0 && fs != 0)
263 if (fm != 0 || fs != 0)
268 printf(
"Matches:%d/%d/%d/%d/%d/%d : %f/%f/%f/%f/%f/%f/%f\n",
271 int(singleF - matchF),
280 filtStereo / totCall,
298 for (
auto const& hit : hits) {
300 auto&& phit = std::make_shared<ProjectedSiStripRecHit2D>(
307 template <
typename Collector>
311 for (RecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end(); ihit++) {
312 collector.addProjected(**ihit, gdir);
319 for (
auto const& hit : hits) {
321 auto&& phit = std::make_shared<ProjectedSiStripRecHit2D>(
328 template <
typename Collector>
330 std::vector<SiStripRecHit2D>
const& hits,
332 for (
auto const& hit : hits)
333 collector.addProjected(hit, gdir);
339 for (RecHitContainer::const_iterator
i = monoHits.begin();
i != monoHits.end(); ++
i) {
342 for (RecHitContainer::const_iterator
i = stereoHits.begin();
i != stereoHits.end(); ++
i) {
356 if ((projectedHit.localPosition() - propState.
localPosition()).
mag() > 0.0001f) {
357 std::cout <<
"PROBLEM: projected and propagated hit positions differ by "
358 << (projectedHit.localPosition() - propState.
localPosition()).
mag() << std::endl;
361 LocalError le1 = projectedHit.localPositionError();
364 double cutoff = 1.e-4;
366 std::max(fabs(le1.
xx() - le2.
xx()) / (cutoff + le1.
xx()), fabs(le1.
xy() - le2.
xy()) / (cutoff + fabs(le1.
xy()))),
367 fabs(le1.
yy() - le2.
yy()) / (cutoff + le1.
xx()));
369 std::cout <<
"PROBLEM: projected and propagated hit errors differ by " << maxdiff << std::endl;
398 if (stripPlane.normalVector().dot(gluedPlane.normalVector()) < 0) {
431 hasNewHits_(
false) {}
443 stateOnThisDet_(stateOnThisDet),
447 hasNewHits_(
false) {}
450 auto&& vl = projectedPos(hit, *geomDet_, gdir, cpe_);
451 auto&& phit = std::make_shared<ProjectedSiStripRecHit2D>(
458 if (!est_.preFilter(stateOnThisDet_,
463 std::pair<bool, double> diffEst = est_.estimate(stateOnThisDet_, hit2d);
475 auto&& vl = projectedPos(hit, *geomDet_, gdir, cpe_);
476 std::unique_ptr<ProjectedSiStripRecHit2D> phit(
478 std::pair<bool, double> diffEst = est_.estimate(stateOnThisDet_, *phit);
480 target_.emplace_back(phit.release());
494 stateOnThisDet_(stateOnThisDet),
498 hasNewHits_(
false) {}
503 if (!est_.preFilter(stateOnThisDet_,
508 std::pair<bool, double> diffEst = est_.estimate(stateOnThisDet_, hit2d);
510 target_.add(hit2d.
cloneSH(), diffEst.second);
520 auto&& vl = projectedPos(hit, *geomDet_, gdir, cpe_);
521 auto&& phit = std::make_shared<ProjectedSiStripRecHit2D>(
524 std::pair<bool, double> diffEst = est_.estimate(stateOnThisDet_, *phit);
526 target_.add(phit, diffEst.second);
531 #include "doubleMatch.icc"
bool testStrips(const TrajectoryStateOnSurface &tsos, const BoundPlane &gluedPlane, const TkStripMeasurementDet &mdet) const
Test the strips on one of the two dets with projection.
const TkStripMeasurementDet * theMonoDet
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'...
void add(SiStripMatchedRecHit2D const &hit)
void checkProjection(const TrajectoryStateOnSurface &ts, const RecHitContainer &monoHits, const RecHitContainer &stereoHits) const
RecHitPointer cloneSH() const override
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
SiStripCluster const & monoCluster() const
LocalVector localDirection() const
LocalPoint localPosition() const
float minPt2ForHitRecoveryInGluedDet() const
virtual const GeomDet & geomDet() const
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
const TkStripMeasurementDet * monoDet() const
void simpleRecHits(const TrajectoryStateOnSurface &ts, const MeasurementTrackerEvent &data, std::vector< SiStripRecHit2D > &result) const
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
const Surface & surface() const
void addProjected(const TrackingRecHit &hit, const GlobalVector &gdir)
virtual GlobalPoint globalPosition() const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
LocalError positionError() const
void addProjected(const TrackingRecHit &hit, const GlobalVector &gdir)
TkGluedMeasurementDet(const GluedGeomDet *gdet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe)
TrackingRecHit::ConstRecHitPointer theMissingHit
const GeomDet & fastGeomDet() const
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
TrajectoryStateOnSurface propagate(const TrackingRecHit &hit, const Plane &plane, const TrajectoryStateOnSurface &ts) const
const GeomDet * det() const
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
LocalPoint toLocal(const GlobalPoint &gp) const
void add(ConstRecHitPointer const &h, float d)
const GluedGeomDet & specificGeomDet() const
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
GlobalVector momentum() const
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
DetId geographicalId() const
The label of this GeomDet.
HitCollectorForSimpleHits(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, SimpleHitContainer &target)
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalTrajectoryError & localError() const
bool hasAllGoodChannels() const
does this module have at least one bad strip, APV or channel?
void collectRecHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data, Collector &coll) const
const T * operator()(const T &val) const
const Surface::PositionType & position() const
void doubleMatch(const TrajectoryStateOnSurface &ts, const MeasurementTrackerEvent &data, Collector &collector) const
void add(SiStripMatchedRecHit2D const &hit)
RecHitContainer projectOnGluedDet(const std::vector< SiStripRecHit2D > &hits, const TrajectoryStateOnSurface &ts) const
const SiStripRecHitMatcher * theMatcher
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
virtual TrackingRecHit const * hit() const
HitCollectorForFastMeasurements(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &target)
std::vector< const SiStripRecHit2D * > SimpleHitCollection
unsigned long long uint64_t
const GlobalTrajectoryParameters & globalParameters() const
TrackingRecHit::ConstRecHitPointer theInactiveHit
virtual LocalError localPositionError() const =0
void checkHitProjection(const TrackingRecHit &hit, const TrajectoryStateOnSurface &ts, const GeomDet &det) const
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const override
const TkStripMeasurementDet * theStereoDet
const StripGeomDetUnit & specificGeomDet() const
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet, const TrackerTopology *tTopo)
TrackingRecHit::ConstRecHitContainer RecHitContainer
SiStripCluster const & stereoCluster() const
void addProjected(const TrackingRecHit &hit, const GlobalVector &gdir)
char data[epos_bytes_allocation]
GlobalVector globalMomentum() const
bool testStrips(float utraj, float uerr) const
return true if there are 'enough' good strips in the utraj +/- 3 uerr range.
tuple MeasurementTrackerEvent
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::vector< BaseTrackerRecHit * > SimpleHitContainer
const TkStripMeasurementDet * stereoDet() const
DetId geographicalId() const
const TrackerTopology * theTopology
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
const StripClusterParameterEstimator * theCPE
HitCollectorForRecHits(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, RecHitContainer &target)
unsigned int tobLayer(const DetId &id) const