CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/MagneticField/Interpolation/interface/MFGrid.h

Go to the documentation of this file.
00001 #ifndef MFGrid_h
00002 #define MFGrid_h
00003 
00014 #include "DataFormats/GeometrySurface/interface/GloballyPositioned.h"
00015 #include "MagneticField/Interpolation/interface/MagProviderInterpol.h"
00016 
00017 struct Dimensions 
00018 {
00019   int w;
00020   int h;
00021   int d;
00022 };
00023 
00024 struct Indexes
00025 {
00026   int i;
00027   int j;
00028   int k;
00029 };
00030 
00031 class MFGrid : public MagProviderInterpol {
00032 public:
00033 
00034   typedef GloballyPositioned<float>::GlobalPoint     GlobalPoint;
00035   typedef GloballyPositioned<float>::GlobalVector    GlobalVector;
00036   typedef GloballyPositioned<float>::LocalPoint      LocalPoint;
00037   typedef GloballyPositioned<float>::LocalVector     LocalVector;
00038 
00039   explicit MFGrid( const GloballyPositioned<float>& vol) : frame_(vol) {}
00040 
00041   virtual ~MFGrid() {}
00042 
00044   virtual LocalVector valueInTesla( const LocalPoint& p) const = 0;
00045 
00046   virtual void dump() const {}
00047 
00049   virtual void toGridFrame( const LocalPoint& p, double& a, double& b, double& c) const = 0;
00050 
00052   virtual LocalPoint fromGridFrame( double a, double b, double c) const = 0;
00053 
00054   virtual Dimensions dimensions() const = 0;
00055 
00057   virtual LocalPoint  nodePosition( int i, int j, int k) const = 0;
00058 
00060   virtual LocalVector nodeValue( int i, int j, int k) const = 0;
00061 
00062   virtual Indexes index( const LocalPoint& p) const {return Indexes();}
00063 
00065   const GloballyPositioned<float>& frame() const { return frame_;}
00066 
00067 private:
00068 
00069   GloballyPositioned<float> frame_;
00070 
00071 };
00072 
00073 #endif