16 #define THIS_CLASS DTDriftTimeParametrization 21 #ifndef MB_DT_STANDALONE 26 #include "DataFormats/MuonData/src/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];
59 switch (interpolate) {
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];
140 OffSet = par_t[N_Par_t - 1];
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",
164 if (interpolate == 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);
unsigned short MB_DT_Check_boundaries(double distime, double alpha, double by, double bz, short ifl) const
DTDriftTimeParametrization()
Constructor.
static const double alpha_value[11]
double MB_DT_time(double, double *) const
double MB_DT_sigma_t_p(double, double *) const
static const double By_value[5]
static const double fun_sigma_t[11][5][5][7]
double MB_DT_delta_t(double, double *) const
unsigned short MB_DT_drift_time(double x, double alpha, double by, double bz, short ifl, drift_time *DT, short interpolate) const
Calculate drift time and spread.
Structure used to return output values.
double MB_DT_sigma_t_m(double, double *) const
double MB_DT_MLInterpolation(double *al, double *by, double *bz, double *f) const
static const double Bz_value[5]
virtual ~DTDriftTimeParametrization()
Destructor.
void MB_DT_Get_grid_points(double alpha, double by, double bz, unsigned short *p_alpha, unsigned short *p_By, unsigned short *p_Bz, unsigned short *q_alpha, unsigned short *q_By, unsigned short *q_Bz) const
static const double fun_t[11][5][5][19]