Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4CashKarpRKF45.cc,v 1.4 1999/12/15 14:49:48 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4CashKarpRKF45.cc,v 1.6 2000/11/20 17:29:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// The Cash-Karp Runge-Kutta-Fehlberg 4/5 method is an embedded fourth
// order method (giving fifth-order accuracy) for the solution
@@ -24,8 +24,8 @@
//
// Constructor
G4CashKarpRKF45::G4CashKarpRKF45(G4Mag_EqRhs *EqRhs, G4int numberOfVariables):
G4MagIntegratorStepper(EqRhs, numberOfVariables)
G4CashKarpRKF45::G4CashKarpRKF45(G4Mag_EqRhs *EqRhs, G4int numberOfVariables)
: G4MagIntegratorStepper(EqRhs, numberOfVariables)
{
fNumberOfVariables = numberOfVariables ;
@@ -67,16 +67,15 @@ G4CashKarpRKF45::~G4CashKarpRKF45()
void
G4CashKarpRKF45::Stepper(const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double Step,
G4double yOut[],
G4double yErr[])
{
// const G4int nvar = 6 ;
// const G4double a2 = 0.2 , a3 = 0.3 , a4 = 0.6 , a5 = 1.0 , a6 = 0.875;
G4int i;
const G4double a2 = 0.2 , a3 = 0.3 , a4 = 0.6 , a5 = 1.0 , a6 = 0.875 ,
b21 = 0.2 ,
const G4double b21 = 0.2 ,
b31 = 3.0/40.0 , b32 = 9.0/40.0 ,
b41 = 0.3 , b42 = -0.9 , b43 = 1.2 ,
@@ -156,7 +155,7 @@ G4CashKarpRKF45::Stepper(const G4double yInput[],
void
G4CashKarpRKF45::StepWithEst(const G4double yInput[],
const G4double dydx[],
const G4double Step,
G4double Step,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ChordFinder.cc,v 1.14 2000/05/11 17:34:32 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ChordFinder.cc,v 1.16 2000/11/20 17:29:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// 25.02.97 John Apostolakis, design and implimentation
@@ -70,9 +70,9 @@ G4ChordFinder::~G4ChordFinder()
// ......................................................................
G4double
G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
const G4double stepMax,
const G4double epsStep )
G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
G4double stepMax,
G4double epsStep )
{
G4double stepPossible;
G4double dyErr;
@@ -122,7 +122,7 @@ G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
G4double
G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
const G4double stepMax,
G4double stepMax,
G4FieldTrack& yEnd, // Endpoint
G4double& dyErr, // Error of endpoint
G4double epsStep )
@@ -138,7 +138,7 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
// 2.) Evaluate if resulting chord gives d_chord that is good enough.
// 2a.) If d_chord is not good enough, find one that is.
G4bool validEndPoint= false, dbg= false;
G4bool validEndPoint= false;
G4double dChordStep, oldStepTrial, stepOfLastGoodChord;
fIntgrDriver-> GetDerivatives( yCurrent, dydx ) ;
@@ -225,10 +225,9 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
// ...........................................................................
G4double G4ChordFinder::NewStep(
const G4double stepTrialOld,
const G4double dChordStep, // Current dchord achieved.
G4double& stepEstimate_Unconstrained )
G4double G4ChordFinder::NewStep(G4double stepTrialOld,
G4double dChordStep, // Current dchord achieved.
G4double& stepEstimate_Unconstrained )
{
G4double stepTrial;
@@ -283,7 +282,7 @@ G4FieldTrack G4ChordFinder::ApproxCurvePointV(
const G4FieldTrack& CurveA_PointVelocity,
const G4FieldTrack& CurveB_PointVelocity,
const G4ThreeVector& CurrentE_Point,
const G4double eps_step)
G4double eps_step)
{
// 1st implementation:
// if r=|AE|/|AB|, and s=true path lenght (AB)
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ClassicalRK4.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ClassicalRK4.cc,v 1.3 2000/11/01 15:15:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4ClassicalRK4.hh"
#include "G4ThreeVector.hh"
@@ -16,9 +16,9 @@
//
// Constructor sets the number of variables (default = 6)
G4ClassicalRK4:: G4ClassicalRK4(G4Mag_EqRhs *EqRhs, G4int numberOfVariables):
G4MagErrorStepper(EqRhs, numberOfVariables),
fNumberOfVariables(numberOfVariables)
G4ClassicalRK4::G4ClassicalRK4(G4Mag_EqRhs *EqRhs, G4int numberOfVariables)
: G4MagErrorStepper(EqRhs, numberOfVariables),
fNumberOfVariables(numberOfVariables)
{
dydxm = new G4double[fNumberOfVariables];
dydxt = new G4double[fNumberOfVariables];
@@ -29,7 +29,7 @@ G4MagErrorStepper(EqRhs, numberOfVariables),
//
// Destructor
G4ClassicalRK4:: ~G4ClassicalRK4()
G4ClassicalRK4::~G4ClassicalRK4()
{
delete[] dydxm;
delete[] dydxt;
@@ -49,8 +49,8 @@ G4ClassicalRK4:: ~G4ClassicalRK4()
void
G4ClassicalRK4::DumbStepper( const G4double yIn[],
const G4double dydx[],
const G4double h,
G4double yOut[])
G4double h,
G4double yOut[])
{
const G4int nvar = fNumberOfVariables; // GetNumberOfVariables();
G4int i;
@@ -93,8 +93,8 @@ G4ClassicalRK4::DumbStepper( const G4double yIn[],
void
G4ClassicalRK4::StepWithEst( const G4double yIn[],
const G4double dydx[],
const G4double h,
G4double yOut[],
G4double h,
G4double yOut[],
G4double& alpha2,
G4double& beta2,
const G4double B1[],
@@ -104,7 +104,7 @@ G4ClassicalRK4::StepWithEst( const G4double yIn[],
G4Exception(" G4ClassicalRK4::StepWithEst ERROR: this Method is no longer used.");
#if 0 // const G4int nvar = 6 ;
const G4int nvar = GetNumberOfVariables();
G4int nvar = GetNumberOfVariables();
G4int i;
G4double hh = h*0.5 , h6 = h/6.0 ;
G4double B[3] ;
@@ -10,22 +10,20 @@
#include "G4EqMagElectricField.hh"
void
G4EqMagElectricField::
SetChargeMomentumMass( const G4double particleCharge, // e+ units
const G4double MomentumXc,
const G4double particleMass)
G4EqMagElectricField::SetChargeMomentumMass(G4double particleCharge, // e+ units
G4double MomentumXc,
G4double particleMass)
{
fElectroMagCof = eplus*c_squared ;
fElectroMagCof *= particleCharge/particleMass;
}
void
G4EqMagElectricField::EvaluateRhsGivenB( const G4double y[],
const G4double Field[],
G4double dydx[] ) const
G4EqMagElectricField::EvaluateRhsGivenB(const G4double y[],
const G4double Field[],
G4double dydx[] ) const
{
// Components of y:
@@ -5,13 +5,16 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4EquationOfMotion.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4EquationOfMotion.cc,v 1.3 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4EquationOfMotion.hh"
static const int G4maximum_number_of_field_components = 16;
G4EquationOfMotion::~G4EquationOfMotion()
{}
void
G4EquationOfMotion::RightHandSide( const G4double y[],
G4double dydx[] ) const
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ExplicitEuler.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ExplicitEuler.cc,v 1.3 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// Explicit Euler: x_1 = x_0 + h * dx_0
@@ -24,9 +24,9 @@
// Constructor
G4ExplicitEuler::G4ExplicitEuler(G4Mag_EqRhs *EqRhs,
G4int numberOfVariables) :
G4MagErrorStepper(EqRhs, numberOfVariables),
fNumberOfVariables(numberOfVariables)
G4int numberOfVariables)
: G4MagErrorStepper(EqRhs, numberOfVariables),
fNumberOfVariables(numberOfVariables)
{
}
@@ -37,7 +37,6 @@ G4ExplicitEuler::G4ExplicitEuler(G4Mag_EqRhs *EqRhs,
G4ExplicitEuler::~G4ExplicitEuler()
{
;
}
@@ -48,7 +47,7 @@ G4ExplicitEuler::~G4ExplicitEuler()
void
G4ExplicitEuler::DumbStepper( const G4double yIn[],
const G4double dydx[],
const G4double h,
G4double h,
G4double yOut[] )
{
// const G4int nvar = 6 ;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FieldManager.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4FieldManager.cc,v 1.3 2000/11/09 18:06:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4FieldManager.hh"
@@ -34,6 +34,8 @@ G4FieldManager::~G4FieldManager()
void
G4FieldManager::CreateChordFinder(G4MagneticField *detectorMagField)
{
if ( fAllocatedChordFinder )
delete fChordFinder;
fChordFinder= new G4ChordFinder( detectorMagField );
fAllocatedChordFinder= true;
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FieldTrack.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4FieldTrack.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4HelixExplicitEuler.cc,v 1.3 2000/04/12 18:29:26 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4HelixExplicitEuler.hh"
#include "G4ThreeVector.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4HelixHeum.cc,v 1.3 2000/04/12 18:29:26 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4HelixHeum.hh"
#include "G4ThreeVector.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4HelixImplicitEuler.cc,v 1.3 2000/04/12 18:29:26 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4HelixImplicitEuler.hh"
#include "G4ThreeVector.hh"
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4HelixSimpleRunge.cc,v 1.3 2000/04/12 18:29:26 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4HelixSimpleRunge.cc,v 1.4 2000/11/20 17:29:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4HelixSimpleRunge.hh"
#include "G4ThreeVector.hh"
@@ -31,7 +31,6 @@ G4HelixSimpleRunge::DumbStepper( const G4double yIn[],
G4double yOut[])
{
const G4int nvar = 6 ;
G4double dydxTemp[nvar];
G4double yTemp[nvar]; // , yAdd[nvar];
G4ThreeVector Bfld_midpoint;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ImplicitEuler.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ImplicitEuler.cc,v 1.3 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// Implicit Euler:
@@ -43,7 +43,6 @@ G4MagErrorStepper(EqRhs, numberOfVariables),
G4ImplicitEuler::~G4ImplicitEuler()
{
;
}
//////////////////////////////////////////////////////////////////////
@@ -53,7 +52,7 @@ G4ImplicitEuler::~G4ImplicitEuler()
void
G4ImplicitEuler::DumbStepper( const G4double yIn[],
const G4double dydx[],
const G4double h,
G4double h,
G4double yOut[])
{
// const G4int nvar = 6 ;
@@ -5,18 +5,18 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LineSection.cc,v 1.3 2000/02/25 16:57:15 grichine Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4LineSection.cc,v 1.4 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// typedef double G4double;
#include "G4LineSection.hh"
G4LineSection::G4LineSection( const G4ThreeVector& PntA,
const G4ThreeVector& PntB )
const G4ThreeVector& PntB )
: EndpointA(PntA),
VecAtoB(PntB-PntA)
{
EndpointA= PntA;
VecAtoB=PntB-PntA;
G4double distABsquared = VecAtoB.mag2() ;
if ( distABsquared == 0.0)
{
@@ -5,19 +5,27 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MagErrorStepper.cc,v 1.7 2000/05/09 11:41:00 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4MagErrorStepper.cc,v 1.8 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4MagErrorStepper.hh"
#include "G4ThreeVector.hh"
#include "G4LineSection.hh"
G4MagErrorStepper::~G4MagErrorStepper()
{
delete[] yMiddle;
delete[] dydxMid;
delete[] yInitial;
delete[] yOneStep;
}
void
G4MagErrorStepper::Stepper( const G4double yInput[],
const G4double dydx[],
const G4double hstep,
G4double yOutput[],
G4double yError [] )
const G4double dydx[],
G4double hstep,
G4double yOutput[],
G4double yError [] )
{
const G4int nvar = this->GetNumberOfVariables() ;
@@ -59,7 +67,7 @@ G4MagErrorStepper::Stepper( const G4double yInput[],
G4double
G4MagErrorStepper::DistChord() const
G4MagErrorStepper::DistChord() const
{
// Estimate the maximum distance from the curve to the chord
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MagHelicalStepper.cc,v 1.4 2000/04/12 18:29:26 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4MagHelicalStepper.cc,v 1.6 2000/11/20 17:29:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4MagHelicalStepper.hh"
#include "G4ThreeVector.hh"
@@ -25,6 +25,10 @@ G4MagHelicalStepper::G4MagHelicalStepper(G4Mag_EqRhs *EqRhs)
fPtrMagEqOfMot = EqRhs;
}
G4MagHelicalStepper::~G4MagHelicalStepper()
{
}
void
G4MagHelicalStepper::AdvanceHelix( const G4double yIn[],
G4ThreeVector Bfld,
@@ -125,16 +129,16 @@ G4MagHelicalStepper::AdvanceHelix( const G4double yIn[],
void
G4MagHelicalStepper::Stepper( const G4double yInput[],
const G4double dydx[],
const G4double hstep,
G4double yOut[],
G4double yErr[] )
const G4double dydx[],
G4double hstep,
G4double yOut[],
G4double yErr[] )
{
const G4int nvar = 6 ;
G4int i;
// correction for Richardson Extrapolation.
G4double correction = 1. / ( (1 << IntegratorOrder()) -1 );
// G4double correction = 1. / ( (1 << IntegratorOrder()) -1 );
G4double yTemp[7], yIn[7] ;
G4ThreeVector Bfld_initial, Bfld_midpoint;
@@ -182,7 +186,7 @@ G4MagHelicalStepper::Stepper( const G4double yInput[],
G4double
G4MagHelicalStepper::DistChord() const
G4MagHelicalStepper::DistChord() const
{
// Soon: must check whether h/R > 2 pi !!
// Method below is good only for < 2 pi
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MagIntegratorDriver.cc,v 1.12 2000/05/09 11:51:47 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4MagIntegratorDriver.cc,v 1.14 2000/11/20 17:29:05 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//
@@ -23,8 +23,7 @@
#include "G4ios.hh"
#include "G4MagIntegratorDriver.hh"
#include "G4FieldTrack.hh"
#include "geomdefs.hh"
// for kCarTolerance
#include "geomdefs.hh" // for kCarTolerance
// Stepsize can increase by no more than 5.0
// and decrease by no more than 1/10. = 0.1
@@ -33,14 +32,31 @@ const G4double G4MagInt_Driver::max_stepping_increase = 5.0;
const G4double G4MagInt_Driver::max_stepping_decrease = 0.1;
// The (default) maximum number of steps is Base divided by the order of Stepper
//
const G4int G4MagInt_Driver::fMaxStepBase = 5000;
// Constructor
//
G4MagInt_Driver::G4MagInt_Driver( G4double hminimum,
G4MagIntegratorStepper *pItsStepper,
G4int numComponents)
: nvar(numComponents)
{
RenewStepperAndAdjust( pItsStepper );
hminimum_val= hminimum;
fMaxNoSteps = fMaxStepBase / pIntStepper->IntegratorOrder();
}
// Destructor
//
G4MagInt_Driver::~G4MagInt_Driver()
{
}
G4bool
G4MagInt_Driver::AccurateAdvance(
G4FieldTrack& y_current,
const G4double hstep,
const G4double eps
)
G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
G4double hstep,
G4double eps )
// const G4double dydx[6], // We could may add this ??
// Runge-Kutta driver with adaptive stepsize control. Integrate starting
@@ -84,7 +100,7 @@ G4MagInt_Driver::AccurateAdvance(
G4bool lastStep= false;
nstp=1;
G4double lastStepThreshold = G4std::min( eps * hstep, Hmin() );
// G4double lastStepThreshold = G4std::min( eps * hstep, Hmin() );
do{
G4ThreeVector StartPos( y[0], y[1], y[2] );
@@ -242,8 +258,8 @@ void
G4MagInt_Driver::OneGoodStep( G4double y[],
const G4double dydx[],
G4double& x,
const G4double htry,
const G4double eps_rel_max,
G4double htry,
G4double eps_rel_max,
G4double& hdid,
G4double& hnext )
@@ -326,11 +342,11 @@ G4MagInt_Driver::OneGoodStep( G4double y[],
// QuickAdvance just tries one Step - it does not ensure accuracy
//
G4bool G4MagInt_Driver::QuickAdvance(
G4FieldTrack& y_posvel, // INOUT
const G4double dydx[],
G4double hstep, // In
G4double& dchord_step,
G4double& dyerr )
G4FieldTrack& y_posvel, // INOUT
const G4double dydx[],
G4double hstep, // In
G4double& dchord_step,
G4double& dyerr )
{
G4double yerr_vec[G4FieldTrack::ncompSVEC], yarrin[G4FieldTrack::ncompSVEC], yarrout[G4FieldTrack::ncompSVEC];
G4double s_start;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MagIntegratorStepper.cc,v 1.3 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4MagIntegratorStepper.cc,v 1.4 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4MagIntegratorStepper.hh"
@@ -15,8 +15,16 @@
G4MagIntegratorStepper::G4MagIntegratorStepper(G4Mag_EqRhs *EqRhs,
G4int num_var)
: fEquation_Rhs(EqRhs),
fNumberOfVariables(num_var)
{
fEquation_Rhs= EqRhs;
fNumberOfVariables = num_var;
}
G4MagIntegratorStepper::~G4MagIntegratorStepper()
{
}
void G4MagIntegratorStepper::RightHandSide( const double y[], double dydx[] )
{
fEquation_Rhs-> RightHandSide(y, dydx);
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Mag_EqRhs.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4Mag_EqRhs.cc,v 1.3 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// This is the standard right-hand side for equation of motion
// in a pure Magnetic Field .
@@ -31,9 +31,9 @@ G4Mag_EqRhs::G4Mag_EqRhs( G4MagneticField *magField )
}
void
G4Mag_EqRhs::SetChargeMomentumMass( const G4double particleCharge, // e+ units
const G4double MomentumXc,
const G4double particleMass)
G4Mag_EqRhs::SetChargeMomentumMass( G4double particleCharge, // e+ units
G4double MomentumXc,
G4double particleMass)
{
fCof_val = fUnitConstant*particleCharge/MomentumXc; // B must be in Tesla
// fMass = particleMass;
@@ -12,9 +12,9 @@
#include "globals.hh"
void
G4Mag_SpinEqRhs::SetChargeMomentumMass(const G4double particleCharge, // in e+ units
const G4double MomentumXc,
const G4double mass)
G4Mag_SpinEqRhs::SetChargeMomentumMass(G4double particleCharge, // in e+ units
G4double MomentumXc,
G4double mass)
{
// To set fCof_val
G4Mag_EqRhs::SetChargeMomentumMass(particleCharge, MomentumXc, mass);
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Mag_UsualEqRhs.cc,v 1.2 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
// This is the standard right-hand side for equation of motion.
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4RKG3_Stepper.cc,v 1.3 2000/05/09 11:54:23 japost Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4RKG3_Stepper.cc,v 1.5 2000/11/20 17:29:05 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4RKG3_Stepper.hh"
#include "G4ThreeVector.hh"
@@ -14,14 +14,14 @@
void G4RKG3_Stepper::Stepper( const G4double yInput[7],
const G4double dydx[7],
const G4double Step,
G4double Step,
G4double yOut[7],
G4double yErr[])
{
G4double B[3];
// G4double yderiv[6];
// G4double alpha2, beta2;
const G4int nvar = 6 ;
G4int nvar = 6 ;
// G4double beTemp2, beta2=0;
G4int i;
@@ -84,7 +84,7 @@ void G4RKG3_Stepper::Stepper( const G4double yInput[7],
void G4RKG3_Stepper::StepWithEst( const G4double tIn[7],
const G4double dydx[7],
const G4double Step,
G4double Step,
G4double tOut[7],
G4double& alpha2,
G4double& beta2,
@@ -96,7 +96,7 @@ void G4RKG3_Stepper::StepWithEst( const G4double tIn[7],
G4Exception(" G4RKG3_Stepper::StepWithEst ERROR: this Method is no longer used.");
#if 0
// const G4int nvar = 6 ;
// G4int nvar = 6 ;
G4double K1[7],K2[7],K3[7],K4[7] ;
G4double tTemp[7], yderiv[6] ;
G4double B[3];
@@ -170,9 +170,9 @@ void G4RKG3_Stepper::StepWithEst( const G4double tIn[7],
void G4RKG3_Stepper::StepNoErr(const G4double tIn[7],
const G4double dydx[7],
const G4double Step,
G4double tOut[7],
G4double B[3] ) // const
G4double Step,
G4double tOut[7],
G4double B[3] ) // const
{
// Copy and edit the routine above, to delete alpha2, beta2, ...
@@ -212,7 +212,6 @@ void G4RKG3_Stepper::StepNoErr(const G4double tIn[7],
// Calculates y-deriv(atives) & returns B too!
GetEquationOfMotion()->EvaluateRhsReturnB(tTemp,yderiv,B) ;
G4double drds2 = 0 ;
for(i=0;i<3;i++) // Output trajectory vector
{
K4[i] = Step * yderiv[i+3];
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SimpleHeum.cc,v 1.3 1999/12/15 14:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4SimpleHeum.cc,v 1.4 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// Simple Heum:
// x_1 = x_0 + h *
@@ -56,9 +56,9 @@ G4SimpleHeum::~G4SimpleHeum()
void
G4SimpleHeum::DumbStepper( const G4double yIn[],
const G4double dydx[],
const G4double h,
G4double yOut[])
const G4double dydx[],
G4double h,
G4double yOut[])
{
// const G4int nvar = 6 ;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4SimpleRunge.cc,v 1.2 1999/12/15 14:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4SimpleRunge.cc,v 1.3 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// Simple Runge:
//
@@ -29,9 +29,9 @@
//
// Constructor
G4SimpleRunge::G4SimpleRunge(G4Mag_EqRhs *EqRhs, G4int numberOfVariables):
G4MagErrorStepper(EqRhs, numberOfVariables),
fNumberOfVariables(numberOfVariables)
G4SimpleRunge::G4SimpleRunge(G4Mag_EqRhs *EqRhs, G4int numberOfVariables)
: G4MagErrorStepper(EqRhs, numberOfVariables),
fNumberOfVariables(numberOfVariables)
{
dydxTemp = new G4double[fNumberOfVariables] ;
yTemp = new G4double[fNumberOfVariables] ;
@@ -55,7 +55,7 @@ G4SimpleRunge::~G4SimpleRunge()
void
G4SimpleRunge::DumbStepper( const G4double yIn[],
const G4double dydx[],
const G4double h,
G4double h,
G4double yOut[])
{
// const G4int nvar = 6 ;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4UniformElectricField.cc,v 1.2 1999/12/15 14:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UniformMagField.cc,v 1.2 1999/12/15 14:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4UniformMagField.cc,v 1.3 2000/11/01 15:15:53 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//
//
@@ -64,6 +64,7 @@ G4UniformMagField::G4UniformMagField (const G4UniformMagField &p)
G4UniformMagField& G4UniformMagField::operator = (const G4UniformMagField &p)
{
if (&p == this) return *this;
for (G4int i=0; i<3; i++)
fFieldComponents[i] = p.fFieldComponents[i];
return *this;