00001 #ifndef MagneticField_MagneticField_h 00002 #define MagneticField_MagneticField_h 00003 00013 #include "DataFormats/GeometryVector/interface/GlobalVector.h" 00014 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00015 00016 class MagneticField 00017 { 00018 public: 00019 MagneticField(); 00020 virtual ~MagneticField(); 00021 00024 virtual MagneticField* clone() const { 00025 return 0; 00026 } 00027 00028 00030 virtual GlobalVector inTesla (const GlobalPoint& gp) const = 0; 00031 00033 virtual GlobalVector inKGauss(const GlobalPoint& gp) const; 00034 00036 virtual GlobalVector inInverseGeV(const GlobalPoint& gp) const; 00037 00039 // engine is defined. 00040 virtual bool isDefined(const GlobalPoint& gp) const { 00041 return true; 00042 } 00043 00046 virtual GlobalVector inTeslaUnchecked (const GlobalPoint& gp) const { 00047 return inTesla(gp); // default dummy implementation 00048 } 00049 00051 // This generic implementation can be replaced by concrete engines 00052 virtual int nominalValue() const; 00053 00054 }; 00055 00056 #endif