Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:57

0001 #ifndef PHFIELD_PHFIELD_H
0002 #define PHFIELD_PHFIELD_H
0003 
0004 // units of this class. To convert internal value to Geant4/CLHEP units for fast access
0005 
0006 //! \brief transient object for field storage and access
0007 class PHField
0008 {
0009  public:
0010   //! constructor
0011   explicit PHField(const int verb = 0)
0012     : m_Verbosity(verb)
0013   {}
0014 
0015   //! destructor
0016   virtual ~PHField() = default;
0017 
0018   //! access field value
0019   //! Follow the convention of G4ElectroMagneticField
0020   //! @param[in]  Point   space time coordinate. x, y, z, t in Geant4/CLHEP units
0021   //! @param[out] Bfield  field value. In the case of magnetic field, the order is Bx, By, Bz in in Geant4/CLHEP units
0022   virtual void GetFieldValue(
0023       const double Point[4],
0024       double *Bfield) const = 0;
0025 
0026   //! un-cached version of field accessor.
0027   /* used for multi-threading. By default, the same as GetFieldValue */
0028   virtual void GetFieldValue_nocache(
0029       const double Point[4],
0030       double *Bfield) const
0031   { return GetFieldValue( Point, Bfield ); }
0032 
0033   //! verbosity
0034   void Verbosity(const int i) { m_Verbosity = i; }
0035 
0036   //! verbosity
0037   int Verbosity() const { return m_Verbosity; }
0038 
0039  protected:
0040 
0041   //! verbosity
0042   int m_Verbosity = 0;
0043 };
0044 
0045 #endif