Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
H02Field Class Reference

#include <H02Field.hh>

Inheritance diagram for H02Field:
Collaboration diagram for H02Field:

Public Member Functions

 H02Field ()
 
 ~H02Field ()
 
void GetFieldValue (const G4double Point[3], G4double *Bfield) const
 
- Public Member Functions inherited from G4MagneticField
 G4MagneticField ()
 
virtual ~G4MagneticField ()
 
 G4MagneticField (const G4MagneticField &r)
 
G4MagneticFieldoperator= (const G4MagneticField &p)
 
G4bool DoesFieldChangeEnergy () const
 
virtual void GetFieldValue (const G4double Point[4], G4double *Bfield) const =0
 
- Public Member Functions inherited from G4ElectroMagneticField
 G4ElectroMagneticField ()
 
virtual ~G4ElectroMagneticField ()
 
 G4ElectroMagneticField (const G4ElectroMagneticField &r)
 
G4ElectroMagneticFieldoperator= (const G4ElectroMagneticField &p)
 
- Public Member Functions inherited from G4Field
 G4Field (G4bool gravityOn=false)
 
 G4Field (const G4Field &)
 
virtual ~G4Field ()
 
G4Fieldoperator= (const G4Field &p)
 
G4bool IsGravityActive () const
 
void SetGravityActive (G4bool OnOffFlag)
 
virtual G4FieldClone () const
 

Detailed Description

Definition at line 37 of file H02Field.hh.

Constructor & Destructor Documentation

H02Field::H02Field ( )
inline

Definition at line 39 of file H02Field.hh.

39 { }
H02Field::~H02Field ( )
inline

Definition at line 40 of file H02Field.hh.

40 { }

Member Function Documentation

void H02Field::GetFieldValue ( const G4double  Point[3],
G4double Bfield 
) const

Definition at line 36 of file H02Field.cc.

37 {
38  const G4double Bz= 3.0*tesla;
39  const G4double rmax_sq = sqr(1.*m);
40  const G4double zmax = 1.*m;
41 
42  Bfield[0]= 0.;
43  Bfield[1] = 0.;
44  if(std::abs(Point[2])<zmax && (sqr(Point[0])+sqr(Point[1]))<rmax_sq) {
45  Bfield[2]= Bz;
46  } else {
47  Bfield[2]= 0.;
48  }
49 }
static constexpr double tesla
Definition: G4SIunits.hh:268
static constexpr double m
Definition: G4SIunits.hh:129
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


The documentation for this class was generated from the following files: