33 lines
908 B
Plaintext
33 lines
908 B
Plaintext
// This code implementation is the intellectual property of
|
|
// the GEANT4 collaboration.
|
|
//
|
|
// By copying, distributing or modifying the Program (or any work
|
|
// based on the Program) you indicate your acceptance of this statement,
|
|
// and all its terms.
|
|
//
|
|
// $Id: G4MagHelicalStepper.icc,v 1.4 2000/11/01 15:15:49 gcosmo Exp $
|
|
// GEANT4 tag $Name: geant4-03-00 $
|
|
//
|
|
|
|
// linear Step in regions of no field
|
|
|
|
inline void
|
|
G4MagHelicalStepper::LinearStep( const G4double yIn[],
|
|
G4double h,
|
|
G4double yLinear[])
|
|
{
|
|
for( G4int i = 0; i < 3; i++ ) {
|
|
yLinear[i] = yIn[i] + h * yIn[i+3];
|
|
yLinear[i+3] = yIn[i+3];
|
|
}
|
|
}
|
|
|
|
inline void
|
|
G4MagHelicalStepper::MagFieldEvaluate(const G4double y[],
|
|
G4ThreeVector& Bfield )
|
|
{
|
|
G4double B[3];
|
|
GetEquationOfMotion()-> GetFieldValue(y, B);
|
|
Bfield= G4ThreeVector( B[0], B[1], B[2] );
|
|
}
|