15 inline constexpr
T square(
const T&
x ) {
return x*
x; }
20 f0 =
new TF1(
"f0",
"pol1",0,10);
21 f0->SetParameter(0,0.0163943);
22 f0->SetParameter(1,0.0192931);
24 f1 =
new TF1(
"f1",
"pol2",0,10);
25 f1->SetParameter(0,0.0119384);
26 f1->SetParameter(1,0.0253197);
27 f1->SetParameter(2,0.0404213);
29 f2 =
new TF1(
"f2",
"pol2",0,10);
30 f2->SetParameter(0,0.0107316);
31 f2->SetParameter(1,0.0294968);
32 f2->SetParameter(2,0.0414098);
35 fz0 =
new TF1(
"fz0",
"pol2",-2,2);
36 fz0->SetParameter(0,0.0520278);
37 fz0->SetParameter(1,-0.00578699);
38 fz0->SetParameter(2,0.0156972);
40 fz1 =
new TF1(
"fz1",
"pol4",-2,2);
41 fz1->SetParameter(0,0.0383233);
42 fz1->SetParameter(1,-0.00577128);
43 fz1->SetParameter(2,0.0770914);
44 fz1->SetParameter(3,-0.0818139);
45 fz1->SetParameter(4,0.050305);
47 fz2 =
new TF1(
"fz2",
"pol2",-2,2);
48 fz2->SetParameter(0,0.0371611);
49 fz2->SetParameter(1,-0.000694558);
50 fz2->SetParameter(2,0.0437917);
52 fmm_55_2 =
new TF1(
"fmm_55_2",
"pol2",-2,2);
54 fmm_55_2->SetParameter(1,-0.000177174);
57 fmm_56_2 =
new TF1(
"fmm_56_2",
"pol2",-2,2);
58 fmm_56_2->SetParameter(0,0.00363897);
62 fmm_3 =
new TF1(
"fmm_3",
"pol2",-2,2);
63 fmm_3->SetParameter(0,0.00305396);
64 fmm_3->SetParameter(1,0.00505814);
65 fmm_3->SetParameter(2,0.0395137);
67 fadcz0 =
new TF1(
"fadcz0",
"pol5",0,20000);
68 fadcz0->SetParameter(0,2.08854);
69 fadcz0->SetParameter(1,-0.0536847);
70 fadcz0->SetParameter(2,0.000989393);
71 fadcz0->SetParameter(3,-9.54492
e-06);
72 fadcz0->SetParameter(4,4.42178
e-08);
73 fadcz0->SetParameter(5,-7.79669
e-11);
75 fadcz1 =
new TF1(
"fadcz1",
"pol5",0,20000);
76 fadcz1->SetParameter(0,2.35278);
77 fadcz1->SetParameter(1,-0.0535903);
78 fadcz1->SetParameter(2,0.00088052);
79 fadcz1->SetParameter(3,-7.75203
e-06);
80 fadcz1->SetParameter(4,3.35361
e-08);
81 fadcz1->SetParameter(5,-5.61371
e-11);
83 fadcz2 =
new TF1(
"fadcz2",
"pol5",0,20000);
84 fadcz2->SetParameter(0,2.53191);
85 fadcz2->SetParameter(1,-0.062285);
86 fadcz2->SetParameter(2,0.00103893);
87 fadcz2->SetParameter(3,-9.18354
e-06);
88 fadcz2->SetParameter(4,3.9802
e-08);
89 fadcz2->SetParameter(5,-6.67137
e-11);
91 fadcz0fine =
new TF1(
"fadcz0fine",
"[0]+([1]/pow(x-[2],2))",0,20000);
96 fadcz1fine =
new TF1(
"fadcz1fine",
"[0]+([1]/pow(x-[2],2))",0,20000);
101 fadcz2fine =
new TF1(
"fadcz2fine",
"[0]+([1]/pow(x-[2],2))",0,20000);
107 fadcphi0 =
new TF1(
"fadcphi0",
"pol4",0,20000);
109 fadcphi0->SetParameter(1, -0.0306044);
110 fadcphi0->SetParameter(2,0.000355984);
120 fadcphi1 =
new TF1(
"fadcphi1",
"pol4",0,20000);
122 fadcphi1->SetParameter(1,-0.0369604);
123 fadcphi1->SetParameter(2,0.00042828);
134 fadcphi2 =
new TF1(
"fadcphi2",
"pol5",0,20000);
136 fadcphi2->SetParameter(1,-0.0474362);
137 fadcphi2->SetParameter(2,0.000717789);
153 f0fine =
new TF1(
"f0fine",
"pol2",0,20000);
154 f0fine->SetParameter(0,0.98611);
155 f0fine->SetParameter(1,-0.169505);
156 f0fine->SetParameter(2,1.12907);
158 f1fine =
new TF1(
"f1fine",
"pol3",0,20000);
159 f1fine->SetParameter(0,0.968625);
160 f1fine->SetParameter(1,-0.38894);
161 f1fine->SetParameter(2,3.36493);
162 f1fine->SetParameter(3,-6.72275);
171 f2fine =
new TF1(
"f2fine",
"pol5",0,20000);
172 f2fine->SetLineColor(kBlue);
173 f2fine->SetParameter(0,1.14119);
174 f2fine->SetParameter(1,-2.81483);
175 f2fine->SetParameter(2,19.1877);
176 f2fine->SetParameter(3,-57.214);
177 f2fine->SetParameter(4,72.2359);
178 f2fine->SetParameter(5,-20.3802);
180 fz0fine =
new TF1(
"fz0fine",
"pol2",0,20000);
181 fz0fine->SetParameter(0,0.96933);
182 fz0fine->SetParameter(1,-0.0458534);
183 fz0fine->SetParameter(2,0.231419);
185 fz1fine =
new TF1(
"fz1fine",
"pol3",0,20000);
186 fz1fine->SetParameter(0,0.886262);
187 fz1fine->SetParameter(1,-0.0818167);
188 fz1fine->SetParameter(2,0.805824);
189 fz1fine->SetParameter(3,-0.425423);
191 fz2fine =
new TF1(
"fz2fine",
"pol5",0,20000);
193 fz2fine->SetParameter(0,0.880153);
194 fz2fine->SetParameter(1,0.552461);
195 fz2fine->SetParameter(2,-2.57007);
196 fz2fine->SetParameter(3,7.509);
197 fz2fine->SetParameter(4,-9.23698);
198 fz2fine->SetParameter(5,4.23039);
200 static const double invsqrt12 = 1./std::sqrt(12);
483 if(layer==7||layer==22||layer==23||layer==38||layer==39){
496 if(phierror>0.1) phierror = 0.1;
497 if(phierror<0.0005) phierror = 0.1;
506 float R = TMath::Abs(1.0/qOverR);
507 double alpha = (r*
r) /(2*r*R);
508 double beta = TMath::Abs(atan(slope));
516 if(layer >=7 && layer < 23){
518 }
else if(layer>=23 && layer <39){
520 }
else if(layer>=39 && layer <55){
530 phierror =
f0->Eval(alpha);
533 phierror *= 0.54*0.9;
549 phierror *=
f0fine->Eval(alpha);
554 phierror =
f1->Eval(alpha);
575 phierror *=
f1fine->Eval(alpha);
582 phierror =
f2->Eval(alpha);
585 phierror *= 0.6*0.95;
601 phierror *=
f2fine->Eval(alpha);
604 if(layer==7)phierror *= (3*0.72);
605 if(layer==22||layer==23) phierror *= (3*0.8);
606 if(layer==38) phierror *= (3*0.9);
607 if(layer==39) phierror *= (3*1.05);
609 if(phierror>0.1) phierror = 0.1;
610 if(phierror<0.0005) phierror = 0.1;
615 double zerror = 0.05;
618 if(layer >=7 && layer < 23){
620 }
else if(layer>=23 && layer <39){
622 }
else if(layer>=39 && layer <55){
629 zerror =
fz0->Eval(beta);
639 zerror =
fz1->Eval(beta);
650 zerror =
fz2->Eval(beta);
659 if(layer==7) zerror *= (3.5*1.13);
660 if(layer==22) zerror *= (3.5*0.9);
661 if(layer==23) zerror *= (3.5*0.95);
662 if(layer==38) zerror *= (3.5*0.85);
664 if(zerror>0.2) zerror = 0.2;
665 if(zerror<0.0002) zerror = 0.2;
678 phierror =
fmm_3->Eval(alpha);
697 zerror =
fmm_3->Eval(beta);
707 static constexpr std::array<double, 7> scalefactors_mvtx_phi = {{ 0.36, 0.6,0.37,0.49,0.4,0.37,0.33 }};
728 static constexpr std::array<double, 7> scalefactors_mvtx_phi = {{ 0.36, 0.6,0.37,0.49,0.4,0.37,0.33 }};
750 static constexpr std::array<double, 4> scalefactors_z = {{ 0.47, 0.48, 0.71, 0.55 }};
761 static constexpr std::array<double, 4> scalefactors_z = {{ 0.47, 0.48, 0.71, 0.55 }};
771 static constexpr std::array<double, 3> scalefactors_intt_phi = {{ 0.85, 0.4, 0.33 }};
792 static constexpr std::array<double, 3> scalefactors_intt_phi = {{ 0.85, 0.4, 0.33 }};
857 if(phierror==0) phierror = 100;
858 if(zerror==0) zerror = 100;
870 if(cluster_r > 100000) alpha = 0.17001;
909 if(phierror==0) phierror = 100;
910 if(zerror==0) zerror = 100;
932 if(phierror==0) phierror = 100;
933 if(zerror==0) zerror = 100;
970 if(phierror==0) phierror = 100;
971 if(zerror==0) zerror = 100;