Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:27

0001 #ifndef MagneticFieldProvider_h
0002 #define MagneticFieldProvider_h
0003 
0004 /** \class MagneticFieldProvider
0005  *
0006  *  Virtual interface for the field provider for an individual field volume.
0007  *
0008  *  \author T. Todorov
0009  */
0010 
0011 #include "DataFormats/GeometryVector/interface/Point3DBase.h"
0012 #include "DataFormats/GeometryVector/interface/Vector3DBase.h"
0013 #include "DataFormats/GeometryVector/interface/LocalTag.h"
0014 #include "DataFormats/GeometryVector/interface/GlobalTag.h"
0015 
0016 template <class T>
0017 class MagneticFieldProvider {
0018 public:
0019   typedef Point3DBase<T, GlobalTag> GlobalPointType;
0020   typedef Point3DBase<T, LocalTag> LocalPointType;
0021   typedef Vector3DBase<T, GlobalTag> GlobalVectorType;
0022   typedef Vector3DBase<T, LocalTag> LocalVectorType;
0023 
0024   virtual ~MagneticFieldProvider() {}
0025 
0026   /** Returns the field vector in the local frame, at local position p
0027    */
0028   virtual LocalVectorType valueInTesla(const LocalPointType& p) const = 0;
0029 
0030   /** Returns the field vector in the global frame, at global position p
0031    * Not needed, the MagVolume does the transformation to global!
0032    */
0033   // virtual GlobalVectorType valueInTesla( const GlobalPointType& p) const = 0;
0034 
0035   /** Returns the maximal order of available derivatives.
0036    *  Returns 0 if derivatives are not available.
0037    */
0038   virtual int hasDerivatives() const { return false; }
0039 
0040   /** Returns the Nth spacial derivative of the field in the local frame.
0041    */
0042   virtual LocalVectorType derivativeInTeslaPerMeter(const LocalPointType& p, int N) const { return LocalVectorType(); }
0043 };
0044 
0045 #endif