Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:44

0001 #ifndef DTTime2DriftParametrization_H
0002 #define DTTime2DriftParametrization_H
0003 
0004 /** \class DTTime2DriftParametrization
0005  ************************************************************************
0006  *
0007  * Version 2.1 - November 18, 2003
0008  *
0009  * MB_DT_drift_distance()  Calculates the drift distance (mm)
0010  *
0011  * See usage details in the README file delivered with the distribution.
0012  *
0013  * Authors: Pablo Garcia-Abia and Jesus Puerta (CIEMAT, Madrid)
0014  * Email:   Pablo.Garcia@ciemat.es, Jesus.Puerta@ciemat.es
0015  *
0016  ************************************************************************
0017  */
0018 
0019 #define N_alpha 11
0020 #define N_By 5
0021 #define N_Bz 5
0022 #define N_Par_x 15
0023 #define N_Sigma_t 7
0024 
0025 class DTTime2DriftParametrization {
0026 public:
0027   /// Constructor
0028   DTTime2DriftParametrization();
0029 
0030   /// Destructor
0031   virtual ~DTTime2DriftParametrization();
0032 
0033   /// Structure used to return output values
0034   typedef struct {
0035     double v_drift, x_drift, delta_x, x_width_m, x_width_p;
0036   } drift_distance;
0037 
0038   /// Calculate drift distance and spread
0039   unsigned short MB_DT_drift_distance(
0040       double time, double alpha, double by, double bz, drift_distance *DX, short interpolate) const;
0041 
0042 private:
0043   double MB_DT_dist(double, double *) const;
0044   double MB_DT_delta_x(double, double *) const;
0045   double MB_DT_sigma_t_m(double, double *) const;
0046   double MB_DT_sigma_t_p(double, double *) const;
0047 
0048   unsigned short MB_DT_Check_boundaries(double distime, double alpha, double by, double bz, short ifl) const;
0049 
0050   void MB_DT_Get_grid_values(
0051       double Var, unsigned short *pi, unsigned short *pj, short Initial, unsigned short N, const double *Values) const;
0052 
0053   void MB_DT_Get_grid_points(double alpha,
0054                              double by,
0055                              double bz,
0056                              unsigned short *p_alpha,
0057                              unsigned short *p_By,
0058                              unsigned short *p_Bz,
0059                              unsigned short *q_alpha,
0060                              unsigned short *q_By,
0061                              unsigned short *q_Bz) const;
0062 
0063   double MB_DT_MLInterpolation(double *al, double *by, double *bz, double *f) const;
0064 
0065   /*** Points of the grid ***/
0066   static const double alpha_value[N_alpha];
0067   static const double By_value[N_By];
0068   static const double Bz_value[N_Bz];
0069 
0070   /*** Parameter values ***/
0071   static const double fun_x[N_alpha][N_By][N_Bz][N_Par_x];
0072   static const double fun_sigma_t[N_alpha][N_By][N_Bz][N_Sigma_t];
0073 
0074   /*** skew factor ***/
0075   static const double velocitySkew;
0076 };
0077 #endif