16 #define THIS_CLASS DTDriftTimeParametrization
21 #ifndef MB_DT_STANDALONE
26 #include "DataFormats/DTRecHit/interface/DTDriftTimeParameters.icc"
34 unsigned short i,
j, n_func, ial, iby, ibz;
35 unsigned short i_alpha, i_By, i_Bz;
36 unsigned short j_alpha, j_By, j_Bz;
43 double V_al[3], V_by[3], V_bz[3];
45 double DTV_v_drift[N_Func];
46 double DTV_t_drift[N_Func];
47 double DTV_delta_t[N_Func];
48 double DTV_t_width_m[N_Func];
49 double DTV_t_width_p[N_Func];
62 for (
j = 0;
j < N_Func;
j++) {
66 DTV_t_width_m[
j] = -1;
67 DTV_t_width_p[
j] = -1;
76 printf(
"*** ERROR, MB_DT_drift_time: invalid interpolate value = %d\n",
interpolate);
84 printf(
"\nMB_DT_drift_time: Function called with values:\n\n");
85 printf(
"MB_DT_drift_time: x = %f\n",
x);
86 printf(
"MB_DT_drift_time: alpha = %f\n",
alpha);
87 printf(
"MB_DT_drift_time: by = %f\n", by);
88 printf(
"MB_DT_drift_time: bz = %f\n", bz);
89 printf(
"MB_DT_drift_time: ifl = %d\n", ifl);
96 printf(
"*** ERROR, MB_DT_drift_time: invalid ifl value = %d\n", ifl);
100 dist = (ifl == 0) ?
x :
x - DT_Cell_HalfWidth;
116 printf(
"MB_DT_drift_time:\n");
117 printf(
"MB_DT_drift_time: i_alpha j_alpha alpha_value's %d %d %.0f %.0f\n",
123 "MB_DT_drift_time: i_By j_By By_value's %d %d %.2f %.2f\n", i_By, j_By,
By_value[i_By],
By_value[j_By]);
125 "MB_DT_drift_time: i_Bz j_Bz Bz_value's %d %d %.2f %.2f\n", i_Bz, j_Bz,
Bz_value[i_Bz],
Bz_value[j_Bz]);
130 for (
j = 0;
j < n_func;
j++) {
131 ial = (
j & 4) ? j_alpha : i_alpha;
132 iby = (
j & 2) ? j_By : i_By;
133 ibz = (
j & 1) ? j_Bz : i_Bz;
136 par_t[
i] =
fun_t[ial][iby][ibz][
i];
142 DTV_v_drift[
j] = par_t[0];
144 DTV_t_drift[
j] =
MB_DT_time(dist, par_t) + DTV_delta_t[
j] + OffSet;
149 printf(
"MB_DT_drift_LOOP: OffSet = %f\n", OffSet);
151 "MB_DT_drift_LOOP: dist, v_drift, t_drift, lin, t_width_m, "
152 "t_width_p = %f %f %f %f %f %f\n",
165 DT->v_drift = DTV_v_drift[0];
166 DT->delta_t = DTV_delta_t[0];
167 DT->t_drift = DTV_t_drift[0];
168 DT->t_width_m = DTV_t_width_m[0];
169 DT->t_width_p = DTV_t_width_p[0];
190 "MB_DT_drift_time: dist, v_drift, t_drift, lin, t_width_m, t_width_p "
191 "= %f %f %f %f %f %f\n",
204 return (fabs(dist) / par[0]);
213 printf(
"MB_DT_delta_t: distance = %f\n", dist);
222 return (par[1] + par[2] *
x + par[3] *
x2);
225 return (par[4] + par[5] *
x + par[6] *
x2 + par[7] *
x2 *
x + par[8] *
x2 *
x2);
228 return (par[9] + par[10] *
x + par[11] *
x2);
230 return (par[12] + par[13] *
x + par[14] *
x2);