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

#include <G4QuadrupoleMagField.hh>

Inheritance diagram for G4QuadrupoleMagField:
G4MagneticField G4ElectroMagneticField G4Field

Public Member Functions

 G4QuadrupoleMagField (G4double pGradient)
 
 G4QuadrupoleMagField (G4double pGradient, G4ThreeVector pOrigin, G4RotationMatrix *pMatrix)
 
 ~G4QuadrupoleMagField ()
 
void GetFieldValue (const G4double yTrack[], G4double B[]) const
 
G4QuadrupoleMagFieldClone () 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 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)
 

Detailed Description

Definition at line 54 of file G4QuadrupoleMagField.hh.

Constructor & Destructor Documentation

G4QuadrupoleMagField::G4QuadrupoleMagField ( G4double  pGradient)

Definition at line 36 of file G4QuadrupoleMagField.cc.

Referenced by Clone().

37 {
38  fGradient = pGradient ;
39  fOrigin = G4ThreeVector( 0.0, 0.0, 0.0) ;
40  fpMatrix = &IdentityMatrix;
41 }
CLHEP::Hep3Vector G4ThreeVector
G4QuadrupoleMagField::G4QuadrupoleMagField ( G4double  pGradient,
G4ThreeVector  pOrigin,
G4RotationMatrix pMatrix 
)

Definition at line 46 of file G4QuadrupoleMagField.cc.

49 {
50  fGradient = pGradient ;
51  fOrigin = pOrigin ;
52  fpMatrix = pMatrix ;
53 }
G4QuadrupoleMagField::~G4QuadrupoleMagField ( )

Definition at line 65 of file G4QuadrupoleMagField.cc.

66 {
67 }

Member Function Documentation

G4QuadrupoleMagField * G4QuadrupoleMagField::Clone ( ) const
virtual

Reimplemented from G4Field.

Definition at line 55 of file G4QuadrupoleMagField.cc.

References G4QuadrupoleMagField().

56 {
57  //TODO: Can the fpMatrix be shared??
58  return new G4QuadrupoleMagField(this->fGradient,
59  this->fOrigin,
60  this->fpMatrix);
61 }
G4QuadrupoleMagField(G4double pGradient)
void G4QuadrupoleMagField::GetFieldValue ( const G4double  yTrack[],
G4double  B[] 
) const

Definition at line 73 of file G4QuadrupoleMagField.cc.

References CLHEP::HepRotation::colX(), CLHEP::HepRotation::colY(), CLHEP::HepRotation::colZ(), CLHEP::HepRotation::inverse(), CLHEP::HepRotation::rowX(), CLHEP::HepRotation::rowY(), CLHEP::HepRotation::rowZ(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

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

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