CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/MagneticField/Interpolation/src/VectorFieldInterpolation.h

Go to the documentation of this file.
00001 #ifndef VectorFieldInterpolation_H
00002 #define VectorFieldInterpolation_H
00003 
00019 // ***************************************************************
00020 // by droll (19/07/03)
00021 //
00022 // basic equation (1D example):  y = y0 + (x-x0)/(x1-x0)*(y1-y0)
00023 // find field value y at point x
00024 // corner points x0 and x1 with field  values
00025 // field values y0 and y1 at points x0 and x1
00026 //
00027 // input should be organized like in the following sketch
00028 // 3D interpolation cell (example Cartesian coordinates):
00029 //
00030 //          (011) *-------------------* (111)
00031 //               /|                  /|
00032 //              / |                 / |
00033 //             /  |                /  |
00034 //            /   |               /   |
00035 //           /    |              /    |
00036 //          /     |             /     |
00037 //   (010) *-------------------* (110)|
00038 //         |      |            |      |
00039 //         |      |            |      |
00040 //         |(001) *------------|------* (101)
00041 //         |     /             |     /
00042 //         |    /              |    /
00043 //         |   /               |   /
00044 //         |  /                |  /
00045 //         | /                 | /
00046 //         |/                  |/
00047 //   (000) *-------------------* (100)
00048 //
00049 // 1. iteration: interpolation cell  -> interpolation plane
00050 //
00051 // 2. iteration: interpolation plane -> interpolation line
00052 //
00053 // 3. iteration: interpolation line  -> interpolation at SC[3]
00054 //
00055 // ***************************************************************
00056 
00057 class VectorFieldInterpolation{
00058 public:
00059   // constructor
00060   VectorFieldInterpolation(){}
00061   // destructor
00062   ~VectorFieldInterpolation(){}
00063 
00064 private:
00065   // spatial coordinates, where the field has to be calculated
00066   //                X1 ,  X2 , X3
00067   double SC[3]; // {0.0 ,0.0 ,0.0 };
00068   
00069   // values describing the 8 corners of an interpolation cell
00070   // 6 dimensions: 3 space dimensions + 3 field dimensions
00071   //                          X1 ,  X2 ,  X3 ,  F1 ,  F2 ,  F3
00072   double CellPoint000[6]; // {0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 };
00073   double CellPoint100[6];
00074   double CellPoint010[6];
00075   double CellPoint110[6];
00076   double CellPoint001[6];
00077   double CellPoint101[6];
00078   double CellPoint011[6];
00079   double CellPoint111[6];
00080 
00081   // 3 components of the interpolated vector field at spatial coordinates SC
00082   //                F1  , F2  , F3
00083   double VF[3]; // {0.0 , 0.0 , 0.0 };
00084 
00085 
00086 public:
00087    // Accessors
00089    void defineCellPoint000(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00090    void defineCellPoint100(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00091    void defineCellPoint010(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00092    void defineCellPoint110(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00093    void defineCellPoint001(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00094    void defineCellPoint101(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00095    void defineCellPoint011(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00096    void defineCellPoint111(double X1, double X2, double X3, double  F1, double  F2, double  F3);
00098    void putSCoordGetVField(double X1, double X2, double X3, double &F1, double &F2, double &F3);
00099 };
00100 
00101 #endif