1 #ifndef Traj2TrackHits_H
2 #define Traj2TrackHits_H
22 using TrajParams = std::vector<LocalTrajectoryParameters>;
26 float tc = std::round(5.
f * chi2);
42 hits.
reserve(splitting ? 2 * meas.size() : meas.size());
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;
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
std::vector< LocalTrajectoryParameters > TrajParams
OmniClusterRef const & monoClusterRef() const
virtual TrackingRecHit * clone() const =0
LocalError localPositionError() const override
void operator()(Trajectory const &traj, TrackingRecHitCollection &hits, bool splitting) const
const StripClusterParameterEstimator * theCPE
virtual OmniClusterRef const & firstClusterRef() const =0
void operator()(Trajectory const &traj, TrackingRecHitCollection &hits, TrajParams &trajParams, Chi2sFive &chi2s) const
virtual const GeomDetUnit * detUnit() const
LocalPoint localPosition() const override
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 .