41 double delta = gluedPlane.localZ( hitPlane.position());
44 LocalPoint projectedHitPos = lhitPos - ldir * delta/ldir.
z();
48 if (gluedPlane.normalVector().dot( hitPlane.normalVector()) < 0) {
54 return std::make_pair(projectedHitPos, rotatedError);
59 std::pair<LocalPoint,LocalError> projectedPos(
const TrackingRecHit& hit,
63 return projectedPos(hit, det, gdir, cpe);
76 theMatcher(matcher), theCPE(cpe),
86 throw MeasurementDetException(
"TkGluedMeasurementDet ERROR: Trying to glue a det which is not a TkStripMeasurementDet");
106 auto oldSize = result.size();
110 return result.size()>oldSize;
128 auto oldSize = result.
size();
134 if (result.
size()>oldSize)
return true;
138 bool killHIP = (1==
l) && (2==
id);
148 bool addMissingHit =
false;
152 addMissingHit = stateOnThisDet.
hasError() && (
168 addMissingHit = stateOnThisDet.
hasError() && (
195 template<
typename Collector>
202 template<
typename Collector>
216 if (monoHits.empty()) {
221 std::vector<SiStripRecHit2D> simpleSteroHitsByValue;
224 if (simpleSteroHitsByValue.empty()) {
230 vsStereoHits.resize(simpleSteroHitsByValue.size());
234 for (RecHitContainer::const_iterator monoHit = monoHits.begin();
235 monoHit != monoHits.end(); ++monoHit) {
238 theMatcher->
match( verySpecificMonoHit, vsStereoHits.begin(), vsStereoHits.end(),
241 if (collector.hasNewMatchedHits()) {
242 collector.clearNewMatchedHitsFlag();
244 collector.addProjected( **monoHit, glbDir );
285 if(fm!=0&&fs!=0) ++matchF;
286 if(fm!=0||fs!=0) ++singleF;
290 printf(
"Matches:%d/%d/%d/%d/%d/%d : %f/%f/%f/%f/%f/%f/%f\n",
291 int(totCall),
int(matchF),
int(singleF-matchF),
int(matchT),
int(zeroM),
int(zeroS),
292 totMono/totCall,totStereo/totCall,totComb/totCall,totMatched/matchT,
293 filtMono/totCall,filtStereo/totCall,filtComb/matchF);
308 for (
auto const & hit : hits) {
310 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,
fastGeomDet(),
static_cast<SiStripRecHit2D const &
>(*hit));
316 template<
typename Collector>
322 for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
323 collector.addProjected( **ihit, gdir );
332 for (
auto const & hit : hits) {
334 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,
fastGeomDet(),
static_cast<SiStripRecHit2D const &
>(hit));
340 template<
typename Collector>
343 std::vector<SiStripRecHit2D>
const & hits,
346 for (
auto const & hit : hits)
347 collector.addProjected(hit, gdir );
358 for (RecHitContainer::const_iterator
i=monoHits.begin();
i != monoHits.end(); ++
i) {
361 for (RecHitContainer::const_iterator
i=stereoHits.begin();
i != stereoHits.end(); ++
i) {
376 if ((projectedHit.localPosition()-propState.
localPosition()).
mag() > 0.0001f) {
377 std::cout <<
"PROBLEM: projected and propagated hit positions differ by "
378 << (projectedHit.localPosition()-propState.
localPosition()).
mag() << std::endl;
381 LocalError le1 = projectedHit.localPositionError();
384 double cutoff = 1.e-4;
386 fabs(le1.
xy() - le2.
xy())/(cutoff+fabs(le1.
xy()))),
387 fabs(le1.
yy() - le2.
yy())/(cutoff+le1.
xx()));
389 std::cout <<
"PROBLEM: projected and propagated hit errors differ by "
390 << maxdiff << std::endl;
422 if (stripPlane.normalVector().dot( gluedPlane.normalVector()) < 0) {
446 #include<boost/bind.hpp>
450 geomDet_(geomDet), matcher_(matcher), cpe_(cpe),target_(target),
463 geomDet_(geomDet), matcher_(matcher), cpe_(cpe),stateOnThisDet_(stateOnThisDet), est_(est), target_(target),
474 auto && vl = projectedPos(hit,*geomDet_, gdir, cpe_);
475 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,*geomDet_,
static_cast<SiStripRecHit2D const &
>(hit));
487 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, hit2d);
502 auto && vl = projectedPos(hit,*geomDet_, gdir, cpe_);
503 std::unique_ptr<ProjectedSiStripRecHit2D> phit(
new ProjectedSiStripRecHit2D(vl.first,vl.second,*geomDet_, static_cast<SiStripRecHit2D const &>(hit)));
504 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *phit);
505 if ( diffEst.first) {
506 target_.emplace_back(phit.release());
519 geomDet_(geomDet), matcher_(matcher), cpe_(cpe),stateOnThisDet_(stateOnThisDet), est_(est), target_(target),
533 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, hit2d);
548 auto && vl = projectedPos(hit,*geomDet_, gdir, cpe_);
549 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,*geomDet_,
static_cast<SiStripRecHit2D const &
>(hit));
551 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *phit);
552 if ( diffEst.first) {
553 target_.add(phit, diffEst.second);
560 #include "doubleMatch.icc"
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const
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
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet)
unsigned int layer() const
layer id
void add(SiStripMatchedRecHit2D const &hit)
void checkProjection(const TrajectoryStateOnSurface &ts, const RecHitContainer &monoHits, const RecHitContainer &stereoHits) const
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
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
const TkStripMeasurementDet * monoDet() const
void simpleRecHits(const TrajectoryStateOnSurface &ts, const MeasurementTrackerEvent &data, std::vector< SiStripRecHit2D > &result) const
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 RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
TrajectoryStateOnSurface propagate(const TrackingRecHit &hit, const Plane &plane, const TrajectoryStateOnSurface &ts) const
virtual RecHitPointer cloneSH() const
const GeomDet * det() const
LocalPoint toLocal(const GlobalPoint &gp) const
void add(ConstRecHitPointer const &h, float d)
const GluedGeomDet & specificGeomDet() const
GlobalVector momentum() const
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const
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?
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
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
virtual TrackingRecHit const * hit() const
HitCollectorForFastMeasurements(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &target)
unsigned long long uint64_t
const GlobalTrajectoryParameters & globalParameters() const
std::vector< const SiStripRecHit2D * > SimpleHitCollection
TrackingRecHit::ConstRecHitPointer theInactiveHit
virtual LocalError localPositionError() const =0
void checkHitProjection(const TrackingRecHit &hit, const TrajectoryStateOnSurface &ts, const GeomDet &det) const
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force=false) const
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'...
const TkStripMeasurementDet * theStereoDet
const StripGeomDetUnit & specificGeomDet() const
tuple MeasurementTrackerEvent
TrackingRecHit::ConstRecHitContainer RecHitContainer
SiStripCluster const & stereoCluster() const
std::vector< BaseTrackerRecHit * > SimpleHitContainer
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.
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
const TkStripMeasurementDet * stereoDet() const
DetId geographicalId() const
volatile std::atomic< bool > shutdown_flag false
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)