Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
H02Field Class Reference

#include <H02Field.hh>

Inheritance diagram for H02Field:
G4MagneticField G4ElectroMagneticField G4Field

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.

References python.hepunit::m, sqr(), and python.hepunit::tesla.

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 }
T sqr(const T &x)
Definition: templates.hh:145
double G4double
Definition: G4Types.hh:76

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