Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DELPHIMagField Class Reference

describes the DELPHI magnetic field. The axial symmetry field is mainly directed along Z axis. The function MagneticField(yTrack,B) calculates the magnetic induction vector B in given point corresponding according to parameterisation given in: P.Billoir, DELPHI 87-6 PROG 65, 1987. More...

#include <G4DELPHIMagField.hh>

Inheritance diagram for G4DELPHIMagField:

Public Member Functions

 G4DELPHIMagField ()=default
 ~G4DELPHIMagField () override=default
void GetFieldValue (const G4double yTrack[], G4double B[]) const override
G4FieldClone () const override
Public Member Functions inherited from G4MagneticField
 G4MagneticField ()
 ~G4MagneticField () override=default
 G4MagneticField (const G4MagneticField &r)
G4MagneticFieldoperator= (const G4MagneticField &p)
G4bool DoesFieldChangeEnergy () const override
void GetFieldValue (const G4double Point[4], G4double *Bfield) const override=0
G4FieldType GetFieldType () const override
Public Member Functions inherited from G4Field
 G4Field (G4bool gravityOn=false)
virtual ~G4Field ()=default
 G4Field (const G4Field &p)=default
G4Fieldoperator= (const G4Field &p)
G4bool IsGravityActive () const
void SetGravityActive (G4bool OnOffFlag)

Additional Inherited Members

Static Public Attributes inherited from G4Field
static constexpr G4int MAX_NUMBER_OF_COMPONENTS = 24

Detailed Description

describes the DELPHI magnetic field. The axial symmetry field is mainly directed along Z axis. The function MagneticField(yTrack,B) calculates the magnetic induction vector B in given point corresponding according to parameterisation given in: P.Billoir, DELPHI 87-6 PROG 65, 1987.

Definition at line 51 of file G4DELPHIMagField.hh.

Constructor & Destructor Documentation

◆ G4DELPHIMagField()

G4DELPHIMagField::G4DELPHIMagField ( )
default

Default Constructor and Destructor.

Referenced by Clone().

◆ ~G4DELPHIMagField()

G4DELPHIMagField::~G4DELPHIMagField ( )
overridedefault

Member Function Documentation

◆ Clone()

G4Field * G4DELPHIMagField::Clone ( ) const
overridevirtual

Returns a pointer to a new allocated clone of this object.

Reimplemented from G4Field.

Definition at line 37 of file G4DELPHIMagField.cc.

38{
39 return new G4DELPHIMagField;
40}
G4DELPHIMagField()=default

◆ GetFieldValue()

void G4DELPHIMagField::GetFieldValue ( const G4double yTrack[],
G4double B[] ) const
override

Returns the field value on the given position 'yTrack'.

Parameters
[in]yTrackTime position array.
[out]BThe returned field array.

Definition at line 44 of file G4DELPHIMagField.cc.

46{
47 G4int i, n = 8 ;
48 G4double a = 0.001 ; // mm -> m
49 G4double x = a*yTrack[0], y = a*yTrack[1], z = a*yTrack[2] ;
50 G4double x2 = x*x, y2 = y*y, z2 = z*z, r2 = x2 + y2 ;
51 G4double r4 = r2*r2, z4 = z2*z2, r6 = r4*r2, z6 = z4*z2 ;
52 G4double r8 = r4*r4, z8 = z4*z4, r10 = r8*r2, z10 = z8*z2 ;
53 G4double rz = z*std::sqrt(r2), r = std::sqrt(r2+a*a) ;
54 G4double Br ;
55 G4double P[8], Q[8] ;
56 static G4ThreadLocal G4double c[8] =
57 {
58 -9.26e-5, -3.51e-5, 2.94e-6, -1.10e-6,
59 6.25e-8, -1.77e-8, -6.88e-10, -7.52e-11
60 } ;
61 P[0] = 2*rz ;
62 P[1] = 4*rz*(r2 - 4.0*z2/3.0) ;
63 P[2] = 6*rz*(r4 - 4*r2*z2 + 1.6*z4) ;
64 P[3] = 8*rz*(r6 - 8*r4*z2 + 9.6*r2*z4 - 64.0*z6/35.0) ;
65 P[4] = 10*rz*(r8 - 40.0*r6*z2/3.0 + 32*r4*z4
66 - 128.0*r2*z6/7.0 + 128.0*z8/63.0);
67 P[5] = 0 ;
68 P[6] = 0 ;
69 P[7] = 0 ;
70
71 Q[0] = r2 - 2*z2 ;
72 Q[1] = r4 - 8*r2*z2 + 8.0*z4/3.0 ;
73 Q[2] = r6 - 18*r4*z2 + 24*r2*z4 - 3.2*z6 ;
74 Q[3] = r8 - 32*r6*z2 + 96*r4*z4 - 51.2*r2*z6 +128.0*z8/35.0 ;
75 Q[4] = r10 - 50*r8*z2 + 800.0*r6*z4/3.0 - 320*r4*z6
76 + 640.0*r2*z8/7.0 - 256.0*z10/63.0 ;
77 Q[5] = 0 ;
78 Q[6] = 0 ;
79 Q[7] = 0 ;
80
81 Br = 0 ;
82 B[2] = 1.2*tesla ; // the principal Bz value of DELPHI detector
83 for(i=0; i<n; ++i)
84 {
85 Br += c[i]*P[i] ;
86 B[2] += c[i]*Q[i] ;
87 }
88 B[0] = Br*x/r ;
89 B[1] = Br*y/r ;
90 return ;
91}
G4double B(G4double temperature)
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4ThreadLocal
Definition tls.hh:77

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