CMS 3D CMS Logo

L1MuonPixelTrackFitter.cc
Go to the documentation of this file.
2 
4 
12 
13 #include <cmath>
14 
15 template <class T>
16 T sqr(T t) {
17  return t * t;
18 }
19 
21  : theConfig(cfg),
22  invPtErrorScale{theConfig.getParameter<double>("invPtErrorScale")},
23  phiErrorScale{theConfig.getParameter<double>("phiErrorScale")},
24  cotThetaErrorScale{theConfig.getParameter<double>("cotThetaErrorScale")},
25  tipErrorScale{theConfig.getParameter<double>("tipErrorScale")},
26  zipErrorScale{theConfig.getParameter<double>("zipErrorScale")} {}
27 
29  thePhiL1 = muon.phiValue() + 0.021817;
30  theEtaL1 = muon.etaValue();
31  theChargeL1 = muon.charge();
32 }
33 
35  theHit1 = hits[0]->globalPosition();
36  theHit1 = hits[1]->globalPosition();
37 }
38 
40  const std::vector<const TrackingRecHit*>& hits,
41  const TrackingRegion& region) const {
43  es.get<IdealMagneticFieldRecord>().get(fieldESH);
44  const auto& field = *fieldESH;
45 
46  double phi_vtx_fromHits = (theHit2 - theHit1).phi();
47 
48  double invPt = valInversePt(phi_vtx_fromHits, thePhiL1, theEtaL1);
49  double invPtErr = errInversePt(invPt, theEtaL1);
50 
51  int charge = (invPt > 0.) ? 1 : -1;
52  double curvature = PixelRecoUtilities::curvature(invPt, field);
53 
54  Circle circle(theHit1, theHit2, curvature);
55 
56  double valPhi = this->valPhi(circle, charge);
57  double valTip = this->valTip(circle, curvature);
58  double valZip = this->valZip(curvature, theHit1, theHit2);
60 
61  // if ( (fabs(invPt)-0.1)/invPtErr > 3.) return 0;
62 
63  PixelTrackBuilder builder;
64  double valPt = (fabs(invPt) > 1.e-4) ? 1. / fabs(invPt) : 1.e4;
65  double errPt = invPtErrorScale * invPtErr * valPt * valPt;
66  double eta = asinh(valCotTheta);
67  double errPhi = this->errPhi(invPt, eta) * phiErrorScale;
68  double errCotTheta = this->errCotTheta(invPt, eta) * cotThetaErrorScale;
69  double errTip = this->errTip(invPt, eta) * tipErrorScale;
70  double errZip = this->errZip(invPt, eta) * zipErrorScale;
71 
72  Measurement1D pt(valPt, errPt);
77 
78  float chi2 = 0.;
79 
80  /*
81  std::ostringstream str;
82  str <<"\t ipt: " << invPt <<"+/-"<<invPtErr
83  <<"\t pt: " << pt.value() <<"+/-"<<pt.error()
84  <<"\t phi: " << phi.value() <<"+/-"<<phi.error()
85  <<"\t cot: " << cotTheta.value() <<"+/-"<<cotTheta.error()
86  <<"\t tip: " << tip.value() <<"+/-"<<tip.error()
87  <<"\t zip: " << zip.value() <<"+/-"<<zip.error()
88  <<"\t charge: " << charge;
89  std::cout <<str.str()<< std::endl;
90 */
91 
92  return builder.build(pt, phi, cotTheta, tip, zip, chi2, charge, hits, &field);
93 }
94 
95 double L1MuonPixelTrackFitter::valPhi(const Circle& circle, int charge) const {
96  Circle::Point zero(0., 0., 0.);
97  Circle::Vector center = circle.center() - zero;
98  long double radius = center.perp();
99  center /= radius;
100  Circle::Vector dir = center.cross(-charge * Circle::Vector(0., 0., 1.));
101  return dir.phi();
102 }
103 
104 double L1MuonPixelTrackFitter::errPhi(double invPt, double eta) const {
105  //
106  // sigma = p0+p1/|pt|;
107  //
108  double p0, p1;
109  int ieta = int(10 * fabs(eta));
110  switch (ieta) {
111  case 0: {
112  p0 = 0.000597506;
113  p1 = 0.00221057;
114  break;
115  }
116  case 1: {
117  p0 = 0.000591867;
118  p1 = 0.00278744;
119  break;
120  }
121  case 2: {
122  p0 = 0.000635666;
123  p1 = 0.00207433;
124  break;
125  }
126  case 3: {
127  p0 = 0.000619086;
128  p1 = 0.00255121;
129  break;
130  }
131  case 4: {
132  p0 = 0.000572067;
133  p1 = 0.00310618;
134  break;
135  }
136  case 5: {
137  p0 = 0.000596239;
138  p1 = 0.00288442;
139  break;
140  }
141  case 6: {
142  p0 = 0.000607608;
143  p1 = 0.00282996;
144  break;
145  }
146  case 7: {
147  p0 = 0.000606446;
148  p1 = 0.00281118;
149  break;
150  }
151  case 8: {
152  p0 = 0.000594076;
153  p1 = 0.00280546;
154  break;
155  }
156  case 9: {
157  p0 = 0.000579615;
158  p1 = 0.00335534;
159  break;
160  }
161  case 10: {
162  p0 = 0.000659546;
163  p1 = 0.00340443;
164  break;
165  }
166  case 11: {
167  p0 = 0.000659031;
168  p1 = 0.00343151;
169  break;
170  }
171  case 12: {
172  p0 = 0.000738391;
173  p1 = 0.00337297;
174  break;
175  }
176  case 13: {
177  p0 = 0.000798966;
178  p1 = 0.00330008;
179  break;
180  }
181  case 14: {
182  p0 = 0.000702997;
183  p1 = 0.00562643;
184  break;
185  }
186  case 15: {
187  p0 = 0.000973417;
188  p1 = 0.00312666;
189  break;
190  }
191  case 16: {
192  p0 = 0.000995213;
193  p1 = 0.00564278;
194  break;
195  }
196  case 17: {
197  p0 = 0.00121436;
198  p1 = 0.00572704;
199  break;
200  }
201  case 18: {
202  p0 = 0.00119216;
203  p1 = 0.00760204;
204  break;
205  }
206  case 19: {
207  p0 = 0.00141204;
208  p1 = 0.0093777;
209  break;
210  }
211  default: {
212  p0 = 0.00153161;
213  p1 = 0.00940265;
214  break;
215  }
216  }
217  return p0 + p1 * fabs(invPt);
218 }
219 
220 double L1MuonPixelTrackFitter::valCotTheta(const PixelRecoLineRZ& line) const { return line.cotLine(); }
221 
222 double L1MuonPixelTrackFitter::errCotTheta(double invPt, double eta) const {
223  //
224  // sigma = p0+p1/|pt|;
225  //
226  double p0, p1;
227  int ieta = int(10 * fabs(eta));
228  switch (ieta) {
229  case 0: {
230  p0 = 0.00166115;
231  p1 = 5.75533e-05;
232  break;
233  }
234  case 1: {
235  p0 = 0.00157525;
236  p1 = 0.000707437;
237  break;
238  }
239  case 2: {
240  p0 = 0.00122246;
241  p1 = 0.000325456;
242  break;
243  }
244  case 3: {
245  p0 = 0.000852422;
246  p1 = 0.000429216;
247  break;
248  }
249  case 4: {
250  p0 = 0.000637561;
251  p1 = 0.00122298;
252  break;
253  }
254  case 5: {
255  p0 = 0.000555766;
256  p1 = 0.00158096;
257  break;
258  }
259  case 6: {
260  p0 = 0.000641202;
261  p1 = 0.00143339;
262  break;
263  }
264  case 7: {
265  p0 = 0.000803207;
266  p1 = 0.000648816;
267  break;
268  }
269  case 8: {
270  p0 = 0.000741394;
271  p1 = 0.0015289;
272  break;
273  }
274  case 9: {
275  p0 = 0.000652019;
276  p1 = 0.00168873;
277  break;
278  }
279  case 10: {
280  p0 = 0.000716902;
281  p1 = 0.00257556;
282  break;
283  }
284  case 11: {
285  p0 = 0.000800409;
286  p1 = 0.00190563;
287  break;
288  }
289  case 12: {
290  p0 = 0.000808778;
291  p1 = 0.00264139;
292  break;
293  }
294  case 13: {
295  p0 = 0.000775757;
296  p1 = 0.00318478;
297  break;
298  }
299  case 14: {
300  p0 = 0.000705781;
301  p1 = 0.00460576;
302  break;
303  }
304  case 15: {
305  p0 = 0.000580679;
306  p1 = 0.00748248;
307  break;
308  }
309  case 16: {
310  p0 = 0.000561667;
311  p1 = 0.00767487;
312  break;
313  }
314  case 17: {
315  p0 = 0.000521626;
316  p1 = 0.0100178;
317  break;
318  }
319  case 18: {
320  p0 = 0.00064253;
321  p1 = 0.0106062;
322  break;
323  }
324  case 19: {
325  p0 = 0.000636868;
326  p1 = 0.0140047;
327  break;
328  }
329  default: {
330  p0 = 0.000682478;
331  p1 = 0.0163569;
332  break;
333  }
334  }
335  return p0 + p1 * fabs(invPt);
336 }
337 
338 double L1MuonPixelTrackFitter::valTip(const Circle& circle, double curvature) const {
339  Circle::Point zero(0., 0., 0.);
340  Circle::Vector center = circle.center() - zero;
341  long double radius = center.perp();
342  return radius - 1. / fabs(curvature);
343 }
344 
345 double L1MuonPixelTrackFitter::errTip(double invPt, double eta) const {
346  //
347  // sigma = p0+p1/|pt|;
348  //
349  double p0, p1;
350  int ieta = int(10 * fabs(eta));
351  switch (ieta) {
352  case 0: {
353  p0 = 0.00392416;
354  p1 = 0.00551809;
355  break;
356  }
357  case 1: {
358  p0 = 0.00390391;
359  p1 = 0.00543244;
360  break;
361  }
362  case 2: {
363  p0 = 0.0040651;
364  p1 = 0.00406496;
365  break;
366  }
367  case 3: {
368  p0 = 0.00387782;
369  p1 = 0.00797637;
370  break;
371  }
372  case 4: {
373  p0 = 0.00376798;
374  p1 = 0.00866894;
375  break;
376  }
377  case 5: {
378  p0 = 0.0042131;
379  p1 = 0.00462184;
380  break;
381  }
382  case 6: {
383  p0 = 0.00392579;
384  p1 = 0.00784685;
385  break;
386  }
387  case 7: {
388  p0 = 0.00370472;
389  p1 = 0.00790174;
390  break;
391  }
392  case 8: {
393  p0 = 0.00364433;
394  p1 = 0.00928368;
395  break;
396  }
397  case 9: {
398  p0 = 0.00387578;
399  p1 = 0.00640431;
400  break;
401  }
402  case 10: {
403  p0 = 0.00382464;
404  p1 = 0.00960763;
405  break;
406  }
407  case 11: {
408  p0 = 0.0038907;
409  p1 = 0.0104562;
410  break;
411  }
412  case 12: {
413  p0 = 0.00392525;
414  p1 = 0.0106442;
415  break;
416  }
417  case 13: {
418  p0 = 0.00400634;
419  p1 = 0.011218;
420  break;
421  }
422  case 14: {
423  p0 = 0.0036229;
424  p1 = 0.0156403;
425  break;
426  }
427  case 15: {
428  p0 = 0.00444317;
429  p1 = 0.00832987;
430  break;
431  }
432  case 16: {
433  p0 = 0.00465492;
434  p1 = 0.0179908;
435  break;
436  }
437  case 17: {
438  p0 = 0.0049652;
439  p1 = 0.0216647;
440  break;
441  }
442  case 18: {
443  p0 = 0.0051395;
444  p1 = 0.0233692;
445  break;
446  }
447  case 19: {
448  p0 = 0.0062917;
449  p1 = 0.0262175;
450  break;
451  }
452  default: {
453  p0 = 0.00714444;
454  p1 = 0.0253856;
455  break;
456  }
457  }
458  return p0 + p1 * fabs(invPt);
459 }
460 
461 double L1MuonPixelTrackFitter::valZip(double curv, const GlobalPoint& pinner, const GlobalPoint& pouter) const {
462  //
463  // phi = asin(r*rho/2) with asin(x) ~= x+x**3/(2*3)
464  //
465  double rho3 = curv * curv * curv;
466  double r1 = pinner.perp();
467  double phi1 = r1 * curv / 2 + pinner.perp2() * r1 * rho3 / 48.;
468  double r2 = pouter.perp();
469  double phi2 = r2 * curv / 2 + pouter.perp2() * r2 * rho3 / 48.;
470  double z1 = pinner.z();
471  double z2 = pouter.z();
472 
473  return z1 - phi1 / (phi1 - phi2) * (z1 - z2);
474 }
475 
476 double L1MuonPixelTrackFitter::errZip(double invPt, double eta) const {
477  //
478  // sigma = p0+p1/pt;
479  //
480  double p0, p1;
481  int ieta = int(10 * fabs(eta));
482  switch (ieta) {
483  case 0: {
484  p0 = 0.0120743;
485  p1 = 0;
486  break;
487  }
488  case 1: {
489  p0 = 0.0110343;
490  p1 = 0.0051199;
491  break;
492  }
493  case 2: {
494  p0 = 0.00846487;
495  p1 = 0.00570084;
496  break;
497  }
498  case 3: {
499  p0 = 0.00668726;
500  p1 = 0.00331165;
501  break;
502  }
503  case 4: {
504  p0 = 0.00467126;
505  p1 = 0.00578239;
506  break;
507  }
508  case 5: {
509  p0 = 0.0043042;
510  p1 = 0.00598517;
511  break;
512  }
513  case 6: {
514  p0 = 0.00515392;
515  p1 = 0.00495422;
516  break;
517  }
518  case 7: {
519  p0 = 0.0060843;
520  p1 = 0.00320512;
521  break;
522  }
523  case 8: {
524  p0 = 0.00564942;
525  p1 = 0.00478876;
526  break;
527  }
528  case 9: {
529  p0 = 0.00532111;
530  p1 = 0.0073239;
531  break;
532  }
533  case 10: {
534  p0 = 0.00579429;
535  p1 = 0.00952782;
536  break;
537  }
538  case 11: {
539  p0 = 0.00614229;
540  p1 = 0.00977795;
541  break;
542  }
543  case 12: {
544  p0 = 0.00714661;
545  p1 = 0.00550482;
546  break;
547  }
548  case 13: {
549  p0 = 0.0066593;
550  p1 = 0.00999362;
551  break;
552  }
553  case 14: {
554  p0 = 0.00634922;
555  p1 = 0.0148156;
556  break;
557  }
558  case 15: {
559  p0 = 0.00600586;
560  p1 = 0.0318022;
561  break;
562  }
563  case 16: {
564  p0 = 0.00676919;
565  p1 = 0.027456;
566  break;
567  }
568  case 17: {
569  p0 = 0.00670066;
570  p1 = 0.0317005;
571  break;
572  }
573  case 18: {
574  p0 = 0.00752392;
575  p1 = 0.0347714;
576  break;
577  }
578  case 19: {
579  p0 = 0.00791425;
580  p1 = 0.0566665;
581  break;
582  }
583  default: {
584  p0 = 0.00882372;
585  p1 = 0.0596858;
586  break;
587  }
588  }
589  return p0 + p1 * fabs(invPt);
590 }
591 
592 double L1MuonPixelTrackFitter::valInversePt(double phi0, double phiL1, double eta) const {
593  double result = 0.;
594 
595  // solve equtaion p3*result^3 + p1*result + dphi = 0;
596  // where: result = 1/pt
597  // dphi = phiL1 - phi0
598  // Cardan way is used
599 
600  double p1, p2, p3; //parameters p1,p3 are negative by parameter fix in fit!
601  param(eta, p1, p2, p3);
602 
603  double dphi = deltaPhi(phiL1, phi0); // phi0-phiL1
604  if (fabs(dphi) < 0.01) {
605  result = -dphi / p1;
606  } else {
607  double q = dphi / 2. / p3;
608  double p = p1 / 3. / p3; // positive
609  double D = q * q + p * p * p; // positive
610  double u = pow(-q + sqrt(D), 1. / 3.);
611  double v = -pow(q + sqrt(D), 1. / 3.);
612  result = u + v;
613  }
614  return result;
615 }
616 
617 double L1MuonPixelTrackFitter::errInversePt(double invPt, double eta) const {
618  //
619  // pt*sigma(1/pt) = p0+p1*pt;
620  //
621  double p0, p1;
622  int ieta = int(10 * fabs(eta));
623  switch (ieta) {
624  case 0: {
625  p0 = 0.0196835;
626  p1 = 0.00517533;
627  break;
628  }
629  case 1: {
630  p0 = 0.0266583;
631  p1 = 0.00478101;
632  break;
633  }
634  case 2: {
635  p0 = 0.0217164;
636  p1 = 0.00545425;
637  break;
638  }
639  case 3: {
640  p0 = 0.0197547;
641  p1 = 0.00552263;
642  break;
643  }
644  case 4: {
645  p0 = 0.0208778;
646  p1 = 0.00536009;
647  break;
648  }
649  case 5: {
650  p0 = 0.024192;
651  p1 = 0.00521709;
652  break;
653  }
654  case 6: {
655  p0 = 0.0265315;
656  p1 = 0.0051897;
657  break;
658  }
659  case 7: {
660  p0 = 0.0198071;
661  p1 = 0.00566822;
662  break;
663  }
664  case 8: {
665  p0 = 0.0361955;
666  p1 = 0.00486352;
667  break;
668  }
669  case 9: {
670  p0 = 0.037864;
671  p1 = 0.00509094;
672  break;
673  }
674  case 10: {
675  p0 = 0.0382968;
676  p1 = 0.00612354;
677  break;
678  }
679  case 11: {
680  p0 = 0.0308326;
681  p1 = 0.0074234;
682  break;
683  }
684  case 12: {
685  p0 = 0.0248577;
686  p1 = 0.00883049;
687  break;
688  }
689  case 13: {
690  p0 = 0.0279965;
691  p1 = 0.00888293;
692  break;
693  }
694  case 14: {
695  p0 = 0.0372582;
696  p1 = 0.00950252;
697  break;
698  }
699  case 15: {
700  p0 = 0.0281366;
701  p1 = 0.0111501;
702  break;
703  }
704  case 16: {
705  p0 = 0.0421483;
706  p1 = 0.0109413;
707  break;
708  }
709  case 17: {
710  p0 = 0.0461798;
711  p1 = 0.0125824;
712  break;
713  }
714  case 18: {
715  p0 = 0.0530603;
716  p1 = 0.0132638;
717  break;
718  }
719  case 19: {
720  p0 = 0.0601148;
721  p1 = 0.0147911;
722  break;
723  }
724  default: {
725  p0 = 0.0552377;
726  p1 = 0.0155574;
727  break;
728  }
729  }
730  return p1 + p0 * fabs(invPt);
731 }
732 
733 double L1MuonPixelTrackFitter::findPt(double phi0, double phiL1, double eta, int charge) const {
734  double dphi_min = fabs(deltaPhi(phi0, phiL1));
735  double pt_best = 1.;
736  double pt_cur = 1;
737  while (pt_cur < 10000.) {
738  double phi_exp = phi0 + getBending(1. / pt_cur, eta, charge);
739  double dphi = fabs(deltaPhi(phi_exp, phiL1));
740  if (dphi < dphi_min) {
741  pt_best = pt_cur;
742  dphi_min = dphi;
743  }
744  if (pt_cur < 10.)
745  pt_cur += 0.01;
746  else if (pt_cur < 20.)
747  pt_cur += 0.025;
748  else if (pt_cur < 100.)
749  pt_cur += 0.1;
750  else
751  pt_cur += 1;
752  };
753  return pt_best;
754 }
755 
756 double L1MuonPixelTrackFitter::getBending(double invPt, double eta, int charge) {
757  double p1, p2, p3;
758  param(eta, p1, p2, p3);
759  return charge * p1 * invPt + charge * p2 * invPt * invPt + charge * p3 * invPt * invPt * invPt;
760 }
761 
762 double L1MuonPixelTrackFitter::getBendingError(double invPt, double eta) {
763  int ieta = int(10 * fabs(eta));
764  double p0, p1;
765  switch (ieta) {
766  case 0: {
767  p0 = 0.0196835;
768  p1 = 0.00517533;
769  break;
770  }
771  case 1: {
772  p0 = 0.0266583;
773  p1 = 0.00478101;
774  break;
775  }
776  case 2: {
777  p0 = 0.0217164;
778  p1 = 0.00545425;
779  break;
780  }
781  case 3: {
782  p0 = 0.0197547;
783  p1 = 0.00552263;
784  break;
785  }
786  case 4: {
787  p0 = 0.0208778;
788  p1 = 0.00536009;
789  break;
790  }
791  case 5: {
792  p0 = 0.024192;
793  p1 = 0.00521709;
794  break;
795  }
796  case 6: {
797  p0 = 0.0265315;
798  p1 = 0.0051897;
799  break;
800  }
801  case 7: {
802  p0 = 0.0198071;
803  p1 = 0.00566822;
804  break;
805  }
806  case 8: {
807  p0 = 0.0361955;
808  p1 = 0.00486352;
809  break;
810  }
811  case 9: {
812  p0 = 0.037864;
813  p1 = 0.00509094;
814  break;
815  }
816  case 10: {
817  p0 = 0.0382968;
818  p1 = 0.00612354;
819  break;
820  }
821  case 11: {
822  p0 = 0.0308326;
823  p1 = 0.0074234;
824  break;
825  }
826  case 12: {
827  p0 = 0.0248577;
828  p1 = 0.00883049;
829  break;
830  }
831  case 13: {
832  p0 = 0.0279965;
833  p1 = 0.00888293;
834  break;
835  }
836  case 14: {
837  p0 = 0.0372582;
838  p1 = 0.00950252;
839  break;
840  }
841  case 15: {
842  p0 = 0.0281366;
843  p1 = 0.0111501;
844  break;
845  }
846  case 16: {
847  p0 = 0.0421483;
848  p1 = 0.0109413;
849  break;
850  }
851  case 17: {
852  p0 = 0.0461798;
853  p1 = 0.0125824;
854  break;
855  }
856  case 18: {
857  p0 = 0.0530603;
858  p1 = 0.0132638;
859  break;
860  }
861  case 19: {
862  p0 = 0.0601148;
863  p1 = 0.0147911;
864  break;
865  }
866  default: {
867  p0 = 0.0552377;
868  p1 = 0.0155574;
869  break;
870  }
871  }
872  return p0 + p1 * sqr(invPt);
873 }
874 
875 void L1MuonPixelTrackFitter::param(double eta, double& p1, double& p2, double& p3) {
876  int ieta = int(10 * fabs(eta));
877  switch (ieta) {
878  case 0: {
879  p1 = -2.68016;
880  p2 = 0;
881  p3 = -12.9653;
882  break;
883  }
884  case 1: {
885  p1 = -2.67864;
886  p2 = 0;
887  p3 = -12.0036;
888  break;
889  }
890  case 2: {
891  p1 = -2.72997;
892  p2 = 0;
893  p3 = -10.3468;
894  break;
895  }
896  case 3: {
897  p1 = -2.68836;
898  p2 = 0;
899  p3 = -12.3369;
900  break;
901  }
902  case 4: {
903  p1 = -2.66885;
904  p2 = 0;
905  p3 = -11.589;
906  break;
907  }
908  case 5: {
909  p1 = -2.64932;
910  p2 = 0;
911  p3 = -12.7176;
912  break;
913  }
914  case 6: {
915  p1 = -2.64513;
916  p2 = 0;
917  p3 = -11.3912;
918  break;
919  }
920  case 7: {
921  p1 = -2.64487;
922  p2 = 0;
923  p3 = -9.83239;
924  break;
925  }
926  case 8: {
927  p1 = -2.58875;
928  p2 = 0;
929  p3 = -10.0541;
930  break;
931  }
932  case 9: {
933  p1 = -2.5551;
934  p2 = 0;
935  p3 = -9.75757;
936  break;
937  }
938  case 10: {
939  p1 = -2.55294;
940  p2 = 0;
941  p3 = -7.25238;
942  break;
943  }
944  case 11: {
945  p1 = -2.45333;
946  p2 = 0;
947  p3 = -7.966;
948  break;
949  }
950  case 12: {
951  p1 = -2.29283;
952  p2 = 0;
953  p3 = -7.03231;
954  break;
955  }
956  case 13: {
957  p1 = -2.13167;
958  p2 = 0;
959  p3 = -4.29182;
960  break;
961  }
962  case 14: {
963  p1 = -1.9102;
964  p2 = 0;
965  p3 = -3.21295;
966  break;
967  }
968  case 15: {
969  p1 = -1.74552;
970  p2 = 0;
971  p3 = -0.531827;
972  break;
973  }
974  case 16: {
975  p1 = -1.53642;
976  p2 = 0;
977  p3 = -1.74057;
978  break;
979  }
980  case 17: {
981  p1 = -1.39446;
982  p2 = 0;
983  p3 = -1.56819;
984  break;
985  }
986  case 18: {
987  p1 = -1.26176;
988  p2 = 0;
989  p3 = -0.598631;
990  break;
991  }
992  case 19: {
993  p1 = -1.14133;
994  p2 = 0;
995  p3 = -0.0941055;
996  break;
997  }
998  default: {
999  p1 = -1.02086;
1000  p2 = 0;
1001  p3 = -0.100491;
1002  break;
1003  }
1004  }
1005 }
1006 
1007 double L1MuonPixelTrackFitter::deltaPhi(double phi1, double phi2) const {
1008  while (phi1 >= 2 * M_PI)
1009  phi1 -= 2 * M_PI;
1010  while (phi2 >= 2 * M_PI)
1011  phi2 -= 2 * M_PI;
1012  while (phi1 < 0)
1013  phi1 += 2 * M_PI;
1014  while (phi2 < 0)
1015  phi2 += 2 * M_PI;
1016  double dPhi = phi2 - phi1;
1017 
1018  if (dPhi > M_PI)
1019  dPhi -= 2 * M_PI;
1020  if (dPhi < -M_PI)
1021  dPhi += 2 * M_PI;
1022 
1023  return dPhi;
1024 }
double valInversePt(double phi0, double phiL1, double eta) const
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T perp() const
Definition: PV3DBase.h:69
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
void setPxConstraint(const SeedingHitSet &hits)
T z() const
Definition: PV3DBase.h:61
double errInversePt(double invPt, double eta) const
static double getBendingError(double invPt, double eta)
T curvature(T InversePt, const MagneticField &field)
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 sqr(T t)
double errTip(double invPt, double eta) const
static void param(double eta, double &p1, double &p2, double &p3)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
T sqrt(T t)
Definition: SSEVec.h:19
double valTip(const Circle &c, double curvature) const
virtual reco::Track * run(const edm::EventSetup &es, const std::vector< const TrackingRecHit *> &hits, const TrackingRegion &region) const
T get() const
Definition: EventSetup.h:82
static double getBending(double invPt, double eta, int charge)
double errCotTheta(double invPt, double eta) const
double deltaPhi(double phi1, double phi2) const
#define M_PI
double valZip(double curvature, const GlobalPoint &p0, const GlobalPoint &p1) const
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
T perp2() const
Definition: PV3DBase.h:68
double errPhi(double invPt, double eta) const
double errZip(double invPt, double eta) const
double findPt(double phi0, double phiL1, double eta, int charge) const
void setL1Constraint(const L1MuGMTCand &muon)
long double T
L1MuonPixelTrackFitter(const edm::ParameterSet &cfg)
double valPhi(const Circle &c, int charge) const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
double valCotTheta(const PixelRecoLineRZ &line) const