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

G4TQuadrupoleMagField is a templated version of G4QuadrupoleMagField. More...

#include <G4TQuadrupoleMagField.hh>

Inheritance diagram for G4TQuadrupoleMagField:

Public Member Functions

 G4TQuadrupoleMagField (G4double pGradient)
 G4TQuadrupoleMagField (G4double pGradient, G4ThreeVector pOrigin, G4RotationMatrix *pMatrix)
virtual ~G4TQuadrupoleMagField ()=default
void GetFieldValue (const G4double y[7], G4double B[3]) const
G4TQuadrupoleMagFieldClone () const
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

G4TQuadrupoleMagField is a templated version of G4QuadrupoleMagField.

Definition at line 49 of file G4TQuadrupoleMagField.hh.

Constructor & Destructor Documentation

◆ G4TQuadrupoleMagField() [1/2]

G4TQuadrupoleMagField::G4TQuadrupoleMagField ( G4double pGradient)
inline

Definition at line 53 of file G4TQuadrupoleMagField.hh.

54 {
55 fGradient = pGradient ;
56 fOrigin = G4ThreeVector( 0.0, 0.0, 0.0) ;
57 fpMatrix = &IdentityMatrix;
58 }
CLHEP::Hep3Vector G4ThreeVector

Referenced by Clone().

◆ G4TQuadrupoleMagField() [2/2]

G4TQuadrupoleMagField::G4TQuadrupoleMagField ( G4double pGradient,
G4ThreeVector pOrigin,
G4RotationMatrix * pMatrix )
inline

Definition at line 60 of file G4TQuadrupoleMagField.hh.

63 {
64 fGradient = pGradient ;
65 fOrigin = pOrigin ;
66 fpMatrix = pMatrix ;
67 }

◆ ~G4TQuadrupoleMagField()

virtual G4TQuadrupoleMagField::~G4TQuadrupoleMagField ( )
virtualdefault

Member Function Documentation

◆ Clone()

G4TQuadrupoleMagField * G4TQuadrupoleMagField::Clone ( ) const
inlinevirtual

Interface method to implement cloning, needed by multi-threading. Here issuing a fatal exception, as expecting this to be implemented concretely in derived classes.

Reimplemented from G4Field.

Definition at line 99 of file G4TQuadrupoleMagField.hh.

100 {
101 //TODO: Can the fpMatrix be shared??
102 return new G4TQuadrupoleMagField(this->fGradient,
103 this->fOrigin,
104 this->fpMatrix);
105 }
G4TQuadrupoleMagField(G4double pGradient)

◆ GetFieldValue()

void G4TQuadrupoleMagField::GetFieldValue ( const G4double y[7],
G4double B[3] ) const
inline

Definition at line 71 of file G4TQuadrupoleMagField.hh.

73 {
75 y[0] - fOrigin.x(),
76 y[1] - fOrigin.y(),
77 y[2] - fOrigin.z());
78
80 fpMatrix->colX() * r_global,
81 fpMatrix->colY() * r_global,
82 fpMatrix->colZ() * r_global);
83
85 fGradient * r_local.y(),
86 fGradient * r_local.x(),
87 0);
88
90 fpMatrix->inverse().rowX() * B_local,
91 fpMatrix->inverse().rowY() * B_local,
92 fpMatrix->inverse().rowZ() * B_local);
93
94 B[0] = B_global.x() ;
95 B[1] = B_global.y() ;
96 B[2] = B_global.z() ;
97 }
G4double B(G4double temperature)
double z() const
double x() const
double y() const

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