27 theMatcher(matcher), theCPE(cpe),
37 throw MeasurementDetException(
"TkGluedMeasurementDet ERROR: Trying to glue a det which is not a TkStripMeasurementDet");
54 template<
typename Collector>
61 template<
typename Collector>
75 if (monoHits.empty()) {
80 static std::vector<SiStripRecHit2D> simpleSteroHitsByValue;
81 simpleSteroHitsByValue.clear();
84 if (simpleSteroHitsByValue.empty()) {
90 vsStereoHits.resize(simpleSteroHitsByValue.size());
94 for (RecHitContainer::const_iterator monoHit = monoHits.begin();
95 monoHit != monoHits.end(); ++monoHit) {
97 const SiStripRecHit2D* verySpecificMonoHit =
reinterpret_cast<const SiStripRecHit2D*
>(tkhit);
98 theMatcher->
match( verySpecificMonoHit, vsStereoHits.begin(), vsStereoHits.end(),
101 if (collector.hasNewMatchedHits()) {
102 collector.clearNewMatchedHitsFlag();
104 collector.addProjected( **monoHit, glbDir );
113 std::vector<TrajectoryMeasurement>
119 std::vector<TrajectoryMeasurement>
result;
125 if ( result.empty()) {
151 if ( result.size() > 1) {
169 if (hits.empty())
return hits;
172 for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
178 template<
typename Collector>
184 for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
185 collector.addProjected( **ihit, gdir );
193 for (RecHitContainer::const_iterator
i=monoHits.begin();
i != monoHits.end(); ++
i) {
196 for (RecHitContainer::const_iterator
i=stereoHits.begin();
i != stereoHits.end(); ++
i) {
211 if ((projectedHit->localPosition()-propState.
localPosition()).
mag() > 0.0001) {
212 cout <<
"PROBLEM: projected and propagated hit positions differ by "
216 LocalError le1 = projectedHit->localPositionError();
221 fabs(le1.
xy() - le2.
xy())/(cutoff+fabs(le1.
xy()))),
222 fabs(le1.
yy() - le2.
yy())/(cutoff+le1.
xx()));
224 cout <<
"PROBLEM: projected and propagated hit errors differ by "
281 #include<boost/bind.hpp>
285 geomDet_(geomDet), matcher_(matcher), cpe_(cpe),target_(target),
296 target_.push_back( proj.
project( hit, *geomDet_, gdir));
303 std::vector<TrajectoryMeasurement> &
target) :
304 geomDet_(geomDet), matcher_(matcher), cpe_(cpe),stateOnThisDet_(stateOnThisDet), est_(est), target_(target),
314 std::auto_ptr<TSiStripMatchedRecHit> & cache = lcache.
ptr;
315 TSiStripMatchedRecHit::buildInPlace( cache, geomDet_, &hit2d, matcher_, cpe_ );
316 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *cache);
317 if ( diffEst.first) {
318 cache->clonePersistentHit();
325 cache->clearPersistentHit();
337 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *phit);
338 if ( diffEst.first) {
347 #include "doubleMatch.icc"
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
void collectRecHits(const TrajectoryStateOnSurface &, Collector &coll) const dso_internal
const TkStripMeasurementDet * theMonoDet
HitCollectorForFastMeasurements(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, std::vector< TrajectoryMeasurement > &target)
RecHitContainer projectOnGluedDet(const RecHitContainer &hits, const TrajectoryStateOnSurface &ts) const dso_internal
void addProjected(const TransientTrackingRecHit &hit, const GlobalVector &gdir)
void init(const MeasurementDet *monoDet, const MeasurementDet *stereoDet)
void checkHitProjection(const TransientTrackingRecHit &hit, const TrajectoryStateOnSurface &ts, const GeomDet &det) const dso_internal
TrajectoryStateOnSurface propagate(const TransientTrackingRecHit &hit, const Plane &plane, const TrajectoryStateOnSurface &ts) const
void checkProjection(const TrajectoryStateOnSurface &ts, const RecHitContainer &monoHits, const RecHitContainer &stereoHits) const
SiStripMatchedRecHit2D * match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
LocalVector localDirection() const
LocalPoint localPosition() const
GlobalVector normalVector() const
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
virtual const GeomDet & geomDet() const
Global3DPoint GlobalPoint
float localZ(const GlobalPoint &gp) const
Fast access to distance from plane for a point.
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
const TkStripMeasurementDet * monoDet() const
void addProjected(const TransientTrackingRecHit &hit, const GlobalVector &gdir)
const BoundSurface & surface() const
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
LocalError positionError() const
TkGluedMeasurementDet(const GluedGeomDet *gdet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe)
void doubleMatch(const TrajectoryStateOnSurface &ts, Collector &collector) const dso_internal
const GeomDet & fastGeomDet() const
RecHitPointer project(const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
const T & max(const T &a, const T &b)
LocalPoint toLocal(const GlobalPoint &gp) const
const GluedGeomDet & specificGeomDet() const
GlobalVector momentum() const
bool testStrips(const TrajectoryStateOnSurface &tsos, const BoundPlane &gluedPlane, const TkStripMeasurementDet &mdet) const dso_internal
Test the strips on one of the two dets with projection.
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?
const T * operator()(const T &val) const
const Surface::PositionType & position() const
void add(SiStripMatchedRecHit2D const &hit)
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const
const SiStripRecHitMatcher * theMatcher
const GlobalTrajectoryParameters & globalParameters() const
virtual std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const
std::vector< const SiStripRecHit2D * > SimpleHitCollection
const TkStripMeasurementDet * theStereoDet
const StripGeomDetUnit & specificGeomDet() const
void simpleRecHits(const TrajectoryStateOnSurface &ts, std::vector< SiStripRecHit2D > &result) const
const BoundPlane & surface() const
The nominal surface of the GeomDet.
bool testStrips(float utraj, float uerr) const
return true if there are 'enough' good strips in the utraj +/- 3 uerr range.
bool isActive() const
Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'...
const TkStripMeasurementDet * stereoDet() const
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)