Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:09

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 // $Id: $
0004 
0005 /*!
0006  * \file PHG4MagneticField.h
0007  * \brief
0008  * \author Jin Huang <jhuang@bnl.gov>
0009  * \version $Revision:   $
0010  * \date $Date: $
0011  */
0012 
0013 #ifndef G4MAIN_PHG4MAGNETICFIELD_H
0014 #define G4MAIN_PHG4MAGNETICFIELD_H
0015 
0016 #include <Geant4/G4MagneticField.hh>
0017 
0018 class PHField;
0019 
0020 /*!
0021  * \brief PHG4MagneticField interfaces with Geant4
0022  */
0023 class PHG4MagneticField : public G4MagneticField
0024 {
0025  public:
0026   PHG4MagneticField(const PHField* field);
0027   ~PHG4MagneticField() override = default;
0028 
0029   const PHField* get_field() const
0030   {
0031     return field_;
0032   }
0033 
0034   void set_field(const PHField* field)
0035   {
0036     field_ = field;
0037   }
0038 
0039   void GetFieldValue(const double Point[4], double* Bfield) const override;
0040 
0041  private:
0042   const PHField* field_;
0043 };
0044 
0045 #endif /* SIMULATION_CORESOFTWARE_SIMULATION_G4SIMULATION_G4MAIN_PHG4MAGNETICFIELD_H_ */