1 #ifndef Traj2TrackHits_H 2 #define Traj2TrackHits_H 22 using TrajParams = std::vector<LocalTrajectoryParameters>;
26 float tc = std::round(5.
f *
chi2);
45 copy(meas.begin(), meas.end(),
hits);
47 copy(meas.rbegin(), meas.rend(),
hits);
51 split(meas.begin(), meas.end(),
hits, along);
53 split(meas.rbegin(), meas.rend(),
hits, along);
64 trajParams.reserve(meas.size());
65 chi2s.reserve(meas.size());
67 copy(meas.begin(), meas.end(),
hits, trajParams, chi2s);
69 copy(meas.rbegin(), meas.rend(),
hits, trajParams, chi2s);
73 template <
typename HI>
75 for (; itm !=
e; ++itm)
76 if ((!
removeNoDet) | ((*itm).recHitR().det() !=
nullptr)) {
77 hits.push_back((*itm).recHitR().cloneHit());
78 trajParams.push_back((*itm).updatedState().localParameters());
79 chi2s.push_back(
toChi2x5((*itm).estimate()));
83 template <
typename HI>
85 for (; itm !=
e; ++itm)
86 if ((!
removeNoDet) | ((*itm).recHitR().det() !=
nullptr))
87 hits.push_back((*itm).recHitR().cloneHit());
90 template <
typename HI>
92 for (; itm !=
e; ++itm) {
93 auto const &
hit = *(*itm).recHit()->hit();
94 if ((
removeNoDet) & ((*itm).recHitR().det() ==
nullptr))
104 else if (clus.isPhase2())
106 else if (thit.isMatched()) {
107 auto zdir = itm->updatedState().localDirection().z();
110 split(*itm, static_cast<SiStripMatchedRecHit2D const &>(thit),
hits, zdir);
111 }
else if (thit.isProjected()) {
120 auto const &detU = *hit2D.
detUnit();
122 bool endcap = detU.type().isEndcap();
124 return hit2D.
clone();
153 LocalVector Delta = secondLocalPos - firstLocalPos;
154 float scalar = Delta.
z() * zdir;
157 hits.push_back(hitS);
158 hits.push_back(hitM);
160 hits.push_back(hitM);
161 hits.push_back(hitS);
TrackingRecHit * clone(BaseTrackerRecHit const &hit2D) const
static unsigned char toChi2x5(float chi2)
bool isNotFromCluster(TrackingRecHit const &hit)
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters <p) const
void operator()(Trajectory const &traj, TrackingRecHitCollection &hits, TrajParams &trajParams, Chi2sFive &chi2s) const
OmniClusterRef const & stereoClusterRef() const
Traj2TrackHits(const TransientTrackingRecHitBuilder *builder, bool ikeepOrder, bool noNoDet=true)
std::vector< unsigned char > Chi2sFive
const SurfaceType & surface() const
virtual const GeomDetType & type() const
LocalPoint toLocal(const GlobalPoint &gp) const
OmniClusterRef const & monoClusterRef() const
const GeomDet * det() const
void operator()(Trajectory const &traj, TrackingRecHitCollection &hits, bool splitting) const
DataContainer const & measurements() const
PropagationDirection const & direction() const
void split(HI itm, HI e, TrackingRecHitCollection &hits, bool along) const
std::vector< LocalTrajectoryParameters > TrajParams
virtual const GeomDetUnit * detUnit() const
const GeomDetUnit * monoDet() const
virtual TrackingRecHit * clone() const =0
LocalError localPositionError() const override
void copy(HI itm, HI e, TrackingRecHitCollection &hits) const
const StripClusterParameterEstimator * theCPE
virtual OmniClusterRef const & firstClusterRef() const =0
const GeomDetUnit * stereoDet() const
const Surface::PositionType & position() const
The position (origin of the R.F.)
TrajectoryStateOnSurface const & updatedState() const
BaseTrackerRecHit * build(GeomDetUnit const &idet, OmniClusterRef const &clus) const
LocalPoint localPosition() const override
SiStripCluster const & stripCluster() const
bool isUndef(TrackingRecHit const &hit)
void split(TrajectoryMeasurement const &itm, SiStripMatchedRecHit2D const &mhit, TrackingRecHitCollection &hits, float zdir) const
void copy(HI itm, HI e, TrackingRecHitCollection &hits, TrajParams &trajParams, Chi2sFive &chi2s) const
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .