Files
geant4/source/geometry/magneticfield/include/G4MagIntegratorStepper.icc
T
2016-06-01 15:25:35 +02:00

26 lines
761 B
Plaintext

// This code implementation is the intellectual property of
// the RD44 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: G4MagIntegratorStepper.icc,v 2.2 1998/11/10 18:16:49 japost Exp $
// GEANT4 tag $Name: geant4-00 $
//
inline G4EquationOfMotion* G4MagIntegratorStepper::GetEquationOfMotion() const
{ return theEquation_Rhs; }
inline void G4MagIntegratorStepper::
NormaliseTangentVector( G4double vec[6] )
{
double drds2 = vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5];
if( fabs(drds2 - 1.0) > 1.e-14 ){
double normx = 1.0 / sqrt(drds2);
for(int i=0;i<3;i++)
vec[i+3] *= normx;
}
}