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

#include <F05Field.hh>

Inheritance diagram for F05Field:
G4ElectroMagneticField G4Field

Public Member Functions

 F05Field ()
 
virtual ~F05Field ()
 
virtual G4bool DoesFieldChangeEnergy () const
 DoesFieldChangeEnergy() returns true. More...
 
virtual void GetFieldValue (const G4double Point[4], G4double *Bfield) 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
 

Detailed Description

Definition at line 43 of file F05Field.hh.

Constructor & Destructor Documentation

F05Field::F05Field ( )

Definition at line 41 of file F05Field.cc.

F05Field::~F05Field ( )
virtual

Definition at line 47 of file F05Field.cc.

48 {
49 }

Member Function Documentation

virtual G4bool F05Field::DoesFieldChangeEnergy ( ) const
inlinevirtual

DoesFieldChangeEnergy() returns true.

Implements G4ElectroMagneticField.

Definition at line 52 of file F05Field.hh.

52 { return true; };
void F05Field::GetFieldValue ( const G4double  Point[4],
G4double Bfield 
) const
virtual

GetFieldValue() returns the field value at a given point[]. field is really field[6]: Bx,By,Bz,Ex,Ey,Ez. point[] is in global coordinates: x,y,z,t.

Implements G4ElectroMagneticField.

Definition at line 53 of file F05Field.cc.

References python.hepunit::m, python.hepunit::tesla, and python.hepunit::volt.

54 {
55  // Point[0],Point[1],Point[2] are x-, y-, z-cordinates, Point[3] is time
56 
57  const G4double Bz = 0.24*tesla;
58  const G4double Er = 2.113987E+6*volt/m;
59 
60  G4double Ex,Ey;
61 
62  G4double posR = std::sqrt(std::pow(Point[0],2) + std::pow(Point[1],2));
63  G4double cos_theta, sin_theta;
64 
65  if (posR>0){
66  cos_theta = Point[0]/(G4double)posR;
67  sin_theta = Point[1]/(G4double)posR;
68  Ex = -1*Er*cos_theta;//apply radial electric field
69  Ey = -1*Er*sin_theta;
70  }else{
71  Ex=0;
72  Ey=0;
73  }
74 
75  Bfield[0]=0;
76  Bfield[1]=0;
77  Bfield[2]=Bz;
78 
79  Bfield[3]=Ex;
80  Bfield[4]=Ey;
81  Bfield[5]=0;
82 
83  return;
84 }
double G4double
Definition: G4Types.hh:76

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