25 double p3,
double p4,
double p5,
double p6) {
44 double ptGev = feature->
pt();
45 double pt = ptGev*1000.;
47 if (
pt == 0)
return 1.0e33;
49 double AbsPtInv = fabs(1./
pt);
52 double phi = feature->
phi();
55 if (AbsPtInv < 0.000186) {
56 return vec[0]*AbsPtInv +
vec[1]/1000.;
59 double AbsPtInv3 = AbsPtInv*AbsPtInv*AbsPtInv;
60 double AbsPtInv2 = AbsPtInv*AbsPtInv;
61 return vec[2]*AbsPtInv3/(1000.*1000.) +
62 vec[3]*AbsPtInv2/(1000.) +
69 const int N_PARAMS = 5;
70 const double vparEC1[N_PARAMS] = {0.291483, -6.11348, 65.1099, -285.664, 440.041};
71 const double vparEC2[N_PARAMS] = {0.286307, -4.6759, 43.2815, -163.185, 210.786};
72 const double vparEC3[N_PARAMS] = {0.330699, -6.70755, 70.4725, -291.85, 408.739};
73 const double vparEC4[N_PARAMS] = {0.261738, -4.69971, 47.4762, -183.98, 236.813};
74 const double vparEC5[N_PARAMS] = {0.196301, -3.57276, 38.3744, -159.808, 228.256};
75 const double vparEC6[N_PARAMS] = {0.172939, -3.10788, 33.3823, -142.996, 212.957};
76 const double vparEC7[N_PARAMS] = {0.233017, -4.377, 42.5691, -171.752, 245.702};
77 const double vparEC8[N_PARAMS] = {0.22389, -4.16259, 40.1369, -162.824, 236.39};
78 const double vparEC9[N_PARAMS] = {0.197992, -3.52117, 33.5997, -136.014, 197.474};
79 const double vparECA[N_PARAMS] = {0.417289, -0.852254,-31.9257, 308.873, -719.591};
80 const double vparECB[N_PARAMS] = {0.526612, -8.04087, 82.1906, -336.87, 462.973};
82 double AbsPtInvGeV = AbsPtInv * 1000;
84 const double AbsPtInvGeVMin = 5
e-3;
85 const double AbsPtInvGeVMax = 0.25;
86 if( AbsPtInvGeV < AbsPtInvGeVMin ) AbsPtInvGeV = AbsPtInvGeVMin;
87 if( AbsPtInvGeV > AbsPtInvGeVMax ) AbsPtInvGeV = AbsPtInvGeVMax;
94 if ( spReg==1 ) { vpar = vparECA; }
95 else if( spReg==2 ) { vpar = vparECB; }
97 if (
AbsEta < 1.20) { vpar = vparEC1; }
98 else if(
AbsEta < 1.35) { vpar = vparEC2; }
99 else if(
AbsEta < 1.50) { vpar = vparEC3; }
100 else if(
AbsEta < 1.65) { vpar = vparEC4; }
101 else if(
AbsEta < 1.80) { vpar = vparEC5; }
102 else if(
AbsEta < 1.95) { vpar = vparEC6; }
103 else if(
AbsEta < 2.10) { vpar = vparEC7; }
104 else if(
AbsEta < 2.35) { vpar = vparEC8; }
105 else { vpar = vparEC9; }
108 double fracRes = vpar[0] + vpar[1]*AbsPtInvGeV
109 + vpar[2]*AbsPtInvGeV*AbsPtInvGeV
110 + vpar[3]*AbsPtInvGeV*AbsPtInvGeV*AbsPtInvGeV
111 + vpar[4]*AbsPtInvGeV*AbsPtInvGeV*AbsPtInvGeV*AbsPtInvGeV;
113 return fabs(fracRes * AbsPtInv);
125 ( (0 <= fabs(phi) && fabs(phi) <
M_PI/48. ) ||
126 (
M_PI*11./48. <= fabs(phi) && fabs(phi) <
M_PI*13./48. ) ||
127 (
M_PI*23./48. <= fabs(phi) && fabs(phi) <
M_PI*25./48. ) ||
128 (
M_PI*35./48. <= fabs(phi) && fabs(phi) <
M_PI*37./48. ) ||
129 (
M_PI*47./48. <= fabs(phi) && fabs(phi) <
M_PI )
134 ( (
M_PI*3./32. <= fabs(phi) && fabs(phi) <
M_PI*5./32. ) ||
135 (
M_PI*11./32. <= fabs(phi) && fabs(phi) <
M_PI*13./32.) ||
136 (
M_PI*19./32. <= fabs(phi) && fabs(phi) <
M_PI*21./32.) ||
137 (
M_PI*27./32. <= fabs(phi) && fabs(phi) <
M_PI*29./32.)
190 double getIDSCANRes(std::vector<double> barrelvec, std::vector<double> ec1vec,
191 std::vector<double> ec2vec, std::vector<double> ec3vec, std::vector<double> ec4vec,
192 double pt_id,
double eta_id) {
195 if (
pt == 0)
return 1.0e33;
197 double AbsPtInv = fabs(1./
pt);
198 double AbsEta = fabs(eta_id);
200 std::vector<double>
vec;
201 if (
AbsEta < 1.05)
vec = std::move(barrelvec);
205 else vec = std::move(ec4vec);
207 return vec[0]*AbsPtInv+
vec[1]/1000.;
213 double pt = feature->
pt();
214 double eta = feature->
eta();
215 if (
pt < 4. )
pt = 4.;
216 if (
pt > 40.)
pt = 40.;
218 if (feature->
radius() <= 10.)
ts =
true;
220 if (fabs(eta) < 1.) {
221 return 7.75e-2/
pt + 8.1e-3;
225 if (fabs(eta) >= 1. && fabs(eta) < 1.2) {
226 return 2.0e-1/
pt + 1.5e-3;
228 else if (fabs(eta) >= 1.2 && fabs(eta) < 1.5) {
229 return 2.5e-1/
pt + 0.1e-3;
231 else if (fabs(eta) >= 1.5 && fabs(eta) < 2.0) {
232 return 1.3e-1/
pt + 6.0e-3;
235 return 1.3e-1/
pt + 8.0e-3;
239 if (fabs(eta) >= 1. && fabs(eta) < 1.6) {
240 return 0.071/
pt + 0.0055;
243 return 0.055/
pt + 0.0063;
252 double pt = feature->
pt();
253 double eta = feature->
eta();
254 if (
pt < 4. )
pt = 4.;
255 if (
pt > 40.)
pt = 40.;
257 if (feature->
radius() <= 10.)
ts =
true;
259 if (fabs(eta) < 1.) {
260 return 1.9e-1/
pt - 3.4e-4;
264 if (fabs(eta) >= 1. && fabs(eta) < 1.2) {
265 return 2.0e-1/
pt + 2.0e-3;
267 else if (fabs(eta) >= 1.2 && fabs(eta) < 1.5) {
268 return 1.8e-1/
pt + 3.0e-3;
270 else if (fabs(eta) >= 1.5 && fabs(eta) < 2.0) {
271 return 1.5e-1/
pt + 8.0e-3;
274 return 1.0e-1/
pt + 1.8e-2;
279 return 0.08/
pt + 0.0025;
292 if (
pt < 4. )
pt = 4.;
293 if (
pt > 40.)
pt = 40.;
299 if (fabs(eta) < 0.5) {
300 return 6.0e-3/(
pt*
pt) + 4.4
e-2/
pt + 1.2
e-2 + (-3.2
e-5*
pt);
302 else if (fabs(eta) >= 0.5 && fabs(eta) < 1.0) {
303 return 5.6e-3/(
pt*
pt) + 3.9
e-2/
pt + 1.3
e-2 + (-3.7
e-5*
pt);
305 else if (fabs(eta) >= 1.0 && fabs(eta) < 1.5) {
306 return 2.1e-1/(
pt*
pt) + 8.8
e-2/
pt + 7.1
e-4 + (1.7
e-4*
pt);
308 else if (fabs(eta) >= 1.5 && fabs(eta) < 2.0) {
309 return 4.5e-3/(
pt*
pt) + 1.4
e-2/
pt + 1.1
e-2 + (-5.7
e-5*
pt);
312 return 3.1e-2/(
pt*
pt) + 4.9
e-1/
pt + (-2.6
e-3) + (3.2e-5*
pt);
321 if (
pt < 4. )
pt = 4.;
322 if (
pt > 40.)
pt = 40.;
328 if (fabs(eta) < 0.5) {
329 return 4.1e-2/(
pt*
pt) + 1.5
e-1/
pt + 1.4
e-3 + (5.8
e-5*
pt);
331 else if (fabs(eta) >= 0.5 && fabs(eta) < 1.0) {
332 return 9.4e-3/(
pt*
pt) + 8.8
e-2/
pt + 1.1
e-2 + (-1.
e-4*
pt);
334 else if (fabs(eta) >= 1.0 && fabs(eta) < 1.5) {
335 return 3.5e-1/(
pt*
pt) + 9.4
e-2/
pt + 8.2
e-3 + (-3.3
e-7*
pt);
337 else if (fabs(eta) >= 1.5 && fabs(eta) < 2.0) {
338 return 2.6e-2/(
pt*
pt) + 1.2
e-1/
pt + 3.8
e-3 + (2.2
e-5*
pt);
341 return 2.7e-1/(
pt*
pt) + 3.2
e-2/
pt + (9.0
e-3) + (-2.6e-5*
pt);
346 double dphi = phi1 - phi2;
359 return sqrt(deta*deta + dphi*dphi);
363 if (sp1 != 0 && sp2 != 0)
return (sp2*sp2*fabs(
p1) + sp1*sp1*fabs(
p2))/(sp1*sp1 + sp2*sp2);
364 else if (sp1 != 0 && sp2 == 0)
return fabs(
p2);
365 else if (sp1 == 0 && sp2 != 0)
return fabs(
p1);
366 else return (fabs(
p1)+fabs(
p2))*0.5;
370 if (sp1 != 0 && sp2 != 0)
return sqrt((sp1*sp1*sp2*sp2)/(sp1*sp1 + sp2*sp2));
375 double eta1,
double seta1,
double phi1,
double sphi1,
double ipt1,
double sipt1,
376 double eta2,
double seta2,
double phi2,
double sphi2,
double ipt2,
double sipt2,
bool useAbsPt) {
379 double sdeta = seta1*seta1+seta2*seta2;
381 double sdphi = sphi1*sphi1+sphi2*sphi2;
382 double dipt_1 = ipt - ipt1;
383 if (useAbsPt) dipt_1 = fabs(ipt) - fabs(ipt1);
384 double sdipt_1 = sipt1*sipt1;
385 double dipt_2 = ipt - ipt2;
386 if (useAbsPt) dipt_2 = fabs(ipt) - fabs(ipt2);
387 double sdipt_2 = sipt2*sipt2;
391 if (sdeta != 0) {
chi2 += deta*deta/sdeta;
ndof++; }
392 if (sdphi != 0) {
chi2 += dphi*dphi/sdphi;
ndof++; }
393 if (sdipt_1 != 0) {
chi2 += dipt_1*dipt_1/sdipt_1;
ndof++; }
394 if (sdipt_2 != 0) {
chi2 += dipt_2*dipt_2/sdipt_2;
ndof++; }
396 if (
ndof == 0)
return 1.0e30;
402 double eta1,
double seta1,
double phi1,
double sphi1,
double qOvpt1,
double sqOvpt1,
403 double eta2,
double seta2,
double phi2,
double sphi2,
double qOvpt2,
double sqOvpt2,
bool useAbsPt) {
406 double sdeta = seta1*seta1+seta2*seta2;
408 double sdphi = sphi1*sphi1+sphi2*sphi2;
409 double dipt = qOvpt1 - qOvpt2;
410 if (useAbsPt) dipt = fabs(qOvpt1) - fabs(qOvpt2);
411 double sdipt = sqOvpt1*sqOvpt1+sqOvpt2*sqOvpt2;
415 if (sdeta != 0) {
chi2 += deta*deta/sdeta;
ndof++; }
416 if (sdphi != 0) {
chi2 += dphi*dphi/sdphi;
ndof++; }
417 if (sdipt != 0) {
chi2 += dipt*dipt/sdipt;
ndof++; }
419 if (
ndof == 0)
return 1.0e30;