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 StripClusterParameterEstimator *cpe, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, std::vector< TrajectoryMeasurement > &target)

Private Attributes

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

Detailed Description

Definition at line 88 of file TkGluedMeasurementDet.h.


Member Typedef Documentation

Definition at line 91 of file TkGluedMeasurementDet.h.

Definition at line 90 of file TkGluedMeasurementDet.h.


Constructor & Destructor Documentation

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

Definition at line 299 of file TkGluedMeasurementDet.cc.

                                                   :
  geomDet_(geomDet), matcher_(matcher), cpe_(cpe),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 311 of file TkGluedMeasurementDet.cc.

References tests::test_CacheProxy::cache, 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_, cpe_ );
  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 331 of file TkGluedMeasurementDet.cc.

References trackerHitRTTI::proj, and 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 105 of file TkGluedMeasurementDet.h.

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

Definition at line 103 of file TkGluedMeasurementDet.h.

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

Definition at line 104 of file TkGluedMeasurementDet.h.

{ return hasNewHits_;  }

Member Data Documentation

Definition at line 113 of file TkGluedMeasurementDet.h.

Definition at line 109 of file TkGluedMeasurementDet.h.

Definition at line 111 of file TkGluedMeasurementDet.h.

Definition at line 107 of file TkGluedMeasurementDet.h.

Definition at line 114 of file TkGluedMeasurementDet.h.

Definition at line 108 of file TkGluedMeasurementDet.h.

Definition at line 110 of file TkGluedMeasurementDet.h.

Definition at line 112 of file TkGluedMeasurementDet.h.