44 float dir = (points[1].x()-points[0].x())*(points[2].
y()-points[1].y())
45 - (points[1].
y()-points[0].y())*(points[2].
x()-points[1].x());
55 return (dir>0) ? -1 : 1;
60 float dz = outer.
z()-inner.
z();
64 inline float phi(
float xC,
float yC,
int charge) {
65 return (charge>0) ? std::atan2(xC,-yC) :
std::atan2(-xC,yC);
68 float zip(
float d0,
float phi_p,
float curv,
79 float rho2 = curv*curv;
80 float r1s = (pinner-pca).
perp2();
81 double phi1 =
std::sqrt(r1s)*(curv*0.5f)*(1.
f+r1s*(rho2*o24));
82 float r2s = (pouter-pca).
perp2();
83 double phi2 =
std::sqrt(r2s)*(curv*0.5f)*(1.
f+r2s*(rho2*o24));
84 double z1 = pinner.
z();
85 double z2 = pouter.
z();
88 return z1 - phi1/(phi1-phi2)*(z1-z2);
101 thescaleErrorsForBPix1(scaleErrorsForBPix1), thescaleFactor(scaleFactor)
110 const std::vector<const TrackingRecHit * > &
hits,
114 std::unique_ptr<reco::Track> ret;
116 int nhits = hits.size();
117 if (nhits <2)
return ret;
134 float valPhi, valTip, valPt;
136 int iCharge =
charge(points);
139 if ((curvature > 1.
e-4)&&
142 valPt = (invPt > 1.e-4
f) ? 1.
f/invPt : 1.e4f;
145 valPhi =
phi(center.
x(), center.
y(), iCharge);
151 valTip = -points[0].x()*
sin(valPhi) + points[0].y()*
cos(valPhi);
154 float valCotTheta = cotTheta(points[0],points[1]);
155 float valEta = std::asinh(valCotTheta);
156 float valZip =
zip(valTip, valPhi, curvature, points[0],points[1]);
163 float errFactor = 1.;
170 float errValPt = errFactor*param.
errPt();
171 float errValCot = errFactor*param.
errCot();
172 float errValTip = errFactor*param.
errTip();
173 float errValPhi = errFactor*param.
errPhi();
174 float errValZip = errFactor*param.
errZip();
180 chi2 = rzLine.
chi2();
190 ret.reset(builder.
build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits,
theField, region.
origin() ));
const MagneticField * theField
GlobalPoint const & origin() const
bool isBarrel(GeomDetEnumerators::SubDetector m)
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
def setup(process, global_tag, zero_tesla=False)
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
Abs< T >::type abs(const T &t)
T y() const
Cartesian y coordinate.
unsigned int pxbLayer(const DetId &id) const
constexpr float fhalfPi()
T perp2() const
Squared magnitude of transverse component.
TrackerTopology const * theTopo
std::unique_ptr< reco::Track > run(const std::vector< const TrackingRecHit * > &hits, const TrackingRegion ®ion, const edm::EventSetup &setup) const override
#define declareDynArray(T, n, x)
float fieldInInvGev(const edm::EventSetup &iSetup)
const bool thescaleErrorsForBPix1
const BasicVectorType & basicVector() const
T const * product() const
PixelFitterByHelixProjections(const edm::EventSetup *es, const MagneticField *field, bool scaleErrorsForBPix1, float scaleFactor)
T x() const
Cartesian x coordinate.
const float thescaleFactor