Geant4  10.02.p03
B5MagneticField Class Reference

Magnetic field. More...

#include <B5MagneticField.hh>

Inheritance diagram for B5MagneticField:
Collaboration diagram for B5MagneticField:

Public Member Functions

 B5MagneticField ()
 
virtual ~B5MagneticField ()
 
virtual void GetFieldValue (const G4double point[4], double *bField) const
 
void SetField (G4double val)
 
G4double GetField () const
 
- Public Member Functions inherited from G4MagneticField
 G4MagneticField ()
 
virtual ~G4MagneticField ()
 
 G4MagneticField (const G4MagneticField &r)
 
G4MagneticFieldoperator= (const G4MagneticField &p)
 
G4bool DoesFieldChangeEnergy () const
 
- 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
 

Private Member Functions

void DefineCommands ()
 

Private Attributes

G4GenericMessengerfMessenger
 
G4double fBy
 

Detailed Description

Magnetic field.

Definition at line 41 of file B5MagneticField.hh.

Constructor & Destructor Documentation

◆ B5MagneticField()

B5MagneticField::B5MagneticField ( )

Definition at line 39 of file B5MagneticField.cc.

40 : G4MagneticField(), fMessenger(0), fBy(1.0*tesla)
41 {
42  // define commands for this class
44 }
G4GenericMessenger * fMessenger
static const double tesla
Definition: G4SIunits.hh:265
Here is the call graph for this function:

◆ ~B5MagneticField()

B5MagneticField::~B5MagneticField ( )
virtual

Definition at line 48 of file B5MagneticField.cc.

49 {
50  delete fMessenger;
51 }
G4GenericMessenger * fMessenger

Member Function Documentation

◆ DefineCommands()

void B5MagneticField::DefineCommands ( )
private

Definition at line 62 of file B5MagneticField.cc.

63 {
64  // Define /B5/field command directory using generic messenger class
65  fMessenger = new G4GenericMessenger(this,
66  "/B5/field/",
67  "Field control");
68 
69  // fieldValue command
71  = fMessenger->DeclareMethodWithUnit("value","tesla",
73  "Set field strength.");
74  valueCmd.SetParameterName("field", true);
75  valueCmd.SetDefaultValue("1.");
76 }
void SetField(G4double val)
G4GenericMessenger * fMessenger
This class is generic messenger.
Command & DeclareMethodWithUnit(const G4String &name, const G4String &defaultUnit, const G4AnyMethod &fun, const G4String &doc="")
Command & SetDefaultValue(const G4String &)
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetField()

G4double B5MagneticField::GetField ( ) const
inline

Definition at line 50 of file B5MagneticField.hh.

50 { return fBy; }
Here is the call graph for this function:

◆ GetFieldValue()

void B5MagneticField::GetFieldValue ( const G4double  point[4],
double *  bField 
) const
virtual

Implements G4MagneticField.

Definition at line 53 of file B5MagneticField.cc.

54 {
55  bField[0] = 0.;
56  bField[1] = fBy;
57  bField[2] = 0.;
58 }

◆ SetField()

void B5MagneticField::SetField ( G4double  val)
inline

Definition at line 49 of file B5MagneticField.hh.

49 { fBy = val; }
Here is the caller graph for this function:

Member Data Documentation

◆ fBy

G4double B5MagneticField::fBy
private

Definition at line 56 of file B5MagneticField.hh.

◆ fMessenger

G4GenericMessenger* B5MagneticField::fMessenger
private

Definition at line 55 of file B5MagneticField.hh.


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