CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/MagneticField/Engine/interface/MagneticField.h

Go to the documentation of this file.
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   GlobalVector inKGauss(const GlobalPoint& gp) const  {
00034     return inTesla(gp) * 10.F;
00035   }
00036 
00038   GlobalVector inInverseGeV(const GlobalPoint& gp) const {
00039     return inTesla(gp) * 2.99792458e-3F;
00040   }
00041 
00043   // engine is defined.
00044   virtual bool isDefined(const GlobalPoint& gp) const {
00045     return true;
00046   }
00047   
00050   virtual GlobalVector inTeslaUnchecked (const GlobalPoint& gp) const {
00051     return inTesla(gp);  // default dummy implementation
00052   }
00053   
00055   // This generic implementation can be replaced by concrete engines
00056   virtual int nominalValue() const;
00057   
00058 };
00059 
00060 #endif