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 #include <vector> 00018 00019 class MFGrid : public MagProviderInterpol { 00020 public: 00021 00022 typedef GloballyPositioned<float>::GlobalPoint GlobalPoint; 00023 typedef GloballyPositioned<float>::GlobalVector GlobalVector; 00024 typedef GloballyPositioned<float>::LocalPoint LocalPoint; 00025 typedef GloballyPositioned<float>::LocalVector LocalVector; 00026 00027 explicit MFGrid( const GloballyPositioned<float>& vol) : frame_(vol) {} 00028 00029 virtual ~MFGrid() {} 00030 00032 virtual LocalVector valueInTesla( const LocalPoint& p) const = 0; 00033 00034 virtual void dump() const {} 00035 00037 virtual void toGridFrame( const LocalPoint& p, double& a, double& b, double& c) const = 0; 00038 00040 virtual LocalPoint fromGridFrame( double a, double b, double c) const = 0; 00041 00042 virtual std::vector<int> dimensions() const = 0; 00043 00045 virtual LocalPoint nodePosition( int i, int j, int k) const = 0; 00046 00048 virtual LocalVector nodeValue( int i, int j, int k) const = 0; 00049 00050 virtual std::vector<int> index( const LocalPoint& p) const {return std::vector<int>();} 00051 00053 const GloballyPositioned<float>& frame() const { return frame_;} 00054 00055 private: 00056 00057 GloballyPositioned<float> frame_; 00058 00059 }; 00060 00061 #endif