CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
TkGluedMeasurementDet::HitCollectorForSimpleHits Class Reference

Public Types

typedef SiStripRecHitMatcher::Collector Collector
 

Public Member Functions

void add (SiStripMatchedRecHit2D const &hit)
 
void addProjected (const TrackingRecHit &hit, const GlobalVector &gdir)
 
void clearNewMatchedHitsFlag ()
 
SiStripRecHitMatcher::Collectorcollector ()
 
const MeasurementEstimatorestimator ()
 
bool filter () const
 
bool hasNewMatchedHits () const
 
 HitCollectorForSimpleHits (const GeomDet *geomDet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, SimpleHitContainer &target)
 
size_t size () const
 

Private Attributes

SiStripRecHitMatcher::Collector collector_
 
const StripClusterParameterEstimatorcpe_
 
const MeasurementEstimatorest_
 
const GeomDetgeomDet_
 
bool hasNewHits_
 
const SiStripRecHitMatchermatcher_
 
const TrajectoryStateOnSurfacestateOnThisDet_
 
SimpleHitContainertarget_
 

Detailed Description

Definition at line 105 of file TkGluedMeasurementDet.h.

Member Typedef Documentation

◆ Collector

Definition at line 107 of file TkGluedMeasurementDet.h.

Constructor & Destructor Documentation

◆ HitCollectorForSimpleHits()

TkGluedMeasurementDet::HitCollectorForSimpleHits::HitCollectorForSimpleHits ( const GeomDet geomDet,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe,
const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
SimpleHitContainer target 
)

Definition at line 434 of file TkGluedMeasurementDet.cc.

441  : geomDet_(geomDet),
442  matcher_(matcher),
443  cpe_(cpe),
444  stateOnThisDet_(stateOnThisDet),
445  est_(est),
446  target_(target),
447  collector_(boost::bind(&HitCollectorForSimpleHits::add, boost::ref(*this), _1)),
448  hasNewHits_(false) {}

Member Function Documentation

◆ add()

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

Definition at line 457 of file TkGluedMeasurementDet.cc.

457  {
458  hasNewHits_ = true; //FIXME: see also what happens moving this within testAndPush // consistent with previous code
460  ClusterFilterPayload(hit2d.geographicalId(), &hit2d.monoCluster(), &hit2d.stereoCluster())))
461  return;
462  hasNewHits_ = true; //FIXME: see also what happens moving this within testAndPush
463 
464  std::pair<bool, double> diffEst = est_.estimate(stateOnThisDet_, hit2d);
465  if (diffEst.first)
466  target_.emplace_back(new SiStripMatchedRecHit2D(hit2d)); // fix to use move (really needed???)
467 }

References TrackingRecHit::geographicalId(), SiStripMatchedRecHit2D::monoCluster(), and SiStripMatchedRecHit2D::stereoCluster().

Referenced by counter.Counter::register().

◆ addProjected()

void TkGluedMeasurementDet::HitCollectorForSimpleHits::addProjected ( const TrackingRecHit hit,
const GlobalVector gdir 
)

Definition at line 469 of file TkGluedMeasurementDet.cc.

470  {
471  auto const& thit = reinterpret_cast<TrackerSingleRecHit const&>(hit);
472  if (!est_.preFilter(stateOnThisDet_, ClusterFilterPayload(hit.geographicalId(), &thit.stripCluster())))
473  return;
474 
475  // here we're ok with some extra casual new's and delete's
476  auto&& vl = projectedPos(hit, *geomDet_, gdir, cpe_);
477  std::unique_ptr<ProjectedSiStripRecHit2D> phit(
478  new ProjectedSiStripRecHit2D(vl.first, vl.second, *geomDet_, static_cast<SiStripRecHit2D const&>(hit)));
479  std::pair<bool, double> diffEst = est_.estimate(stateOnThisDet_, *phit);
480  if (diffEst.first) {
481  target_.emplace_back(phit.release());
482  }
483 }

◆ clearNewMatchedHitsFlag()

void TkGluedMeasurementDet::HitCollectorForSimpleHits::clearNewMatchedHitsFlag ( )
inline

Definition at line 118 of file TkGluedMeasurementDet.h.

118 { hasNewHits_ = false; }

◆ collector()

SiStripRecHitMatcher::Collector& TkGluedMeasurementDet::HitCollectorForSimpleHits::collector ( void  )
inline

Definition at line 116 of file TkGluedMeasurementDet.h.

116 { return collector_; }

◆ estimator()

const MeasurementEstimator& TkGluedMeasurementDet::HitCollectorForSimpleHits::estimator ( void  )
inline

Definition at line 123 of file TkGluedMeasurementDet.h.

123 { return est_; }

◆ filter()

bool TkGluedMeasurementDet::HitCollectorForSimpleHits::filter ( ) const
inline

Definition at line 119 of file TkGluedMeasurementDet.h.

119  {
120  return matcher_->preFilter();
121  } // if true mono-colection will been filter using the estimator before matching

◆ hasNewMatchedHits()

bool TkGluedMeasurementDet::HitCollectorForSimpleHits::hasNewMatchedHits ( ) const
inline

Definition at line 117 of file TkGluedMeasurementDet.h.

117 { return hasNewHits_; }

◆ size()

size_t TkGluedMeasurementDet::HitCollectorForSimpleHits::size ( void  ) const
inline

Definition at line 122 of file TkGluedMeasurementDet.h.

122 { return target_.size(); }

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

Member Data Documentation

◆ collector_

SiStripRecHitMatcher::Collector TkGluedMeasurementDet::HitCollectorForSimpleHits::collector_
private

Definition at line 132 of file TkGluedMeasurementDet.h.

◆ cpe_

const StripClusterParameterEstimator* TkGluedMeasurementDet::HitCollectorForSimpleHits::cpe_
private

Definition at line 128 of file TkGluedMeasurementDet.h.

◆ est_

const MeasurementEstimator& TkGluedMeasurementDet::HitCollectorForSimpleHits::est_
private

Definition at line 130 of file TkGluedMeasurementDet.h.

◆ geomDet_

const GeomDet* TkGluedMeasurementDet::HitCollectorForSimpleHits::geomDet_
private

Definition at line 126 of file TkGluedMeasurementDet.h.

◆ hasNewHits_

bool TkGluedMeasurementDet::HitCollectorForSimpleHits::hasNewHits_
private

Definition at line 133 of file TkGluedMeasurementDet.h.

◆ matcher_

const SiStripRecHitMatcher* TkGluedMeasurementDet::HitCollectorForSimpleHits::matcher_
private

Definition at line 127 of file TkGluedMeasurementDet.h.

◆ stateOnThisDet_

const TrajectoryStateOnSurface& TkGluedMeasurementDet::HitCollectorForSimpleHits::stateOnThisDet_
private

Definition at line 129 of file TkGluedMeasurementDet.h.

◆ target_

SimpleHitContainer& TkGluedMeasurementDet::HitCollectorForSimpleHits::target_
private

Definition at line 131 of file TkGluedMeasurementDet.h.

TkGluedMeasurementDet::HitCollectorForSimpleHits::matcher_
const SiStripRecHitMatcher * matcher_
Definition: TkGluedMeasurementDet.h:127
SiStripRecHitMatcher::preFilter
bool preFilter() const
Definition: SiStripRecHitMatcher.h:41
TkGluedMeasurementDet::HitCollectorForSimpleHits::stateOnThisDet_
const TrajectoryStateOnSurface & stateOnThisDet_
Definition: TkGluedMeasurementDet.h:129
TkGluedMeasurementDet::HitCollectorForSimpleHits::add
void add(SiStripMatchedRecHit2D const &hit)
Definition: TkGluedMeasurementDet.cc:457
TkGluedMeasurementDet::HitCollectorForSimpleHits::cpe_
const StripClusterParameterEstimator * cpe_
Definition: TkGluedMeasurementDet.h:128
TkGluedMeasurementDet::HitCollectorForSimpleHits::est_
const MeasurementEstimator & est_
Definition: TkGluedMeasurementDet.h:130
ProjectedSiStripRecHit2D
Definition: ProjectedSiStripRecHit2D.h:8
MeasurementEstimator::estimate
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
MeasurementEstimator::preFilter
virtual bool preFilter(const TrajectoryStateOnSurface &, OpaquePayload const &) const
Definition: MeasurementEstimator.h:50
ClusterFilterPayload
Definition: ClusterFilterPayload.h:7
TkGluedMeasurementDet::HitCollectorForSimpleHits::geomDet_
const GeomDet * geomDet_
Definition: TkGluedMeasurementDet.h:126
TkGluedMeasurementDet::HitCollectorForSimpleHits::target_
SimpleHitContainer & target_
Definition: TkGluedMeasurementDet.h:131
SiStripMatchedRecHit2D
Definition: SiStripMatchedRecHit2D.h:8
TkGluedMeasurementDet::HitCollectorForSimpleHits::collector_
SiStripRecHitMatcher::Collector collector_
Definition: TkGluedMeasurementDet.h:132
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
TkGluedMeasurementDet::HitCollectorForSimpleHits::hasNewHits_
bool hasNewHits_
Definition: TkGluedMeasurementDet.h:133
hit
Definition: SiStripHitEffFromCalibTree.cc:88
MeasurementDet::geomDet
virtual const GeomDet & geomDet() const
Definition: MeasurementDet.h:81