15 throw cms::Exception(
"IncorrectInput") <<
"Not a valid nPar option!";
17 double trk_bendchi2 = 0.0;
18 double bend_resolution = 0.483;
20 float speedOfLightConverted = CLHEP::c_light / 1.0E5;
24 float trk_signedPt = speedOfLightConverted * mMagneticFieldStrength / aTrack.
getRInv(
nPar);
28 int nStubs = stubRefs.size();
30 for (
const auto& stubRef : stubRefs) {
31 DetId detIdStub = theTrackerGeom->
idToDet((stubRef->clusterRef(0))->getDetId())->geographicalId();
32 MeasurementPoint coords = stubRef->clusterRef(0)->findAverageLocalCoordinatesCentered();
36 float stub_r = posStub.
perp();
37 float stub_z = posStub.
z();
47 float stripPitch = topo.
pitch().first;
53 float sensorSpacing =
sqrt((modMaxR - modMinR) * (modMaxR - modMinR) + (modMaxZ - modMinZ) * (modMaxZ - modMinZ));
56 bool tiltedBarrel = (isBarrel && tTopo->
tobSide(detIdStub) != 3);
57 float gradient = 0.886454;
58 float intercept = 0.504148;
61 correction = gradient * fabs(stub_z) / stub_r + intercept;
65 correction = fabs(stub_z) / stub_r;
67 float stubBend = stubRef->bendFE();
68 if (!isBarrel && stub_z < 0.0)
71 float trackBend = -(sensorSpacing * stub_r * mMagneticFieldStrength * (speedOfLightConverted / 2)) /
73 float bendDiff = trackBend - stubBend;
75 trk_bendchi2 += (bendDiff * bendDiff) / (bend_resolution * bend_resolution);
78 float bendchi2 = trk_bendchi2 / nStubs;
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
double getRInv(unsigned int npar=Npars4) const
virtual const Topology & topology() const
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > getStubRefs() const
Track components.
const Plane & surface() const
The nominal surface of the GeomDet.
DetId partnerDetId(const DetId &id) const
virtual std::pair< float, float > pitch() const =0
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const Surface::PositionType & position() const
The position (origin of the R.F.)
unsigned int tobSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const TrackerGeomDet * idToDet(DetId) const override
Basic3DVector unit() const