1057{
1058 double cosbin[30] = {-0.865, -0.7, -0.5, -0.325, -0.225, -0.19, -0.17, -0.15, -0.13, -0.11, -0.09, -0.07, -0.05, -0.03, -0.01, 0.01, 0.03, 0.05, 0.07, 0.09, 0.11, 0.13, 0.15, 0.17, 0.19, 0.225, 0.325, 0.5, 0.7, 0.865};
1059 double corr_sigma = 1;
1060 if (
n == 0 ||
n == 1 ||
n == 2 &&
ptrk > 0.20 ||
n == 3 && (
ptrk > 0.43 ||
ptrk < 0.2 || fabs(cost) > 0.2) ||
n == 4 && (
ptrk > 0.43 ||
ptrk < 0.2))
1061 return 1;
1063 {
1064 int tmp = 0;
1065 double par_pip_sigma[30][8] = {
1066 {0.980745, -0.0320824, 0.148076, -0.0185231, -0.0287245, -0.0146609, 0.0291458, -0.0213545},
1067 {0.909279, 0.171988, 0.0389074, -0.0877263, 0.0104833, 0.0392911, -0.0306531, 0.00307295},
1068 {0.952309, 0.168354, 0.0100906, -0.0781473, 0.0874947, -0.0399515, -0.0040687, 0.0273449},
1069 {1.01305, 0.110082, 0.0356032, -0.0320006, 0.0398265, 0.00283998, -0.00353269, 0.0323046},
1070 {1.10214, -0.0464266, 0.0844326, -0.0133869, -0.0233443, 0.0470427, -0.0233875, 0.00796884},
1071 {1.13722, -0.0694168, 0.0810207, -0.00461111, -0.0657331, 0.0435981, -0.0305237, 0.000891762},
1072 {1.12494, -0.0402269, 0.039213, 0.0410197, -0.0849904, 0.0588127, -0.0110273, -0.0102289},
1073 {1.19926, -0.124029, 0.0915294, 0.0051942, -0.0546915, 0.0774849, -0.0186289, 0.00478784},
1074 {1.29678, -0.285694, 0.230571, -0.127148, 0.0295359, -0.0319002, 0.0336125, -0.0387693},
1075 {1.34107, -0.299083, 0.21921, -0.115439, 0.0098274, -0.0225279, 0.0177997, -0.0240218},
1076 {1.37443, -0.292003, 0.170567, -0.0571655, -0.0168999, 0.0336943, 0.00351935, -0.0213522},
1077 {1.53528, -0.469584, 0.286359, -0.136798, -0.0158706, -0.00297735, 0.00902674, -0.0365105},
1078 {1.76254, -0.697432, 0.422368, -0.120523, -0.070091, 0.094326, -0.030649, -0.0066399},
1079 {1.94569, -0.911353, 0.454219, 0.0156298, -0.319211, 0.379627, -0.238878, 0.0963599},
1080 {2.43193, -1.66075, 1.11878, -0.488709, 0.0340719, 0.160446, -0.0920272, 0.0514607},
1081 {2.0932, -1.05913, 0.580453, -0.0946158, -0.236143, 0.29226, -0.176364, 0.0320375},
1082 {1.92749, -0.929276, 0.553641, -0.170987, -0.098254, 0.135239, -0.075694, -0.0032753},
1083 {1.875, -0.988737, 0.679303, -0.365717, 0.0721803, 0.0117188, -0.00415287, -0.0189484},
1084 {1.58964, -0.578412, 0.43666, -0.221821, 0.051573, -0.00910371, 0.0148332, -0.036281},
1085 {1.37654, -0.303804, 0.192889, -0.0902226, -0.00981288, -0.0260383, 0.0428074, -0.0312006},
1086 {1.33936, -0.328366, 0.265274, -0.150611, 0.0536288, -0.0520476, 0.0561347, -0.0397721},
1087 {1.21193, -0.144586, 0.0934788, -0.0178466, -0.0531063, 0.0124997, 0.0153325, -0.0307769},
1088 {1.17235, -0.0870064, 0.0758076, 0.00109802, -0.0561468, 0.030234, 0.011407, -0.0287855},
1089 {1.16807, -0.127506, 0.118003, -0.0407013, -0.00810034, -0.00531038, 0.0271216, -0.0245021},
1090 {1.10302, -0.0128453, 0.0366757, 0.0430047, -0.0677478, 0.0658191, -0.0213085, 0.0231517},
1091 {1.09825, -0.0253014, 0.0807453, -0.0315216, -0.00550889, 0.0126133, 0.00452082, 0.00183966},
1092 {1.0199, 0.0937959, 0.0449512, -0.0539498, 0.0544941, -0.0364448, 0.0205853, 0.0103639},
1093 {0.964461, 0.159884, 0.0289211, -0.0837419, 0.0984221, -0.0551503, 0.00340403, 0.0213683},
1094 {0.92457, 0.159631, 0.0423011, -0.07931, 0.0114676, 0.0488719, -0.0348463, 0.00461647},
1095 {1.00597, -0.0291862, 0.131163, -0.03148, -0.024414, -0.039103, 0.0488831, -0.0346602}
1096 };
1097 while (cost >= cosbin[tmp] && tmp != 28)
1098 {
1099 tmp++;
1100 }
1101 if (tmp == 0)
1102 tmp += 1;
1103 double par_cos[8];
1104 for (int j = 0; j < 8; j++)
1105 {
1106 double cosbin_tmp[3] = {cosbin[tmp - 1], cosbin[tmp], cosbin[tmp + 1]};
1107 double par_pip_sigma_tmp[3] = {par_pip_sigma[tmp - 1][j], par_pip_sigma[tmp][j], par_pip_sigma[tmp + 1][j]};
1108 par_cos[j] =
interpolation(cost, cosbin_tmp, par_pip_sigma_tmp);
1109 }
1110 double ptrk_tmp = (
ptrk - 0.17) / 0.1;
1111 double corr_sigma = ROOT::Math::ChebyshevN(7, ptrk_tmp, par_cos);
1112 if (corr_sigma < 1)
1113 return 1;
1114 else
1115 return corr_sigma;
1116 }
1118 {
1119 double par_kp_sigma[3][5] = {
1120 {1.00, 1.00, 1.00, 1.00, 1.00},
1121 {1.80, 1.80, 1.51, 1.41, 1.00},
1122 {1.00, 1.00, 1.00, 1.00, 1.00}
1123 };
1124 double p_bin[6] = {0.175, 0.225, 0.275, 0.325, 0.375, 0.425};
1125 int bin_p = (
ptrk - 0.175) / 0.05;
1126 double int_p1 = (par_kp_sigma[0][bin_p] - par_kp_sigma[1][bin_p]) * fabs(cost) / 0.1 + par_kp_sigma[1][bin_p];
1127 double int_p2 = (par_kp_sigma[0][bin_p + 1] - par_kp_sigma[1][bin_p + 1]) * fabs(cost) / 0.1 + par_kp_sigma[1][bin_p + 1];
1128 corr_sigma = (int_p2 - int_p1) * (
ptrk - p_bin[bin_p]) + int_p1;
1129 return corr_sigma;
1130 }
1132 {
1133 int tmp = 0;
1134 double par_p_sigma[30][8] = {
1135 {0.794024, 0.0425693, 0.0236678, -0.0382406, 0.0695961, -0.0580967, 0.035697, -0.0135807},
1136 {0.832773, -0.00113245, -0.031817, 0.0606602, -0.0447306, -0.00903627, 0.025789, -0.0195913},
1137 {0.908858, -0.087108, 0.0549567, 0.00174534, -0.0270899, 0.0429156, -0.0280865, 0.0188789},
1138 {1.04046, -0.246353, 0.133491, -0.049544, 0.0180147, 0, 0, 0},
1139 {1.25697, -0.492783, 0.244496, -0.0930121, 0.0267921, 0, 0, 0},
1140 {1.40495, -0.656157, 0.341844, -0.13557, 0.0444445, 0, 0, 0},
1141 {1.48819, -0.722884, 0.375376, -0.133594, 0.0550627, 0, 0, 0},
1142 {1.73349, -1.02811, 0.545484, -0.22501, 0.0867905, 0, 0, 0},
1143 {1.86727, -1.11375, 0.566508, -0.209777, 0.0683113, 0, 0, 0},
1144 {2.17391, -1.50475, 0.78278, -0.317744, 0.0926452, 0, 0, 0},
1145 {2.4923, -1.78499, 0.944323, -0.412239, 0.144967, 0, 0, 0},
1146 {2.96861, -2.37577, 1.24553, -0.50482, 0.135875, 0, 0, 0},
1147 {3.31789, -2.67592, 1.3589, -0.552132, 0.210676, 0, 0, 0},
1148 {3.7896, -3.26956, 1.68685, -0.702016, 0.155152, 0, 0, 0},
1149 {3.86579, -3.22667, 1.54792, -0.607399, 0.174962, 0, 0, 0},
1150 {3.91034, -3.35332, 1.66152, -0.618642, 0.152329, 0, 0, 0},
1151 {3.33904, -2.66857, 1.27733, -0.460009, 0.0800364, 0, 0, 0},
1152 {2.97639, -2.27119, 1.1101, -0.410801, 0.120688, 0, 0, 0},
1153 {2.55881, -1.83093, 0.905367, -0.339415, 0.107886, 0, 0, 0},
1154 {2.34426, -1.713, 0.866848, -0.370726, 0.087723, 0, 0, 0},
1155 {1.98031, -1.24099, 0.640849, -0.232078, 0.0726222, 0, 0, 0},
1156 {1.74302, -0.984163, 0.490949, -0.172, 0.0443975, 0, 0, 0},
1157 {1.56317, -0.802742, 0.388115, -0.14842, 0.0359668, 0, 0, 0},
1158 {1.44037, -0.668254, 0.352312, -0.120142, 0.0549672, 0, 0, 0},
1159 {1.34493, -0.583195, 0.310501, -0.130395, 0.0447765, 0, 0, 0},
1160 {1.22836, -0.433327, 0.229097, -0.0728195, 0.022962, 0, 0, 0},
1161 {1.05117, -0.246895, 0.142671, -0.0529643, 0.016318, 0, 0, 0},
1162 {0.909469, -0.0691198, 0.0377954, 0.019234, -0.0322931, 0.0460066, -0.0270032, 0.02252},
1163 {0.843402, -0.0106399, -0.0217012, 0.0502854, -0.0341327, -0.0117776, 0.0292822, -0.0190088},
1164 {0.826268, -0.00178627, 0.0679738, -0.065918, 0.0696007, -0.0648257, 0.0328222, -0.00459817}
1165 };
1166 while (cost >= cosbin[tmp] && tmp != 28)
1167 {
1168 tmp++;
1169 }
1170 if (tmp == 0)
1171 tmp += 1;
1172 double par_cos[8];
1173 for (int j = 0; j < 8; j++)
1174 {
1175 double cosbin_tmp[3] = {cosbin[tmp - 1], cosbin[tmp], cosbin[tmp + 1]};
1176 double par_p_sigma_tmp[3] = {par_p_sigma[tmp - 1][j], par_p_sigma[tmp][j], par_p_sigma[tmp + 1][j]};
1177 par_cos[j] =
interpolation(cost, cosbin_tmp, par_p_sigma_tmp);
1178 }
1179 double ptrk_tmp = (
ptrk - 0.33) / 0.1;
1180 corr_sigma = ROOT::Math::ChebyshevN(7, ptrk_tmp, par_cos);
1181 if (corr_sigma < 1)
1182 return 1;
1183 else
1184 return corr_sigma;
1185 }
1186}