1 #ifndef Traj2TrackHits_H 2 #define Traj2TrackHits_H 24 using TrajParams = std::vector<LocalTrajectoryParameters>;
34 keepOrder(ikeepOrder), removeNoDet(noNoDet) {}
40 hits.
reserve(splitting ? 2*meas.size() : meas.size());
42 if (keepOrder | along)
copy(meas.begin(),meas.end(),
hits);
43 else copy(meas.rbegin(),meas.rend(),
hits);
46 if (keepOrder | along)
split(meas.begin(),meas.end(),
hits, along);
47 else split(meas.rbegin(),meas.rend(),
hits,along);
55 trajParams.reserve(meas.size());
56 chi2s.reserve(meas.size());
57 if (keepOrder | along)
copy(meas.begin(),meas.end(),
hits, trajParams, chi2s);
58 else copy(meas.rbegin(),meas.rend(),
hits, trajParams, chi2s);
64 for(;itm!=
e;++itm)
if( (!removeNoDet) | ((*itm).recHitR().det()!=
nullptr)) {
65 hits.
push_back((*itm).recHitR().cloneHit());
66 trajParams.push_back((*itm).updatedState().localParameters());
67 chi2s.push_back(
toChi2x5((*itm).estimate()));
73 for(;itm!=
e;++itm)
if( (!removeNoDet) | ((*itm).recHitR().det()!=
nullptr)) hits.
push_back((*itm).recHitR().cloneHit());
80 auto const &
hit = *(*itm).recHit()->hit();
81 if( (removeNoDet) & ((*itm).recHitR().det()==
nullptr))
continue;
90 else if (thit.isMatched()) {
91 auto zdir = itm->updatedState().localDirection().z();
92 if (keepOrder & (!along)) zdir = -zdir;
93 split(*itm,static_cast<SiStripMatchedRecHit2D const&>(thit),hits,zdir);
94 }
else if (thit.isProjected()) {
102 auto const & detU = *hit2D.
detUnit();
104 bool endcap = detU.type().isEndcap();
105 if (endcap)
return hit2D.
clone();
136 LocalVector Delta = secondLocalPos - firstLocalPos;
137 float scalar = Delta.
z() * zdir;
LocalError localPositionError() const final
const GeomDetUnit * monoDet() const
virtual const GeomDetType & type() const
static unsigned char toChi2x5(float chi2)
bool isNotFromCluster(TrackingRecHit const &hit)
OmniClusterRef const & stereoClusterRef() const
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters <p) const
Traj2TrackHits(const TransientTrackingRecHitBuilder *builder, bool ikeepOrder, bool noNoDet=true)
std::vector< unsigned char > Chi2sFive
void copy(HI itm, HI e, TrackingRecHitCollection &hits) const
void split(HI itm, HI e, TrackingRecHitCollection &hits, bool along) const
PropagationDirection const & direction() const
DataContainer const & measurements() const
SiStripCluster const & stripCluster() const
TrackingRecHit * clone(BaseTrackerRecHit const &hit2D) const
const SurfaceType & surface() const
const Surface::PositionType & position() const
The position (origin of the R.F.)
const GeomDet * det() const
LocalPoint toLocal(const GlobalPoint &gp) const
virtual TrackingRecHit * clone() const =0
std::vector< LocalTrajectoryParameters > TrajParams
OmniClusterRef const & monoClusterRef() const
void operator()(Trajectory const &traj, TrackingRecHitCollection &hits, bool splitting) const
const StripClusterParameterEstimator * theCPE
void operator()(Trajectory const &traj, TrackingRecHitCollection &hits, TrajParams &trajParams, Chi2sFive &chi2s) const
virtual const GeomDetUnit * detUnit() const
virtual OmniClusterRef const & firstClusterRef() const =0
LocalPoint localPosition() const final
bool isUndef(TrackingRecHit const &hit)
TrajectoryStateOnSurface const & updatedState() const
void copy(HI itm, HI e, TrackingRecHitCollection &hits, TrajParams &trajParams, Chi2sFive &chi2s) const
BaseTrackerRecHit * build(GeomDetUnit const &idet, OmniClusterRef const &clus) const
const GeomDetUnit * stereoDet() const
void split(TrajectoryMeasurement const &itm, SiStripMatchedRecHit2D const &mhit, TrackingRecHitCollection &hits, float zdir) const
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .