CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
TkGluedMeasurementDet::HitCollectorForFastMeasurements Class Reference

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.

303  :
304  geomDet_(geomDet), matcher_(matcher), cpe_(cpe),stateOnThisDet_(stateOnThisDet), est_(est), target_(target),
305  collector_(boost::bind(&HitCollectorForFastMeasurements::add,boost::ref(*this),_1)),
306  hasNewHits_(false)
307 {
308 }

Member Function Documentation

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

Definition at line 311 of file TkGluedMeasurementDet.cc.

References LocalCache< T >::ptr.

312 {
313  static LocalCache<TSiStripMatchedRecHit> lcache; // in case of pool allocator it will be cleared centrally
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(); // clone and take ownership of the persistent 2D hit
319  target_.push_back(
321  RecHitPointer(cache.release()),
322  diffEst.second)
323  );
324  } else {
325  cache->clearPersistentHit(); // drop ownership
326  }
327  hasNewHits_ = true; //FIXME: see also what happens moving this within testAndPush
328 }
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
TransientTrackingRecHit::RecHitPointer RecHitPointer
std::auto_ptr< T > ptr
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().

333 {
334  // here we're ok with some extra casual new's and delete's
336  RecHitPointer phit = proj.project( hit, *geomDet_, gdir );
337  std::pair<bool,double> diffEst = est_.estimate( stateOnThisDet_, *phit);
338  if ( diffEst.first) {
339  target_.push_back( TrajectoryMeasurement( stateOnThisDet_, phit, diffEst.second) );
340  }
341 
342 }
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
RecHitPointer project(const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const
TransientTrackingRecHit::RecHitPointer RecHitPointer
void TkGluedMeasurementDet::HitCollectorForFastMeasurements::clearNewMatchedHitsFlag ( )
inline
SiStripRecHitMatcher::Collector& TkGluedMeasurementDet::HitCollectorForFastMeasurements::collector ( void  )
inline

Definition at line 103 of file TkGluedMeasurementDet.h.

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

Member Data Documentation

SiStripRecHitMatcher::Collector TkGluedMeasurementDet::HitCollectorForFastMeasurements::collector_
private

Definition at line 113 of file TkGluedMeasurementDet.h.

const StripClusterParameterEstimator* TkGluedMeasurementDet::HitCollectorForFastMeasurements::cpe_
private

Definition at line 109 of file TkGluedMeasurementDet.h.

const MeasurementEstimator& TkGluedMeasurementDet::HitCollectorForFastMeasurements::est_
private

Definition at line 111 of file TkGluedMeasurementDet.h.

const GeomDet* TkGluedMeasurementDet::HitCollectorForFastMeasurements::geomDet_
private

Definition at line 107 of file TkGluedMeasurementDet.h.

bool TkGluedMeasurementDet::HitCollectorForFastMeasurements::hasNewHits_
private

Definition at line 114 of file TkGluedMeasurementDet.h.

const SiStripRecHitMatcher* TkGluedMeasurementDet::HitCollectorForFastMeasurements::matcher_
private

Definition at line 108 of file TkGluedMeasurementDet.h.

const TrajectoryStateOnSurface& TkGluedMeasurementDet::HitCollectorForFastMeasurements::stateOnThisDet_
private

Definition at line 110 of file TkGluedMeasurementDet.h.

std::vector<TrajectoryMeasurement>& TkGluedMeasurementDet::HitCollectorForFastMeasurements::target_
private

Definition at line 112 of file TkGluedMeasurementDet.h.