Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:07

0001 #ifndef DTTime2DriftParametrization_H
0002 #define DTTime2DriftParametrization_H
0003 
0004 /** \class DTTime2DriftParametrization
0005  *  This class access the cell parametrization by Pablo Garcia-Abia and Jesus Puerta (CIEMAT).
0006  *  The two public methods act as an interface for the parametrization converting the reference frame
0007  *  and the units accordingly to CMSSW convention.
0008  *
0009  *  \author  Pablo Garcia-Abia and Jesus Puerta (CIEMAT, Madrid)
0010  */
0011 
0012 #define N_alpha 11
0013 #define N_By 5
0014 #define N_Bz 5
0015 #define N_Par_x 15
0016 #define N_Sigma_t 7
0017 
0018 class DTTime2DriftParametrization {
0019 public:
0020   /// Constructor
0021   DTTime2DriftParametrization();
0022 
0023   /// Destructor
0024   virtual ~DTTime2DriftParametrization();
0025 
0026   /// Structure used to return output values
0027   typedef struct {
0028     double v_drift, x_drift, delta_x, x_width_m, x_width_p;
0029   } drift_distance;  //FIXME: Why this typedef?
0030 
0031   /// Compute the drift distance and relative errors (cm).
0032   /// The drift distance is computed as the MODE value of the distance distribution
0033   /// for this particular time.
0034   /// This method takes care of the conversions of units and reference frame used by CMSSW and the
0035   /// parametrization.
0036   /// time is in ns, alpha (=atan(x/-z)) in rad, by and bz are the magnetic field in the layer RF.
0037   /// False is returned if the parametrization fails
0038   bool computeDriftDistance_mode(
0039       double time, double alpha, double by, double bz, short interpolate, drift_distance *dx) const;
0040 
0041   /// Compute the drift distance and relative errors (cm).
0042   /// The drift distance is computed as the MEAN value of the distance distribution
0043   /// for this particular time.
0044   /// This method takes care of the conversions of units and reference frame used by CMSSW and the
0045   /// parametrization.
0046   /// time is in ns, alpha (=atan(x/-z))  in rad, by and bz are the magnetic field in the layer RF.
0047   /// False is returned if the parametrization fails
0048   bool computeDriftDistance_mean(
0049       double time, double alpha, double by, double bz, short interpolate, drift_distance *dx) const;
0050 
0051 private:
0052   /// Calculate drift distance and spread
0053   unsigned short MB_DT_drift_distance(
0054       double time, double alpha, double by, double bz, drift_distance *DX, short interpolate) const;
0055 
0056   double MB_DT_dist(double, double *) const;
0057   double MB_DT_delta_x(double, double *) const;
0058   double MB_DT_sigma_t_m(double, double *) const;
0059   double MB_DT_sigma_t_p(double, double *) const;
0060 
0061   unsigned short MB_DT_Check_boundaries(double distime, double alpha, double by, double bz, short ifl) const;
0062 
0063   void MB_DT_Get_grid_values(
0064       double Var, unsigned short *pi, unsigned short *pj, short Initial, unsigned short N, const double *Values) const;
0065 
0066   void MB_DT_Get_grid_points(double alpha,
0067                              double by,
0068                              double bz,
0069                              unsigned short *p_alpha,
0070                              unsigned short *p_By,
0071                              unsigned short *p_Bz,
0072                              unsigned short *q_alpha,
0073                              unsigned short *q_By,
0074                              unsigned short *q_Bz) const;
0075 
0076   double MB_DT_MLInterpolation(double *al, double *by, double *bz, double *f) const;
0077 
0078   /*** Points of the grid ***/
0079   static const double alpha_value[N_alpha];
0080   static const double By_value[N_By];
0081   static const double Bz_value[N_Bz];
0082 
0083   /*** Parameter values ***/
0084   static const double fun_x[N_alpha][N_By][N_Bz][N_Par_x];
0085   static const double fun_sigma_t[N_alpha][N_By][N_Bz][N_Sigma_t];
0086 
0087   /*** skew factor ***/
0088   static const double velocitySkew;
0089 };
0090 #endif