45 float dphi = v32.
phi() - v21.
phi();
48 return (dphi > 0) ? -1 : 1;
59 theConfig(cfg), theTracker(0), theField(0), theTTRecHitBuilder(0)
66 const std::vector<const TrackingRecHit *> & hits,
69 int nhits = hits.size();
70 if(nhits <2)
return 0;
76 if (!theField || !theTracker || !theTTRecHitBuilder)
80 theTracker = trackerESH.
product();
89 theTTRecHitBuilder = ttrhbESH.
product();
93 for (
auto const & ih : hits)
95 auto recHit = theTTRecHitBuilder->build(ih);
97 points[
i] = recHit->globalPosition();
98 errors[
i] = recHit->globalPositionError();
99 isBarrel[++
i] = recHit->detUnit()->type().isBarrel();
111 float valPt = (invPt > 1.e-4) ? 1./invPt : 1.e4;
112 float errPt = 0.055*valPt + 0.017*valPt*valPt;
119 float valZip = getZip(valTip, curvature, points[0],points[1]);
121 float valPhi = getPhi(center.
x(), center.
y(),
charge);
124 getCotThetaAndUpdateZip(points[0],points[1], 1/curvature,
125 valPhi,valTip,valZip);
128 float errTip, errZip;
129 getErrTipAndErrZip(valPt, points.back().eta(), errTip,errZip);
130 float errPhi = 0.002;
131 float errCotTheta = 0.002;
137 chi2 = rzLine.
chi2();
149 return builder.
build(pt, phi, cotTheta, tip, zip, chi2,
150 charge, hits, theField);
157 float radius,
float phi,
float d0,
float&
zip)
const
162 float phi1 = 2*asin(0.5*(inner - IP).
perp()/radius);
163 float phi2 = 2*asin(0.5*(outer - IP).
perp()/radius);
165 float dr = radius*(phi2 - phi1);
166 float dz = outer.
z()-inner.
z();
169 zip = (inner.
z()*phi2 - outer.
z()*phi1)/(phi2 - phi1);
171 return (fabs(dr) > 1.e-3) ? dz/dr : 0;
180 if (charge>0) phiC = atan2(xC,-yC);
181 else phiC = atan2(-xC,yC);
188 (
float d0,
float curv,
192 float rho3 = curv*curv*curv;
195 double phi1 = r1*curv/2 + inner.
perp2()*r1*rho3/48.;
198 double phi2 = r2*curv/2 + outer.
perp2()*r2*rho3/48.;
200 double z1 = inner.
z();
201 double z2 = outer.
z();
203 return z1 - phi1/(phi1-phi2)*(z1-z2);
208 (
float pt,
float eta,
float & errTip,
float & errZip)
const
210 float coshEta = cosh(eta);
215 float s_ms2 = c_ms*c_ms / (pt*
pt) * coshEta;
217 errTip =
sqrt(s_le*s_le + s_ms2 );
224 errZip =
sqrt( (s_le*s_le + c_ms*c_ms/(pt*pt)) * coshEta*coshEta*coshEta);
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
void getErrTipAndErrZip(float pt, float eta, float &errZip, float &errTip) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T inversePt(T curvature, const edm::EventSetup &iSetup)
float getZip(float d0, float curv, const GlobalPoint &inner, const GlobalPoint &outer) const
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
float getCotThetaAndUpdateZip(const GlobalPoint &inner, const GlobalPoint &outer, float radius, float phi, float d0, float &zip) const
int getCharge(int phi1, int phi2, int phi3, int phi4, int mode)
T y() const
Cartesian y coordinate.
T const * product() const
Geom::Phi< T > phi() const
T perp() const
Magnitude of transverse component.
TrackFitter(const edm::ParameterSet &cfg)
#define declareDynArray(T, n, x)
float getPhi(float xC, float yC, int charge) const
T x() const
Cartesian x coordinate.
virtual reco::Track * run(const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion ®ion) const