32 throw MeasurementDetException(
"TkGluedMeasurementDet ERROR: Trying to glue a det which is not a TkStripMeasurementDet");
50 template<
typename Collector>
57 template<
typename Collector>
71 if (monoHits.empty()) {
76 static std::vector<SiStripRecHit2D> simpleSteroHitsByValue;
77 simpleSteroHitsByValue.clear();
80 if (simpleSteroHitsByValue.empty()) {
86 vsStereoHits.resize(simpleSteroHitsByValue.size());
87 std::transform(simpleSteroHitsByValue.begin(), simpleSteroHitsByValue.end(), vsStereoHits.begin(),
take_address());
90 for (RecHitContainer::const_iterator monoHit = monoHits.begin();
91 monoHit != monoHits.end(); ++monoHit) {
94 theMatcher->
match( verySpecificMonoHit, vsStereoHits.begin(), vsStereoHits.end(),
97 if (collector.hasNewMatchedHits()) {
98 collector.clearNewMatchedHitsFlag();
100 collector.addProjected( **monoHit, glbDir );
109 std::vector<TrajectoryMeasurement>
115 std::vector<TrajectoryMeasurement>
result;
121 if ( result.empty()) {
147 if ( result.size() > 1) {
165 if (hits.empty())
return hits;
168 for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
174 template<
typename Collector>
180 for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
181 collector.addProjected( **ihit, gdir );
189 for (RecHitContainer::const_iterator
i=monoHits.begin();
i != monoHits.end(); ++
i) {
192 for (RecHitContainer::const_iterator
i=stereoHits.begin();
i != stereoHits.end(); ++
i) {
207 if ((projectedHit->localPosition()-propState.
localPosition()).
mag() > 0.0001) {
208 cout <<
"PROBLEM: projected and propagated hit positions differ by "
212 LocalError le1 = projectedHit->localPositionError();
217 fabs(le1.
xy() - le2.
xy())/(cutoff+fabs(le1.
xy()))),
218 fabs(le1.
yy() - le2.
yy())/(cutoff+le1.
xx()));
220 cout <<
"PROBLEM: projected and propagated hit errors differ by "
277 #include<boost/bind.hpp>
281 geomDet_(geomDet), matcher_(matcher), target_(target),
292 target_.push_back( proj.
project( hit, *geomDet_, gdir));
299 std::vector<TrajectoryMeasurement> &
target) :
300 geomDet_(geomDet), matcher_(matcher), stateOnThisDet_(stateOnThisDet), est_(est), target_(target),
310 std::auto_ptr<TSiStripMatchedRecHit> & cache = lcache.
ptr;
312 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *cache);
313 if ( diffEst.first) {
314 cache->clonePersistentHit();
321 cache->clearPersistentHit();
333 std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *phit);
334 if ( diffEst.first) {
343 #include "doubleMatch.icc"
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) 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 addProjected(const TransientTrackingRecHit &hit, const GlobalVector &gdir)
static RecHitPointer build(const GeomDet *geom, Type type=TrackingRecHit::missing, const DetLayer *layer=0)
TrajectoryStateOnSurface propagate(const TransientTrackingRecHit &hit, const Plane &plane, const TrajectoryStateOnSurface &ts) const
void checkProjection(const TrajectoryStateOnSurface &ts, const RecHitContainer &monoHits, const RecHitContainer &stereoHits) const
void collectRecHits(const TrajectoryStateOnSurface &, Collector &coll) 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
void addProjected(const TransientTrackingRecHit &hit, const GlobalVector &gdir)
const BoundSurface & surface() const
TkGluedMeasurementDet(const GluedGeomDet *gdet, const SiStripRecHitMatcher *matcher, const MeasurementDet *monoDet, const MeasurementDet *stereoDet)
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
LocalError positionError() const
RecHitPointer project(const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const
static void buildInPlace(std::auto_ptr< TSiStripMatchedRecHit > &memory, const GeomDet *geom, const TrackingRecHit *rh, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe=0, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
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
void checkHitProjection(const TransientTrackingRecHit &hit, const TrajectoryStateOnSurface &ts, const GeomDet &det) const
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
HitCollectorForFastMeasurements(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, std::vector< TrajectoryMeasurement > &target)
const LocalTrajectoryError & localError() const
void doubleMatch(const TrajectoryStateOnSurface &ts, Collector &collector) 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
HitCollectorForRecHits(const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, RecHitContainer &target)
void simpleRecHits(const TrajectoryStateOnSurface &ts, std::vector< SiStripRecHit2D > &result) const
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'...
RecHitContainer projectOnGluedDet(const RecHitContainer &hits, const TrajectoryStateOnSurface &ts) const
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.