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

#include <G4SextupoleMagField.hh>

+ Inheritance diagram for G4SextupoleMagField:

Public Member Functions

 G4SextupoleMagField (G4double pGradient)
 
 G4SextupoleMagField (G4double pGradient, G4ThreeVector pOrigin, G4RotationMatrix *pMatrix)
 
 ~G4SextupoleMagField ()
 
void GetFieldValue (const G4double yTrack[], G4double B[]) const
 
G4FieldClone () 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 G4Field
 G4Field (G4bool gravityOn=false)
 
 G4Field (const G4Field &)
 
virtual ~G4Field ()
 
G4Fieldoperator= (const G4Field &p)
 
virtual void GetFieldValue (const G4double Point[4], G4double *fieldArr) const =0
 
virtual G4bool DoesFieldChangeEnergy () const =0
 
G4bool IsGravityActive () const
 
void SetGravityActive (G4bool OnOffFlag)
 
virtual G4FieldClone () const
 

Additional Inherited Members

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

Detailed Description

Definition at line 45 of file G4SextupoleMagField.hh.

Constructor & Destructor Documentation

◆ G4SextupoleMagField() [1/2]

G4SextupoleMagField::G4SextupoleMagField ( G4double  pGradient)

Definition at line 40 of file G4SextupoleMagField.cc.

41{
42 fGradient = pGradient;
43 fpMatrix = &IdentityMatrix;
44}

◆ G4SextupoleMagField() [2/2]

G4SextupoleMagField::G4SextupoleMagField ( G4double  pGradient,
G4ThreeVector  pOrigin,
G4RotationMatrix pMatrix 
)

Definition at line 46 of file G4SextupoleMagField.cc.

49{
50 fGradient = pGradient ;
51 fOrigin = pOrigin ;
52 fpMatrix = pMatrix ;
53}

◆ ~G4SextupoleMagField()

G4SextupoleMagField::~G4SextupoleMagField ( )

Definition at line 62 of file G4SextupoleMagField.cc.

63{
64}

Member Function Documentation

◆ Clone()

G4Field * G4SextupoleMagField::Clone ( ) const
virtual

Reimplemented from G4Field.

Definition at line 55 of file G4SextupoleMagField.cc.

56{
57 return new G4SextupoleMagField(fGradient, fOrigin, fpMatrix);
58}

◆ GetFieldValue()

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

Definition at line 66 of file G4SextupoleMagField.cc.

69{
71 y[0] - fOrigin.x(),
72 y[1] - fOrigin.y(),
73 y[2] - fOrigin.z());
74
75 const G4ThreeVector r_local = (*fpMatrix) * r_global;
76 const G4ThreeVector B_local( fGradient * r_local.x() * r_local.y(),fGradient * ( std::pow(r_local.x(),2) - std::pow(r_local.y(),2) )/2 ,0);
77 const G4ThreeVector B_global = fpMatrix->inverse() * B_local;
78
79 B[0] = B_global.x() ;
80 B[1] = B_global.y() ;
81 B[2] = B_global.z() ;
82}
G4double B(G4double temperature)
CLHEP::Hep3Vector G4ThreeVector
double z() const
double x() const
double y() const
HepRotation inverse() const

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