CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

TkGluedMeasurementDet::HitCollectorForFastMeasurements Class Reference

List of all members.

Public Types

typedef
SiStripRecHitMatcher::Collector 
Collector
typedef
TransientTrackingRecHit::RecHitPointer 
RecHitPointer

Public Member Functions

void add (SiStripMatchedRecHit2D const &hit)
void addProjected (const TransientTrackingRecHit &hit, const GlobalVector &gdir)
void clearNewMatchedHitsFlag ()
SiStripRecHitMatcher::Collectorcollector ()
bool hasNewMatchedHits () const
 HitCollectorForFastMeasurements (const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, std::vector< TrajectoryMeasurement > &target)

Private Attributes

SiStripRecHitMatcher::Collector collector_
const MeasurementEstimatorest_
const GeomDetgeomDet_
bool hasNewHits_
const SiStripRecHitMatchermatcher_
const TrajectoryStateOnSurfacestateOnThisDet_
std::vector
< TrajectoryMeasurement > & 
target_

Detailed Description

Definition at line 80 of file TkGluedMeasurementDet.h.


Member Typedef Documentation

Definition at line 83 of file TkGluedMeasurementDet.h.

Definition at line 82 of file TkGluedMeasurementDet.h.


Constructor & Destructor Documentation

TkGluedMeasurementDet::HitCollectorForFastMeasurements::HitCollectorForFastMeasurements ( const GeomDet geomDet,
const SiStripRecHitMatcher matcher,
const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
std::vector< TrajectoryMeasurement > &  target 
)

Definition at line 295 of file TkGluedMeasurementDet.cc.

                                                   :
    geomDet_(geomDet), matcher_(matcher), stateOnThisDet_(stateOnThisDet), est_(est), target_(target),
    collector_(boost::bind(&HitCollectorForFastMeasurements::add,boost::ref(*this),_1)),
    hasNewHits_(false)
{
}

Member Function Documentation

void TkGluedMeasurementDet::HitCollectorForFastMeasurements::add ( SiStripMatchedRecHit2D const &  hit)

Definition at line 307 of file TkGluedMeasurementDet.cc.

References TSiStripMatchedRecHit::buildInPlace(), and LocalCache< T >::ptr.

{
  static LocalCache<TSiStripMatchedRecHit> lcache; // in case of pool allocator it will be cleared centrally
  std::auto_ptr<TSiStripMatchedRecHit> & cache = lcache.ptr;
  TSiStripMatchedRecHit::buildInPlace( cache, geomDet_, &hit2d, matcher_ );
  std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *cache);
  if ( diffEst.first) {
    cache->clonePersistentHit(); // clone and take ownership of the persistent 2D hit
    target_.push_back( 
                      TrajectoryMeasurement( stateOnThisDet_, 
                                             RecHitPointer(cache.release()), 
                                             diffEst.second)
                       );
  } else {
    cache->clearPersistentHit(); // drop ownership
  } 
  hasNewHits_ = true; //FIXME: see also what happens moving this within testAndPush
}
void TkGluedMeasurementDet::HitCollectorForFastMeasurements::addProjected ( const TransientTrackingRecHit hit,
const GlobalVector gdir 
)

Definition at line 327 of file TkGluedMeasurementDet.cc.

References TrackingRecHitProjector< ResultingHit >::project().

{
    // here we're ok with some extra casual new's and delete's
    TrackingRecHitProjector<ProjectedRecHit2D> proj;
    RecHitPointer phit = proj.project( hit, *geomDet_, gdir );
    std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *phit);
    if ( diffEst.first) {
        target_.push_back( TrajectoryMeasurement( stateOnThisDet_, phit, diffEst.second) );
    }

}
void TkGluedMeasurementDet::HitCollectorForFastMeasurements::clearNewMatchedHitsFlag ( ) [inline]

Definition at line 96 of file TkGluedMeasurementDet.h.

References hasNewHits_.

{ hasNewHits_ = false; }
SiStripRecHitMatcher::Collector& TkGluedMeasurementDet::HitCollectorForFastMeasurements::collector ( void  ) [inline]

Definition at line 94 of file TkGluedMeasurementDet.h.

References collector_.

{ return collector_; }
bool TkGluedMeasurementDet::HitCollectorForFastMeasurements::hasNewMatchedHits ( ) const [inline]

Definition at line 95 of file TkGluedMeasurementDet.h.

References hasNewHits_.

{ return hasNewHits_;  }

Member Data Documentation

Definition at line 103 of file TkGluedMeasurementDet.h.

Referenced by collector().

Definition at line 101 of file TkGluedMeasurementDet.h.

Definition at line 98 of file TkGluedMeasurementDet.h.

Definition at line 104 of file TkGluedMeasurementDet.h.

Referenced by clearNewMatchedHitsFlag(), and hasNewMatchedHits().

Definition at line 99 of file TkGluedMeasurementDet.h.

Definition at line 100 of file TkGluedMeasurementDet.h.

Definition at line 102 of file TkGluedMeasurementDet.h.