5 #include "CLHEP/Units/PhysicalConstants.h" 11 if( !(nPar==4 || nPar==5) )
throw cms::Exception(
"IncorrectInput") <<
"Not a valid nPar option!";
13 double trk_bendchi2 = 0.0;
14 double bend_resolution = 0.483;
15 float speedOfLightConverted = CLHEP::c_light/1.0E5;
18 float trk_signedPt = speedOfLightConverted*mMagneticFieldStrength/aTrack.
getRInv(nPar);
22 int nStubs = stubRefs.size();
24 for (
const auto& stubRef : stubRefs) {
25 DetId detIdStub = theTrackerGeom->
idToDet( (stubRef->getClusterRef(0))->getDetId() )->geographicalId();
26 MeasurementPoint coords = stubRef->getClusterRef(0)->findAverageLocalCoordinatesCentered();
30 float stub_r = posStub.
perp();
31 float stub_z = posStub.
z();
41 float stripPitch = topo.
pitch().first;
47 float sensorSpacing =
sqrt((modMaxR-modMinR)*(modMaxR-modMinR) + (modMaxZ-modMinZ)*(modMaxZ-modMinZ));
50 bool tiltedBarrel = (isBarrel && tTopo->
tobSide(detIdStub)!=3);
51 float gradient = 0.886454;
52 float intercept = 0.504148;
54 if (tiltedBarrel) correction = gradient*fabs(stub_z)/stub_r + intercept;
55 else if (isBarrel) correction = 1;
56 else correction = fabs(stub_z)/stub_r;
58 float stubBend = stubRef->getTriggerBend();
59 if (!isBarrel && stub_z<0.0) stubBend=-stubBend;
61 float trackBend = -(sensorSpacing*stub_r*mMagneticFieldStrength*(speedOfLightConverted/2))/(stripPitch*trk_signedPt*correction);
62 float bendDiff = trackBend-stubBend;
64 trk_bendchi2 += (bendDiff*bendDiff)/(bend_resolution*bend_resolution);
67 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
bool isBarrel(GeomDetEnumerators::SubDetector m)
std::vector< edm::Ref< edmNew::DetSetVector< TTStub< T > >, TTStub< T > > > getStubRefs() const
Track components.
virtual std::pair< float, float > pitch() const =0
const Plane & surface() const
The nominal surface of the GeomDet.
DetId partnerDetId(const DetId &id) const
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) ...
Class to store the L1 Track Trigger tracks.
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
float getConsistency(TTTrack< Ref_Phase2TrackerDigi_ > aTrack, const TrackerGeometry *theTrackerGeom, const TrackerTopology *tTopo, double mMagneticFieldStrength, int nPar)