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);
66 theMatcher(matcher), theCPE(cpe),
79 throw MeasurementDetException(
"TkGluedMeasurementDet ERROR: Trying to glue a det which is not a TkStripMeasurementDet");
99 auto oldSize = result.size();
103 return result.size()>oldSize;
121 auto oldSize = result.
size();
127 if (result.
size()>oldSize)
return true;
131 bool killHIP = (1==
l) && (2==
id);
169 template<
typename Collector>
176 template<
typename Collector>
190 if (monoHits.empty()) {
195 std::vector<SiStripRecHit2D> simpleSteroHitsByValue;
198 if (simpleSteroHitsByValue.empty()) {
204 vsStereoHits.resize(simpleSteroHitsByValue.size());
208 for (RecHitContainer::const_iterator monoHit = monoHits.begin();
209 monoHit != monoHits.end(); ++monoHit) {
212 theMatcher->
match( verySpecificMonoHit, vsStereoHits.begin(), vsStereoHits.end(),
215 if (collector.hasNewMatchedHits()) {
216 collector.clearNewMatchedHitsFlag();
218 collector.addProjected( **monoHit, glbDir );
262 if(fm!=0&&fs!=0) ++matchF;
263 if(fm!=0||fs!=0) ++singleF;
267 printf(
"Matches:%d/%d/%d/%d/%d/%d : %f/%f/%f/%f/%f/%f/%f\n",
268 int(totCall),
int(matchF),
int(singleF-matchF),
int(matchT),
int(zeroM),
int(zeroS),
269 totMono/totCall,totStereo/totCall,totComb/totCall,totMatched/matchT,
270 filtMono/totCall,filtStereo/totCall,filtComb/matchF);
292 for (
auto const & hit : hits) {
294 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,
fastGeomDet(),
static_cast<SiStripRecHit2D const &
>(*hit));
300 template<
typename Collector>
306 for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
307 collector.addProjected( **ihit, gdir );
316 for (
auto const & hit : hits) {
318 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,
fastGeomDet(),
static_cast<SiStripRecHit2D const &
>(hit));
324 template<
typename Collector>
327 std::vector<SiStripRecHit2D>
const & hits,
330 for (
auto const & hit : hits)
331 collector.addProjected(hit, gdir );
342 for (RecHitContainer::const_iterator
i=monoHits.begin();
i != monoHits.end(); ++
i) {
345 for (RecHitContainer::const_iterator
i=stereoHits.begin();
i != stereoHits.end(); ++
i) {
360 if ((projectedHit.localPosition()-propState.
localPosition()).
mag() > 0.0001f) {
361 std::cout <<
"PROBLEM: projected and propagated hit positions differ by " 362 << (projectedHit.localPosition()-propState.
localPosition()).
mag() << std::endl;
365 LocalError le1 = projectedHit.localPositionError();
370 fabs(le1.
xy() - le2.
xy())/(cutoff+fabs(le1.
xy()))),
371 fabs(le1.
yy() - le2.
yy())/(cutoff+le1.
xx()));
373 std::cout <<
"PROBLEM: projected and propagated hit errors differ by " 374 << maxdiff << std::endl;
406 if (stripPlane.normalVector().dot( gluedPlane.normalVector()) < 0) {
430 #include<boost/bind.hpp> 434 geomDet_(geomDet), matcher_(matcher), cpe_(cpe),target_(target),
459 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,*
geomDet_,
static_cast<SiStripRecHit2D const &
>(hit));
489 if ( diffEst.first) {
490 target_.emplace_back(phit.release());
533 auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,*
geomDet_,
static_cast<SiStripRecHit2D const &
>(hit));
536 if ( diffEst.first) {
537 target_.add(phit, diffEst.second);
544 #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
const StripClusterParameterEstimator * cpe_
void add(SiStripMatchedRecHit2D const &hit)
RecHitPointer cloneSH() const override
virtual bool preFilter(const TrajectoryStateOnSurface &, OpaquePayload const &) const
void checkProjection(const TrajectoryStateOnSurface &ts, const RecHitContainer &monoHits, const RecHitContainer &stereoHits) const
SiStripRecHitMatcher::Collector collector_
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'...
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
const TrajectoryStateOnSurface & stateOnThisDet_
GlobalPoint globalPosition() const
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
RecHitContainer & target_
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
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
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
LocalPoint toLocal(const GlobalPoint &gp) const
void add(ConstRecHitPointer const &h, float d)
const GluedGeomDet & specificGeomDet() const
GlobalVector momentum() const
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
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)
const MeasurementEstimator & est_
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
const SiStripRecHitMatcher * matcher_
void add(SiStripMatchedRecHit2D const &hit)
const StripClusterParameterEstimator * cpe_
const SiStripRecHitMatcher * theMatcher
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
virtual TrackingRecHit const * hit() const
RecHitContainer projectOnGluedDet(const std::vector< SiStripRecHit2D > &hits, const TrajectoryStateOnSurface &ts) 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
void checkHitProjection(const TrackingRecHit &hit, const TrajectoryStateOnSurface &ts, const GeomDet &det) const
const TkStripMeasurementDet * theStereoDet
const StripGeomDetUnit & specificGeomDet() const
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const override
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet, const TrackerTopology *tTopo)
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.
void add(SiStripMatchedRecHit2D const &hit)
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
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
const TrackerTopology * theTopology
virtual LocalError localPositionError() const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
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 SiStripRecHitMatcher * matcher_
const StripClusterParameterEstimator * theCPE
SiStripRecHitMatcher::Collector collector_
HitCollectorForRecHits(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, RecHitContainer &target)
unsigned int tobLayer(const DetId &id) const
SimpleHitContainer & target_