104 int nhits = hits.size();
105 if (nhits <2)
return 0;
119 auto const & recHit = hits[
i];
121 errors[
i] = recHit->globalPositionError();
122 isBarrel[
i] = recHit->detUnit()->type().isBarrel();
129 float valPhi, valTip, valPt;
131 int iCharge =
charge(points);
134 if ((curvature > 1.
e-4)&&
137 valPt = (invPt > 1.e-4
f) ? 1.
f/invPt : 1.e4f;
140 valPhi =
phi(center.
x(), center.
y(), iCharge);
145 valPhi = direction.barePhi();
146 valTip = -points[0].x()*
sin(valPhi) + points[0].y()*
cos(valPhi);
149 float valCotTheta = cotTheta(points[0],points[1]);
150 float valEta = std::asinh(valCotTheta);
151 float valZip =
zip(valTip, valPhi, curvature, points[0],points[1]);
154 float errValPt = param.errPt();
155 float errValCot = param.errCot();
156 float errValTip = param.errTip();
157 float errValPhi = param.errPhi();
158 float errValZip = param.errZip();
164 float cottheta, intercept, covss, covii, covsi;
165 rzLine.fit(cottheta, intercept, covss, covii, covsi);
166 chi2 = rzLine.chi2(cottheta, intercept);
const MagneticField * theField
GlobalPoint const & origin() const
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T inversePt(T curvature, const edm::EventSetup &iSetup)
T curvature(T InversePt, const edm::EventSetup &iSetup)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Cos< T >::type cos(const T &t)
reco::Track * build(const Measurement1D &pt, const Measurement1D &phi, const Measurement1D &cotTheta, const Measurement1D &tip, const Measurement1D &zip, float chi2, int charge, const std::vector< const TrackingRecHit * > &hits, const MagneticField *mf, const GlobalPoint &reference=GlobalPoint(0, 0, 0)) const
T y() const
Cartesian y coordinate.
T const * product() const
#define declareDynArray(T, n, x)
float fieldInInvGev(const edm::EventSetup &iSetup)
const BasicVectorType & basicVector() const
T x() const
Cartesian x coordinate.