Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4CashKarpRKF45.hh,v 1.3 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4CashKarpRKF45.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4CashKarpRKF45
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "G4MagIntegratorStepper.hh"
|
||||
|
||||
class G4CashKarpRKF45: public G4MagIntegratorStepper
|
||||
class G4CashKarpRKF45 : public G4MagIntegratorStepper
|
||||
{
|
||||
|
||||
public: // with description
|
||||
@@ -38,13 +38,13 @@ class G4CashKarpRKF45: public G4MagIntegratorStepper
|
||||
|
||||
void Stepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double h,
|
||||
G4double yout[],
|
||||
G4double yerr[] ) ;
|
||||
|
||||
void StepWithEst( const G4double yIn[],
|
||||
const G4double dydx[],
|
||||
const G4double Step,
|
||||
G4double Step,
|
||||
G4double yOut[],
|
||||
G4double& alpha2,
|
||||
G4double& beta2,
|
||||
@@ -55,7 +55,13 @@ class G4CashKarpRKF45: public G4MagIntegratorStepper
|
||||
|
||||
G4double DistChord() const = 0 ; // This is not IMPLEMENTED yet.
|
||||
// It must be done before it can work.
|
||||
G4int IntegratorOrder() { return 4 ; };
|
||||
G4int IntegratorOrder() const { return 4; }
|
||||
|
||||
private:
|
||||
|
||||
G4CashKarpRKF45(const G4CashKarpRKF45&);
|
||||
G4CashKarpRKF45& operator=(const G4CashKarpRKF45&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ChordFinder.hh,v 1.4 2000/05/11 14:47:00 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4ChordFinder.hh,v 1.5 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4ChordFinder
|
||||
@@ -45,8 +45,8 @@ class G4ChordFinder
|
||||
|
||||
|
||||
G4double AdvanceChordLimited( G4FieldTrack& yCurrent,
|
||||
const G4double stepInitial,
|
||||
const G4double epsStep_Relative );
|
||||
G4double stepInitial,
|
||||
G4double epsStep_Relative );
|
||||
// Uses ODE solver's driver to find the endpoint that satisfies
|
||||
// the chord criterion: that d_chord < delta_chord
|
||||
// -> Returns Length of Step taken.
|
||||
@@ -54,34 +54,40 @@ class G4ChordFinder
|
||||
G4FieldTrack ApproxCurvePointV(const G4FieldTrack& curveAPointVelocity,
|
||||
const G4FieldTrack& curveBPointVelocity,
|
||||
const G4ThreeVector& currentEPoint,
|
||||
const G4double epsStep);
|
||||
G4double epsStep);
|
||||
|
||||
G4double GetDeltaChord();
|
||||
void SetDeltaChord( G4double newval);
|
||||
inline G4double GetDeltaChord() const;
|
||||
inline void SetDeltaChord(G4double newval);
|
||||
|
||||
void SetChargeMomentumMass( const G4double pCharge, // in e+ units
|
||||
const G4double pMomentum,
|
||||
const G4double pMass );
|
||||
inline void SetChargeMomentumMass(G4double pCharge, // in e+ units
|
||||
G4double pMomentum,
|
||||
G4double pMass );
|
||||
// Function to inform integration driver of charge, speed.
|
||||
|
||||
void SetIntegrationDriver(G4MagInt_Driver* IntegrationDriver);
|
||||
G4MagInt_Driver* GetIntegrationDriver();
|
||||
inline void SetIntegrationDriver(G4MagInt_Driver* IntegrationDriver);
|
||||
inline G4MagInt_Driver* GetIntegrationDriver();
|
||||
// Access and set Driver.
|
||||
|
||||
protected: // .........................................................
|
||||
|
||||
G4bool AcceptableMissDist(G4double dChordStep);
|
||||
inline G4bool AcceptableMissDist(G4double dChordStep) const;
|
||||
|
||||
G4double NewStep( const G4double stepTrialOld,
|
||||
const G4double dChordStep, // Current dchord estimate
|
||||
G4double& stepEstimate_Unconstrained ) ;
|
||||
G4double NewStep( G4double stepTrialOld,
|
||||
G4double dChordStep, // Current dchord estimate
|
||||
G4double& stepEstimate_Unconstrained ) ;
|
||||
|
||||
G4double FindNextChord( const G4FieldTrack yStart,
|
||||
const G4double stepMax,
|
||||
G4double stepMax,
|
||||
G4FieldTrack& yEnd,
|
||||
G4double& dyErr, // Error of endpoint
|
||||
G4double epsStep );
|
||||
|
||||
private: // ............................................................
|
||||
|
||||
G4ChordFinder(const G4ChordFinder&);
|
||||
G4ChordFinder& operator=(const G4ChordFinder&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private: // ............................................................
|
||||
// G4int nOK, nBAD;
|
||||
G4MagInt_Driver* fIntgrDriver;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ChordFinder.icc,v 1.1 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4ChordFinder.icc,v 1.2 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G4ChordFinder inline implementations
|
||||
//
|
||||
@@ -33,21 +33,21 @@ G4MagInt_Driver* G4ChordFinder::GetIntegrationDriver()
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4ChordFinder::AcceptableMissDist(G4double dChordStep)
|
||||
G4bool G4ChordFinder::AcceptableMissDist(G4double dChordStep) const
|
||||
{
|
||||
return (dChordStep <= fDeltaChord) ;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4ChordFinder::SetChargeMomentumMass(const G4double pCharge, // in e+ units
|
||||
const G4double pMomentum,
|
||||
const G4double pMass)
|
||||
void G4ChordFinder::SetChargeMomentumMass(G4double pCharge, // in e+ units
|
||||
G4double pMomentum,
|
||||
G4double pMass)
|
||||
{
|
||||
fIntgrDriver-> SetChargeMomentumMass(pCharge, pMomentum, pMass);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4ChordFinder::GetDeltaChord()
|
||||
G4double G4ChordFinder::GetDeltaChord() const
|
||||
{
|
||||
return fDeltaChord;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ClassicalRK4.hh,v 1.3 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4ClassicalRK4.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4ClassicalRK4
|
||||
@@ -36,8 +36,8 @@ class G4ClassicalRK4 : public G4MagErrorStepper
|
||||
|
||||
void DumbStepper( const G4double yIn[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double yOut[]) ;
|
||||
G4double h,
|
||||
G4double yOut[]) ;
|
||||
// Given values for the variables y[0,..,n-1] and their derivatives
|
||||
// dydx[0,...,n-1] known at x, use the classical 4th Runge-Kutta
|
||||
// method to advance the solution over an interval h and return the
|
||||
@@ -50,16 +50,22 @@ class G4ClassicalRK4 : public G4MagErrorStepper
|
||||
|
||||
void StepWithEst( const G4double yIn[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double h,
|
||||
G4double yOut[],
|
||||
G4double& alpha2,
|
||||
G4double& beta2,
|
||||
const G4double B1[],
|
||||
G4double B2[] );
|
||||
G4double B2[] );
|
||||
|
||||
// Could make above G4SixPoint to keep tangents too ...?
|
||||
|
||||
G4int IntegratorOrder() { return 4; };
|
||||
G4int IntegratorOrder() const { return 4; }
|
||||
|
||||
private:
|
||||
|
||||
G4ClassicalRK4(const G4ClassicalRK4&);
|
||||
G4ClassicalRK4& operator=(const G4ClassicalRK4&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ElectroMagneticField.hh,v 1.3 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4ElectroMagneticField.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4ElectroMagneticField
|
||||
@@ -32,19 +32,21 @@ class G4ElectroMagneticField : public G4MagneticField
|
||||
G4ElectroMagneticField() {;}
|
||||
virtual ~G4ElectroMagneticField() {;}
|
||||
|
||||
G4ElectroMagneticField(const G4ElectroMagneticField &p) {;}
|
||||
G4ElectroMagneticField& operator = (const G4ElectroMagneticField &p);
|
||||
G4ElectroMagneticField(const G4ElectroMagneticField &) {;}
|
||||
G4ElectroMagneticField& operator = (const G4ElectroMagneticField &);
|
||||
// Copy constructor & assignment operators.
|
||||
|
||||
virtual void GetFieldValue( const double Point[3],
|
||||
double *Bfield ) const = 0;
|
||||
virtual void GetFieldValue(const G4double Point[3],
|
||||
G4double *Bfield ) const = 0;
|
||||
};
|
||||
|
||||
// Inline implementations
|
||||
|
||||
inline G4ElectroMagneticField&
|
||||
inline
|
||||
G4ElectroMagneticField&
|
||||
G4ElectroMagneticField::operator = (const G4ElectroMagneticField &p)
|
||||
{
|
||||
if (&p == this) return *this;
|
||||
*this = p; return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4EqMagElectricField.hh,v 1.3 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4EqMagElectricField.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4EqMagElectricField
|
||||
@@ -34,13 +34,13 @@ class G4EqMagElectricField : public G4Mag_EqRhs
|
||||
|
||||
~G4EqMagElectricField() {;}
|
||||
|
||||
void SetChargeMomentumMass( const G4double particleCharge, // in e+ units
|
||||
const G4double MomentumXc,
|
||||
const G4double mass);
|
||||
void SetChargeMomentumMass(G4double particleCharge, // in e+ units
|
||||
G4double MomentumXc,
|
||||
G4double mass);
|
||||
|
||||
void EvaluateRhsGivenB( const G4double y[],
|
||||
const G4double Field[],
|
||||
G4double dydx[] ) const;
|
||||
void EvaluateRhsGivenB(const G4double y[],
|
||||
const G4double Field[],
|
||||
G4double dydx[] ) const;
|
||||
// Given the value of the electromagnetic field, this function
|
||||
// calculates the value of the derivative dydx.
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4EquationOfMotion.hh,v 1.3 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4EquationOfMotion.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4EquationOfMotion
|
||||
@@ -42,10 +42,9 @@ class G4EquationOfMotion
|
||||
// This is the _only_ function a subclass must define.
|
||||
// The other two functions use Rhs_givenB.
|
||||
|
||||
virtual void SetChargeMomentumMass(
|
||||
const G4double particleCharge, // in e+ units
|
||||
const G4double MomentumXc,
|
||||
const G4double MassXc2) = 0;
|
||||
virtual void SetChargeMomentumMass(G4double particleCharge, // in e+ units
|
||||
G4double MomentumXc,
|
||||
G4double MassXc2) = 0;
|
||||
// Set the charge, momentum and mass of the current particle
|
||||
// --> used to set the equation's coefficients ...
|
||||
|
||||
@@ -67,8 +66,8 @@ class G4EquationOfMotion
|
||||
// Obtain only the field - the stepper assumes it is pure Magnetic.
|
||||
// Not protected, because G4RKG3_Stepper uses it directly.
|
||||
|
||||
G4Field* GetFieldObj();
|
||||
void SetFieldObj(G4Field* pField);
|
||||
const G4Field* GetFieldObj() const;
|
||||
void SetFieldObj(G4Field* pField);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4EquationOfMotion.icc,v 1.3 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4EquationOfMotion.icc,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// Inline implementation
|
||||
@@ -18,11 +18,7 @@ G4EquationOfMotion::G4EquationOfMotion(G4Field* pField)
|
||||
{}
|
||||
|
||||
inline
|
||||
G4EquationOfMotion::~G4EquationOfMotion()
|
||||
{}
|
||||
|
||||
inline
|
||||
G4Field* G4EquationOfMotion::GetFieldObj()
|
||||
const G4Field* G4EquationOfMotion::GetFieldObj() const
|
||||
{
|
||||
return itsField;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ExplicitEuler.hh,v 1.3 2000/04/27 09:14:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4ExplicitEuler.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4ExplicitEuler
|
||||
@@ -35,12 +35,12 @@ class G4ExplicitEuler : public G4MagErrorStepper
|
||||
|
||||
void DumbStepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double h,
|
||||
G4double yout[]);
|
||||
|
||||
public: // without description
|
||||
|
||||
G4int IntegratorOrder() { return 1; };
|
||||
G4int IntegratorOrder() const { return 1; }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Field.hh,v 1.3 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Field.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4Field
|
||||
@@ -29,8 +29,8 @@ class G4Field
|
||||
|
||||
virtual void GetFieldValue( const double Point[3],
|
||||
double *Bfield ) const = 0;
|
||||
G4Field(){};
|
||||
virtual ~G4Field(){};
|
||||
G4Field(){;}
|
||||
virtual ~G4Field(){;}
|
||||
|
||||
// A field signature function that can be used to insure
|
||||
// that the Equation of motion object and the G4Field object
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FieldManager.hh,v 1.3 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4FieldManager.hh,v 1.5 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4FieldManager
|
||||
@@ -35,6 +35,9 @@
|
||||
// A default FieldManager is created by the singleton class
|
||||
// G4NavigatorForTracking and exists before main is called.
|
||||
// However a new one can be created and given to G4NavigatorForTracking.
|
||||
//
|
||||
// Our current design envisions that one Field manager is
|
||||
// valid for each region detector.
|
||||
|
||||
// History:
|
||||
// - 10.03.97 John Apostolakis, design and implementation.
|
||||
@@ -54,13 +57,34 @@ class G4FieldManager
|
||||
G4FieldManager(G4MagneticField *detectorField);
|
||||
~G4FieldManager();
|
||||
|
||||
G4bool SetDetectorField(G4Field *detectorField);
|
||||
G4Field* GetDetectorField();
|
||||
G4bool DoesFieldExist();
|
||||
inline G4bool SetDetectorField(G4Field *detectorField);
|
||||
inline const G4Field* GetDetectorField() const;
|
||||
inline G4bool DoesFieldExist() const;
|
||||
|
||||
void CreateChordFinder(G4MagneticField *detectorMagField);
|
||||
void SetChordFinder(G4ChordFinder *aChordFinder);
|
||||
G4ChordFinder* GetChordFinder();
|
||||
inline void SetChordFinder(G4ChordFinder *aChordFinder);
|
||||
inline G4ChordFinder* GetChordFinder();
|
||||
|
||||
public: // without description
|
||||
|
||||
inline G4double GetDeltaIntersection() const;
|
||||
// Accuracy for boundary intersection.
|
||||
|
||||
inline G4double GetDeltaOneStep() const;
|
||||
// Accuracy for one tracking/physics step.
|
||||
|
||||
inline void SetAccuraciesWithDeltaOneStep(G4double valDeltaOneStep);
|
||||
// Sets both accuracies, maintaining a fixed ratio for accuracties
|
||||
// of volume Intersection and Integration (in One Step)
|
||||
|
||||
inline void SetDeltaOneStep(G4double valueD1step);
|
||||
inline void SetDeltaIntersection(G4double valueDintersection);
|
||||
|
||||
private:
|
||||
|
||||
G4FieldManager(const G4FieldManager&);
|
||||
G4FieldManager& operator=(const G4FieldManager&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
@@ -69,10 +93,19 @@ class G4FieldManager
|
||||
|
||||
G4bool fAllocatedChordFinder; // Did we used "new" to
|
||||
// create fChordFinder ?
|
||||
|
||||
// Values for the required accuracies
|
||||
//
|
||||
G4double fDelta_One_Step_Value; // for one tracking/physics step
|
||||
G4double fDelta_Intersection_Val; // for boundary intersection
|
||||
|
||||
// Their default values ... (set in G4PropagatemagField.cc)
|
||||
//
|
||||
static const G4double fDefault_Delta_One_Step_Value; // = 0.25 * mm;
|
||||
static const G4double fDefault_Delta_Intersection_Val; // = 0.1 * mm;
|
||||
};
|
||||
|
||||
// Our current design envisions that one Field manager is
|
||||
// valid for a detector.
|
||||
// Our current design envisions that one Field manager is valid for a region of the detector.
|
||||
// (eg a detector with electric E and magnetic B field will now treat
|
||||
// them as one field - and could treat any other field of importance
|
||||
// as additional components of a single field.)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FieldManager.icc,v 1.1 2000/04/27 16:27:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4FieldManager.icc,v 1.3 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// G4FieldManager inline implementation
|
||||
@@ -20,14 +20,14 @@ G4bool G4FieldManager::SetDetectorField(G4Field *detectorField)
|
||||
}
|
||||
|
||||
inline
|
||||
G4Field* G4FieldManager::GetDetectorField()
|
||||
const G4Field* G4FieldManager::GetDetectorField() const
|
||||
{
|
||||
// If pointer is null, should this raise an exception ??
|
||||
return fDetectorField;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4FieldManager::DoesFieldExist()
|
||||
G4bool G4FieldManager::DoesFieldExist() const
|
||||
{
|
||||
return (fDetectorField != 0);
|
||||
}
|
||||
@@ -43,3 +43,34 @@ G4ChordFinder* G4FieldManager::GetChordFinder()
|
||||
{
|
||||
return fChordFinder;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4FieldManager::GetDeltaIntersection() const
|
||||
{
|
||||
return fDelta_Intersection_Val;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4FieldManager::GetDeltaOneStep() const
|
||||
{
|
||||
return fDelta_One_Step_Value;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4FieldManager::SetDeltaOneStep(G4double valDeltaOneStep)
|
||||
{
|
||||
fDelta_One_Step_Value= valDeltaOneStep;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4FieldManager::SetDeltaIntersection(G4double valDeltaIntersection)
|
||||
{
|
||||
fDelta_Intersection_Val = valDeltaIntersection;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4FieldManager::SetAccuraciesWithDeltaOneStep(G4double valDeltaOneStep)
|
||||
{
|
||||
fDelta_One_Step_Value= valDeltaOneStep;
|
||||
fDelta_Intersection_Val = 0.4 * fDelta_One_Step_Value;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FieldTrack.hh,v 1.3 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4FieldTrack.hh,v 1.4 2000/11/01 15:15:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4FieldTrack
|
||||
@@ -36,10 +36,10 @@ class G4FieldTrack
|
||||
|
||||
G4FieldTrack( const G4ThreeVector& pPosition,
|
||||
const G4ThreeVector& pVelocity, // Or UnitVelocity
|
||||
const G4double curve_length,
|
||||
const G4double Energy,
|
||||
const G4double LabratTimeOfFlight=0.0,
|
||||
const G4double ProperTimeOfFlight=0.0,
|
||||
G4double curve_length,
|
||||
G4double Energy,
|
||||
G4double LabratTimeOfFlight=0.0,
|
||||
G4double ProperTimeOfFlight=0.0,
|
||||
const G4ThreeVector* pSpin=0);
|
||||
|
||||
G4FieldTrack( const G4FieldTrack& pFieldTrack );
|
||||
@@ -47,48 +47,49 @@ class G4FieldTrack
|
||||
~G4FieldTrack();
|
||||
// Destructor
|
||||
|
||||
G4FieldTrack& operator = ( const G4FieldTrack & rStVec );
|
||||
// Equality operator
|
||||
inline G4FieldTrack& operator = ( const G4FieldTrack & rStVec );
|
||||
// Assignment operator
|
||||
|
||||
G4ThreeVector GetVelocity() const;
|
||||
G4ThreeVector GetPosition() const;
|
||||
const G4ThreeVector& GetMomentumDir() const;
|
||||
G4double GetCurveLength() const;
|
||||
inline G4ThreeVector GetVelocity() const;
|
||||
inline G4ThreeVector GetPosition() const;
|
||||
inline const G4ThreeVector& GetMomentumDir() const;
|
||||
inline G4double GetCurveLength() const;
|
||||
// Distance along curve of point.
|
||||
G4double GetMomentumModulus() const;
|
||||
G4ThreeVector GetSpin() const;
|
||||
G4double GetLabTimeOfFlight() const;
|
||||
G4double GetProperTimeOfFlight() const;
|
||||
inline G4double GetMomentumModulus() const;
|
||||
inline G4ThreeVector GetSpin() const;
|
||||
inline G4double GetLabTimeOfFlight() const;
|
||||
inline G4double GetProperTimeOfFlight() const;
|
||||
// Accessors.
|
||||
|
||||
void SetPosition(G4ThreeVector nPos);
|
||||
void SetVelocity(G4ThreeVector nMomDir);
|
||||
inline void SetPosition(G4ThreeVector nPos);
|
||||
inline void SetVelocity(G4ThreeVector nMomDir);
|
||||
// Does change mom-dir too.
|
||||
void SetMomentumDir(G4ThreeVector nMomDir);
|
||||
inline void SetMomentumDir(G4ThreeVector nMomDir);
|
||||
// Does NOT change velocity.
|
||||
void SetCurveLength(G4double nCurve_s);
|
||||
inline void SetCurveLength(G4double nCurve_s);
|
||||
// Distance along curve.
|
||||
void SetEnergy(G4double nEnergy);
|
||||
inline void SetEnergy(G4double nEnergy);
|
||||
// Does not modify momentum.
|
||||
void SetMomentumModulus(G4double nMomentumMod);
|
||||
inline void SetMomentumModulus(G4double nMomentumMod);
|
||||
// Does not modify energy.
|
||||
void SetSpin(G4ThreeVector nSpin);
|
||||
void SetLabTimeOfFlight(G4double nTOF);
|
||||
void SetProperTimeOfFlight(G4double nTOF);
|
||||
inline void SetSpin(G4ThreeVector nSpin);
|
||||
inline void SetLabTimeOfFlight(G4double nTOF);
|
||||
inline void SetProperTimeOfFlight(G4double nTOF);
|
||||
// Modifiers
|
||||
|
||||
public: // without description
|
||||
|
||||
G4FieldTrack& SetCurvePnt(const G4ThreeVector& pPosition,
|
||||
const G4ThreeVector& pVelocity,
|
||||
const G4double s_curve );
|
||||
inline G4FieldTrack& SetCurvePnt(const G4ThreeVector& pPosition,
|
||||
const G4ThreeVector& pVelocity,
|
||||
G4double s_curve );
|
||||
// Old multi-set method
|
||||
|
||||
G4ThreeVector Position() const;
|
||||
inline G4ThreeVector Position() const;
|
||||
// Renamed to GetPosition
|
||||
|
||||
G4double CurveS() const; // distance along curve of point
|
||||
void SetCurveS(G4double new_curve_s);
|
||||
inline G4double CurveS() const;
|
||||
// Distance along curve of point
|
||||
inline void SetCurveS(G4double new_curve_s);
|
||||
// Old methods to be deleted.
|
||||
|
||||
// G4double GetEnergy() const; // Wrong Energy --> FIXME
|
||||
@@ -99,8 +100,8 @@ class G4FieldTrack
|
||||
// static const G4int ncompSVEC=15;
|
||||
// Needed and should be used only for RK integration driver
|
||||
enum { ncompSVEC = 16 };
|
||||
void DumpToArray( G4double valArr[ncompSVEC] ) const;
|
||||
void LoadFromArray( const G4double valArr[ncompSVEC] );
|
||||
inline void DumpToArray(G4double valArr[ncompSVEC]) const;
|
||||
inline void LoadFromArray(G4double valArr[ncompSVEC]);
|
||||
|
||||
friend G4std::ostream&
|
||||
operator<<( G4std::ostream& os, G4FieldTrack& SixVec);
|
||||
|
||||
@@ -5,15 +5,59 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FieldTrack.icc,v 1.2 1999/12/15 14:49:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4FieldTrack.icc,v 1.4 2000/11/20 17:29:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#include "PhysicalConstants.h"
|
||||
|
||||
inline
|
||||
G4FieldTrack::G4FieldTrack( const G4ThreeVector& pPosition,
|
||||
const G4ThreeVector& pVelocity, // Can be unit
|
||||
G4double curve_length,
|
||||
G4double pEnergy,
|
||||
G4double pLabortTimeOfFlight,
|
||||
G4double pProperTimeOfFlight,
|
||||
const G4ThreeVector* pSpin)
|
||||
: fEnergy(pEnergy),
|
||||
fLabTimeOfFlight(pLabortTimeOfFlight),
|
||||
fProperTimeOfFlight(pProperTimeOfFlight),
|
||||
fMomentumDir(pVelocity.unit())
|
||||
{
|
||||
SetCurvePnt( pPosition, pVelocity, curve_length );
|
||||
if(pSpin) fSpin = *pSpin;
|
||||
}
|
||||
|
||||
inline
|
||||
G4FieldTrack::G4FieldTrack( const G4FieldTrack& rStVec )
|
||||
: fDistanceAlongCurve( rStVec.fDistanceAlongCurve),
|
||||
fEnergy( rStVec.fEnergy ),
|
||||
fLabTimeOfFlight( rStVec.fLabTimeOfFlight ),
|
||||
fProperTimeOfFlight( rStVec.fProperTimeOfFlight ),
|
||||
fMomentumModulus( rStVec.fMomentumModulus ),
|
||||
fSpin( rStVec.fSpin ),
|
||||
fMomentumDir( rStVec.fMomentumDir )
|
||||
{
|
||||
SixVector[0]= rStVec.SixVector[0];
|
||||
SixVector[1]= rStVec.SixVector[1];
|
||||
SixVector[2]= rStVec.SixVector[2];
|
||||
SixVector[3]= rStVec.SixVector[3];
|
||||
SixVector[4]= rStVec.SixVector[4];
|
||||
SixVector[5]= rStVec.SixVector[5];
|
||||
// Old code:
|
||||
// SetCurvePnt(rStVec.GetPosition(),
|
||||
// rStVec.GetMomentumDir(),
|
||||
// rStVec.GetCurveLength() ); // Slow, so changed it
|
||||
}
|
||||
|
||||
inline
|
||||
G4FieldTrack::~G4FieldTrack()
|
||||
{
|
||||
}
|
||||
|
||||
inline G4FieldTrack&
|
||||
G4FieldTrack::SetCurvePnt( const G4ThreeVector& pPosition,
|
||||
G4FieldTrack::SetCurvePnt(const G4ThreeVector& pPosition,
|
||||
const G4ThreeVector& pVelocity, // Can be Unit
|
||||
const G4double s_curve )
|
||||
G4double s_curve )
|
||||
{
|
||||
SixVector[0] = pPosition.x();
|
||||
SixVector[1] = pPosition.y();
|
||||
@@ -31,54 +75,14 @@ G4FieldTrack::SetCurvePnt( const G4ThreeVector& pPosition,
|
||||
}
|
||||
|
||||
inline
|
||||
G4FieldTrack::G4FieldTrack( const G4ThreeVector& pPosition,
|
||||
const G4ThreeVector& pVelocity, // Can be unit
|
||||
const G4double curve_length,
|
||||
const G4double pEnergy,
|
||||
const G4double pLabortTimeOfFlight,
|
||||
const G4double pProperTimeOfFlight,
|
||||
const G4ThreeVector* pSpin) :
|
||||
fEnergy(pEnergy),
|
||||
fLabTimeOfFlight(pLabortTimeOfFlight),
|
||||
fProperTimeOfFlight(pProperTimeOfFlight)
|
||||
{
|
||||
SetCurvePnt( pPosition, pVelocity, curve_length );
|
||||
if(pSpin){ fSpin= *pSpin; }
|
||||
fMomentumDir = pVelocity.unit();
|
||||
}
|
||||
|
||||
inline
|
||||
G4FieldTrack::G4FieldTrack( const G4FieldTrack& rStVec ) :
|
||||
fEnergy( rStVec.fEnergy ),
|
||||
fLabTimeOfFlight( rStVec.fLabTimeOfFlight ),
|
||||
fProperTimeOfFlight( rStVec.fProperTimeOfFlight ),
|
||||
fMomentumModulus( rStVec.fMomentumModulus ),
|
||||
fMomentumDir( rStVec.fMomentumDir ),
|
||||
fSpin( rStVec.fSpin ),
|
||||
fDistanceAlongCurve( rStVec.fDistanceAlongCurve)
|
||||
{
|
||||
SixVector[0]= rStVec.SixVector[0];
|
||||
SixVector[1]= rStVec.SixVector[1];
|
||||
SixVector[2]= rStVec.SixVector[2];
|
||||
SixVector[3]= rStVec.SixVector[3];
|
||||
SixVector[4]= rStVec.SixVector[4];
|
||||
SixVector[5]= rStVec.SixVector[5];
|
||||
// Old code:
|
||||
// SetCurvePnt(rStVec.GetPosition(),
|
||||
// rStVec.GetMomentumDir(),
|
||||
// rStVec.GetCurveLength() ); // Slow, so changed it
|
||||
}
|
||||
|
||||
// Destructor
|
||||
inline G4FieldTrack::~G4FieldTrack(){}
|
||||
|
||||
inline G4ThreeVector G4FieldTrack::GetPosition() const
|
||||
G4ThreeVector G4FieldTrack::GetPosition() const
|
||||
{
|
||||
G4ThreeVector myPosition( SixVector[0], SixVector[1], SixVector[2] );
|
||||
return myPosition;
|
||||
}
|
||||
|
||||
inline void G4FieldTrack::SetPosition( G4ThreeVector pPosition)
|
||||
inline
|
||||
void G4FieldTrack::SetPosition( G4ThreeVector pPosition)
|
||||
{
|
||||
SixVector[0] = pPosition.x();
|
||||
SixVector[1] = pPosition.y();
|
||||
@@ -86,72 +90,120 @@ inline void G4FieldTrack::SetPosition( G4ThreeVector pPosition)
|
||||
}
|
||||
|
||||
// Older ... obsolete
|
||||
inline G4ThreeVector G4FieldTrack::Position() const
|
||||
inline
|
||||
G4ThreeVector G4FieldTrack::Position() const
|
||||
{
|
||||
return this->GetPosition();
|
||||
}
|
||||
|
||||
inline const G4ThreeVector& G4FieldTrack::GetMomentumDir() const
|
||||
inline
|
||||
const G4ThreeVector& G4FieldTrack::GetMomentumDir() const
|
||||
{
|
||||
// G4ThreeVector myVelocity( SixVector[3], SixVector[4], SixVector[5] );
|
||||
// return myVelocity;
|
||||
return fMomentumDir;
|
||||
}
|
||||
|
||||
inline G4double G4FieldTrack::GetCurveLength() const
|
||||
inline
|
||||
G4double G4FieldTrack::GetCurveLength() const
|
||||
{
|
||||
return fDistanceAlongCurve;
|
||||
}
|
||||
|
||||
inline G4double G4FieldTrack::CurveS() const
|
||||
inline
|
||||
G4double G4FieldTrack::CurveS() const
|
||||
{
|
||||
return this->GetCurveLength();
|
||||
}
|
||||
|
||||
inline void G4FieldTrack::SetCurveLength(G4double nCurve_s)
|
||||
inline
|
||||
void G4FieldTrack::SetCurveLength(G4double nCurve_s)
|
||||
{
|
||||
fDistanceAlongCurve= nCurve_s;
|
||||
}
|
||||
|
||||
inline void G4FieldTrack::SetCurveS(G4double new_curve_s)
|
||||
inline
|
||||
void G4FieldTrack::SetCurveS(G4double new_curve_s)
|
||||
{
|
||||
this->SetCurveLength(new_curve_s);
|
||||
}
|
||||
|
||||
#ifdef ENERGY_OK
|
||||
inline G4double G4FieldTrack::GetEnergy() const
|
||||
{ return fEnergy;}
|
||||
inline
|
||||
G4double G4FieldTrack::GetEnergy() const
|
||||
{
|
||||
return fEnergy;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void G4FieldTrack::SetEnergy(G4double nEnergy)
|
||||
{ fEnergy=nEnergy;}
|
||||
inline G4ThreeVector G4FieldTrack::GetSpin() const
|
||||
{ return fSpin;}
|
||||
inline void G4FieldTrack::SetSpin(G4ThreeVector nSpin)
|
||||
{ fSpin=nSpin; }
|
||||
inline
|
||||
void G4FieldTrack::SetEnergy(G4double nEnergy)
|
||||
{
|
||||
fEnergy=nEnergy;
|
||||
}
|
||||
|
||||
inline G4double G4FieldTrack::GetLabTimeOfFlight() const
|
||||
{ return fLabTimeOfFlight; }
|
||||
inline void G4FieldTrack::SetLabTimeOfFlight(G4double nTOF)
|
||||
{ fLabTimeOfFlight=nTOF;}
|
||||
inline
|
||||
G4ThreeVector G4FieldTrack::GetSpin() const
|
||||
{
|
||||
return fSpin;
|
||||
}
|
||||
|
||||
inline G4double G4FieldTrack::GetProperTimeOfFlight() const
|
||||
{ return fProperTimeOfFlight; }
|
||||
inline void G4FieldTrack::SetProperTimeOfFlight(G4double nTOF)
|
||||
{ fProperTimeOfFlight=nTOF;}
|
||||
inline
|
||||
void G4FieldTrack::SetSpin(G4ThreeVector nSpin)
|
||||
{
|
||||
fSpin=nSpin;
|
||||
}
|
||||
|
||||
inline G4double G4FieldTrack::GetMomentumModulus() const
|
||||
{ return fMomentumModulus;}
|
||||
inline void G4FieldTrack::SetMomentumModulus(G4double nMomentumMod)
|
||||
{ fMomentumModulus= nMomentumMod ;} // does not modify energy
|
||||
inline
|
||||
G4double G4FieldTrack::GetLabTimeOfFlight() const
|
||||
{
|
||||
return fLabTimeOfFlight;
|
||||
}
|
||||
|
||||
inline void G4FieldTrack::SetMomentumDir(G4ThreeVector newMomDir)
|
||||
{ fMomentumDir= newMomDir; }
|
||||
inline
|
||||
void G4FieldTrack::SetLabTimeOfFlight(G4double nTOF)
|
||||
{
|
||||
fLabTimeOfFlight=nTOF;
|
||||
}
|
||||
|
||||
inline G4ThreeVector G4FieldTrack::GetVelocity() const
|
||||
{ return G4ThreeVector( SixVector[3], SixVector[4], SixVector[5] ); }
|
||||
inline
|
||||
G4double G4FieldTrack::GetProperTimeOfFlight() const
|
||||
{
|
||||
return fProperTimeOfFlight;
|
||||
}
|
||||
|
||||
inline void G4FieldTrack::SetVelocity(G4ThreeVector pVelocity)
|
||||
inline
|
||||
void G4FieldTrack::SetProperTimeOfFlight(G4double nTOF)
|
||||
{
|
||||
fProperTimeOfFlight=nTOF;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4FieldTrack::GetMomentumModulus() const
|
||||
{
|
||||
return fMomentumModulus;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4FieldTrack::SetMomentumModulus(G4double nMomentumMod)
|
||||
{
|
||||
fMomentumModulus= nMomentumMod; // does not modify energy
|
||||
}
|
||||
|
||||
inline
|
||||
void G4FieldTrack::SetMomentumDir(G4ThreeVector newMomDir)
|
||||
{
|
||||
fMomentumDir= newMomDir;
|
||||
}
|
||||
|
||||
inline
|
||||
G4ThreeVector G4FieldTrack::GetVelocity() const
|
||||
{
|
||||
return G4ThreeVector( SixVector[3], SixVector[4], SixVector[5] );
|
||||
}
|
||||
|
||||
inline
|
||||
void G4FieldTrack::SetVelocity(G4ThreeVector pVelocity)
|
||||
{
|
||||
SixVector[3] = pVelocity.x();
|
||||
SixVector[4] = pVelocity.y();
|
||||
@@ -198,7 +250,7 @@ void G4FieldTrack::DumpToArray(G4double valArr[ncompSVEC] ) const
|
||||
// note that momentum direction must-be/is normalised
|
||||
|
||||
inline
|
||||
void G4FieldTrack::LoadFromArray( const G4double valArr[ncompSVEC] )
|
||||
void G4FieldTrack::LoadFromArray(G4double valArr[ncompSVEC])
|
||||
{
|
||||
SixVector[0]=valArr[0];
|
||||
SixVector[1]=valArr[1];
|
||||
@@ -227,6 +279,8 @@ void G4FieldTrack::LoadFromArray( const G4double valArr[ncompSVEC] )
|
||||
inline
|
||||
G4FieldTrack & G4FieldTrack::operator = ( const G4FieldTrack& rStVec )
|
||||
{
|
||||
if (&rStVec == this) return *this;
|
||||
|
||||
// SetCurvePnt(rStVec.GetPosition(),
|
||||
// rStVec.GetMomentumDir(),
|
||||
// rStVec.GetCurveLength() );
|
||||
@@ -247,6 +301,3 @@ G4FieldTrack & G4FieldTrack::operator = ( const G4FieldTrack& rStVec )
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4HelixExplicitEuler.hh,v 1.4 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4HelixExplicitEuler.hh,v 1.5 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4HelixExplicitEuler
|
||||
@@ -47,7 +47,7 @@ class G4HelixExplicitEuler : public G4MagHelicalStepper
|
||||
// Replaced by MagFieldEvaluate( const G4double y[], G4double B[] )
|
||||
// in G4HelicalStepper
|
||||
|
||||
G4int IntegratorOrder() { return 1; }
|
||||
G4int IntegratorOrder() const { return 1; }
|
||||
};
|
||||
|
||||
#endif /* G4EXPLICITEULER_HH */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4HelixHeum.hh,v 1.4 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4HelixHeum.hh,v 1.5 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4HelixHeum
|
||||
@@ -43,7 +43,7 @@ class G4HelixHeum : public G4MagHelicalStepper
|
||||
|
||||
public: // without description
|
||||
|
||||
G4int IntegratorOrder() { return 2; }
|
||||
G4int IntegratorOrder() const { return 2; }
|
||||
};
|
||||
|
||||
#endif /* G4HELIXHEUM_HH */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4HelixImplicitEuler.hh,v 1.4 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4HelixImplicitEuler.hh,v 1.5 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4HelixImplicitEuler
|
||||
@@ -42,7 +42,7 @@ class G4HelixImplicitEuler : public G4MagHelicalStepper
|
||||
|
||||
public: // without description
|
||||
|
||||
G4int IntegratorOrder() { return 2; }
|
||||
G4int IntegratorOrder() const { return 2; }
|
||||
};
|
||||
|
||||
#endif /* G4HELIXIMPLICITEULER_HH */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4HelixSimpleRunge.hh,v 1.3 2000/04/12 18:28:51 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4HelixSimpleRunge.hh,v 1.4 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// W. Wander <wwc@mit.edu> 03/12/98
|
||||
@@ -15,19 +15,22 @@
|
||||
#define G4HELIXSIMPLERUNGE_HH
|
||||
#include "G4MagHelicalStepper.hh"
|
||||
|
||||
class G4HelixSimpleRunge: public G4MagHelicalStepper
|
||||
class G4HelixSimpleRunge : public G4MagHelicalStepper
|
||||
{
|
||||
|
||||
public:
|
||||
G4HelixSimpleRunge(G4Mag_EqRhs *EqRhs): G4MagHelicalStepper(EqRhs){};
|
||||
~G4HelixSimpleRunge(){};
|
||||
|
||||
G4HelixSimpleRunge(G4Mag_EqRhs *EqRhs)
|
||||
: G4MagHelicalStepper(EqRhs){}
|
||||
|
||||
~G4HelixSimpleRunge(){}
|
||||
|
||||
void DumbStepper( const G4double y[],
|
||||
G4ThreeVector Bfld,
|
||||
G4double h,
|
||||
G4double yout[]);
|
||||
|
||||
G4int IntegratorOrder() { return 2; };
|
||||
G4int IntegratorOrder() const { return 2; }
|
||||
};
|
||||
|
||||
#endif /* G4HELIXSIMPLERUNGE_HH */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4ImplicitEuler.hh,v 1.2 1999/12/15 14:49:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4ImplicitEuler.hh,v 1.3 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// W. Wander <wwc@mit.edu> 12/09/97
|
||||
@@ -15,7 +15,7 @@
|
||||
#define G4IMPLICITEULER_HH
|
||||
#include "G4MagErrorStepper.hh"
|
||||
|
||||
class G4ImplicitEuler: public G4MagErrorStepper
|
||||
class G4ImplicitEuler : public G4MagErrorStepper
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -24,14 +24,14 @@ class G4ImplicitEuler: public G4MagErrorStepper
|
||||
|
||||
void DumbStepper( const G4double y[] ,
|
||||
const G4double dydx[] ,
|
||||
const G4double h ,
|
||||
G4double h ,
|
||||
G4double yout[] ) ;
|
||||
|
||||
G4int IntegratorOrder() { return 2 ; } ;
|
||||
G4int IntegratorOrder() const { return 2 ; } ;
|
||||
|
||||
private:
|
||||
|
||||
G4int fNumberOfVariables ;
|
||||
G4int fNumberOfVariables ;
|
||||
};
|
||||
|
||||
#endif /* G4IMPLICITEULER_HH */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4LineSection.hh,v 1.4 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4LineSection
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagErrorStepper.hh,v 1.6 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagErrorStepper.hh,v 1.7 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4MagErrorStepper
|
||||
@@ -34,13 +34,13 @@ class G4MagErrorStepper : public G4MagIntegratorStepper
|
||||
public: // with description
|
||||
|
||||
G4MagErrorStepper(G4Mag_EqRhs *EqRhs,G4int numberOfVariables);
|
||||
~G4MagErrorStepper();
|
||||
virtual ~G4MagErrorStepper();
|
||||
|
||||
void Stepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double yout[],
|
||||
G4double yerr[] );
|
||||
G4double h,
|
||||
G4double yout[],
|
||||
G4double yerr[] );
|
||||
// The stepper for the Runge Kutta integration. The stepsize
|
||||
// is fixed, with the Step size given by h.
|
||||
// Integrates ODE starting values y[0 to 6].
|
||||
@@ -48,14 +48,20 @@ class G4MagErrorStepper : public G4MagIntegratorStepper
|
||||
|
||||
virtual void DumbStepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double yout[] ) = 0;
|
||||
G4double h,
|
||||
G4double yout[] ) = 0;
|
||||
// Performs a 'dump' Step without error calculation.
|
||||
|
||||
G4double DistChord() const;
|
||||
G4double DistChord() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
G4MagErrorStepper(const G4MagErrorStepper&);
|
||||
G4MagErrorStepper& operator=(const G4MagErrorStepper&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
G4ThreeVector fInitialPoint, fMidPoint, fFinalPoint;
|
||||
// Data stored in order to find the chord
|
||||
|
||||
|
||||
@@ -5,25 +5,18 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagErrorStepper.icc,v 1.6 2000/03/03 12:09:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagErrorStepper.icc,v 1.7 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
inline G4MagErrorStepper::G4MagErrorStepper(G4Mag_EqRhs *EqRhs,
|
||||
G4int numberOfVariables)
|
||||
:G4MagIntegratorStepper(EqRhs,numberOfVariables)
|
||||
inline
|
||||
G4MagErrorStepper::G4MagErrorStepper(G4Mag_EqRhs *EqRhs,
|
||||
G4int numberOfVariables)
|
||||
: G4MagIntegratorStepper(EqRhs,numberOfVariables)
|
||||
{
|
||||
const G4int nvar = this->GetNumberOfVariables() ;
|
||||
G4int nvar = this->GetNumberOfVariables() ;
|
||||
yMiddle= new G4double[nvar];
|
||||
dydxMid= new G4double[nvar];
|
||||
yInitial= new G4double[nvar];
|
||||
yOneStep= new G4double[nvar];
|
||||
}
|
||||
|
||||
inline G4MagErrorStepper::~G4MagErrorStepper()
|
||||
{
|
||||
delete[] yMiddle;
|
||||
delete[] dydxMid;
|
||||
delete[] yInitial;
|
||||
delete[] yOneStep;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagHelicalStepper.hh,v 1.4 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagHelicalStepper.hh,v 1.5 2000/11/01 15:15:49 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4MagHelicalStepper
|
||||
@@ -32,13 +32,13 @@ class G4MagHelicalStepper : public G4MagIntegratorStepper
|
||||
public: // with description
|
||||
|
||||
G4MagHelicalStepper(G4Mag_EqRhs *EqRhs);
|
||||
~G4MagHelicalStepper() {;}
|
||||
virtual ~G4MagHelicalStepper();
|
||||
|
||||
void Stepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double yout[],
|
||||
G4double yerr[] );
|
||||
G4double h,
|
||||
G4double yout[],
|
||||
G4double yerr[] );
|
||||
// The stepper for the Runge Kutta integration.
|
||||
// The stepsize is fixed, equal to h.
|
||||
// Integrates ODE starting values y[0 to 6]
|
||||
@@ -50,16 +50,14 @@ class G4MagHelicalStepper : public G4MagIntegratorStepper
|
||||
G4double yout[] ) = 0;
|
||||
// Performs a 'dump' Step without error calculation.
|
||||
|
||||
G4double DistChord() const;
|
||||
G4double DistChord() const;
|
||||
// Estimate maximum distance of curved solution and chord ...
|
||||
|
||||
protected: // with description
|
||||
|
||||
// --- Methods used to implement all the derived classes -----
|
||||
|
||||
void LinearStep( const G4double yIn[],
|
||||
const G4double h,
|
||||
G4double yHelix[]);
|
||||
inline void LinearStep( const G4double yIn[],
|
||||
G4double h,
|
||||
G4double yHelix[]);
|
||||
// A linear Step in regions without magnetic field.
|
||||
|
||||
void AdvanceHelix( const G4double yIn[],
|
||||
@@ -68,7 +66,7 @@ class G4MagHelicalStepper : public G4MagIntegratorStepper
|
||||
G4double yHelix[]); // output
|
||||
// A first order Step along a helix inside the field.
|
||||
|
||||
void MagFieldEvaluate( const G4double y[], G4ThreeVector& Bfield );
|
||||
inline void MagFieldEvaluate( const G4double y[], G4ThreeVector& Bfield );
|
||||
// Evaluate the field at a certain point.
|
||||
|
||||
protected: // without description
|
||||
@@ -76,6 +74,12 @@ class G4MagHelicalStepper : public G4MagIntegratorStepper
|
||||
// void MagFieldEvaluate( const G4double y[], G4double B[] )
|
||||
// { GetEquationOfMotion()-> GetFieldValue(y, B); }
|
||||
|
||||
private:
|
||||
|
||||
G4MagHelicalStepper(const G4MagHelicalStepper&);
|
||||
G4MagHelicalStepper& operator=(const G4MagHelicalStepper&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
G4ThreeVector yInitial, yMidPoint, yFinal;
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagHelicalStepper.icc,v 1.3 2000/04/27 09:14:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $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[],
|
||||
const G4double h,
|
||||
G4double yLinear[])
|
||||
G4double h,
|
||||
G4double yLinear[])
|
||||
{
|
||||
for( G4int i = 0; i < 3; i++ ) {
|
||||
yLinear[i] = yIn[i] + h * yIn[i+3];
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagIntegratorDriver.hh,v 1.6 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagIntegratorDriver.hh,v 1.7 2000/11/01 15:15:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4MagInt_Driver
|
||||
@@ -31,8 +31,8 @@ class G4MagInt_Driver
|
||||
public: // with description
|
||||
|
||||
G4bool AccurateAdvance(G4FieldTrack& y_current,
|
||||
const G4double hstep,
|
||||
const G4double eps); // Requested y_err/hstep
|
||||
G4double hstep,
|
||||
G4double eps); // Requested y_err/hstep
|
||||
// Above drivers for integrator (Runge-Kutta) with stepsize control.
|
||||
// Integrates ODE starting values y_current
|
||||
// from current s (s=s0) to s=s0+h with accuracy eps.
|
||||
@@ -49,109 +49,114 @@ class G4MagInt_Driver
|
||||
G4MagInt_Driver( G4double hminimum,
|
||||
G4MagIntegratorStepper *pItsStepper,
|
||||
G4int numberOfComponents=6);
|
||||
~G4MagInt_Driver(){}
|
||||
~G4MagInt_Driver();
|
||||
// Constructor, destructor.
|
||||
|
||||
G4double GetHmin();
|
||||
G4double Hmin(); // Obsolete
|
||||
G4double GetSafety();
|
||||
G4double GetPshrnk();
|
||||
G4double GetPgrow();
|
||||
G4double GetErrcon();
|
||||
void GetDerivatives( const G4FieldTrack y_curr, // const, INput
|
||||
G4double dydx[] ); // OUTput
|
||||
inline G4double GetHmin() const;
|
||||
inline G4double Hmin() const; // Obsolete
|
||||
inline G4double GetSafety() const;
|
||||
inline G4double GetPshrnk() const;
|
||||
inline G4double GetPgrow() const;
|
||||
inline G4double GetErrcon() const;
|
||||
inline void GetDerivatives( const G4FieldTrack y_curr, // const, INput
|
||||
G4double dydx[] ); // OUTput
|
||||
// Accessors.
|
||||
|
||||
void RenewStepperAndAdjust(G4MagIntegratorStepper *pItsStepper);
|
||||
inline void RenewStepperAndAdjust(G4MagIntegratorStepper *pItsStepper);
|
||||
// Sets a new stepper pItsStepper for this driver. Then it calls
|
||||
// ReSetParameters to reset its parameters accordingly.
|
||||
|
||||
void ReSetParameters(G4double new_safety= 0.9 );
|
||||
inline void ReSetParameters(G4double new_safety= 0.9 );
|
||||
// i) sets the exponents (pgrow & pshrnk),
|
||||
// using the current Stepper's order,
|
||||
// ii) sets the safety
|
||||
// ii) calculates "errcon" according to the above values.
|
||||
|
||||
void SetSafety(G4double valS);
|
||||
void SetPshrnk(G4double valPs);
|
||||
void SetPgrow( G4double valPg);
|
||||
void SetErrcon(G4double valEc);
|
||||
inline void SetSafety(G4double valS);
|
||||
inline void SetPshrnk(G4double valPs);
|
||||
inline void SetPgrow (G4double valPg);
|
||||
inline void SetErrcon(G4double valEc);
|
||||
// When setting safety or pgrow, errcon will be set to a
|
||||
// compatible value.
|
||||
|
||||
G4double ComputeAndSetErrcon();
|
||||
inline G4double ComputeAndSetErrcon();
|
||||
|
||||
void SetChargeMomentumMass( const G4double particleCharge,
|
||||
const G4double MomentumXc,
|
||||
const G4double Mass );
|
||||
inline void SetChargeMomentumMass( G4double particleCharge,
|
||||
G4double MomentumXc,
|
||||
G4double Mass );
|
||||
// Change them in Equation. particleCharge is in e+ units.
|
||||
|
||||
G4MagIntegratorStepper* GetStepper();
|
||||
inline const G4MagIntegratorStepper* GetStepper() const;
|
||||
|
||||
void OneGoodStep( G4double ystart[], // Like old RKF45step()
|
||||
const G4double dydx[],
|
||||
G4double& x,
|
||||
const G4double htry,
|
||||
const G4double eps, // memb variables ?
|
||||
G4double& hdid,
|
||||
G4double& hnext ) ;
|
||||
void OneGoodStep( G4double ystart[], // Like old RKF45step()
|
||||
const G4double dydx[],
|
||||
G4double& x,
|
||||
G4double htry,
|
||||
G4double eps, // memb variables ?
|
||||
G4double& hdid,
|
||||
G4double& hnext ) ;
|
||||
// This takes one Step that is as large as possible while
|
||||
// satisfying the accuracy criterion of:
|
||||
// yerr < eps * |y_end-y_start|
|
||||
|
||||
G4double ComputeNewStepSize(
|
||||
G4double errMaxNorm, // normalised error
|
||||
G4double hstepCurrent); // current step size
|
||||
G4double ComputeNewStepSize( G4double errMaxNorm, // normalised error
|
||||
G4double hstepCurrent); // current step size
|
||||
// Taking the last step's normalised error, calculate
|
||||
// a step size for the next step.
|
||||
// Do not limit the next step's size within a factor of the
|
||||
// current one.
|
||||
|
||||
G4double ComputeNewStepSize_WithinLimits(
|
||||
G4double errMaxNorm, // normalised error
|
||||
G4double ComputeNewStepSize_WithinLimits(
|
||||
G4double errMaxNorm, // normalised error
|
||||
G4double hstepCurrent); // current step size
|
||||
// Taking the last step's normalised error, calculate
|
||||
// a step size for the next step.
|
||||
// Limit the next step's size within a range around the current one.
|
||||
|
||||
G4int GetMaxNoSteps();
|
||||
void SetMaxNoSteps( G4int val);
|
||||
inline G4int GetMaxNoSteps() const;
|
||||
inline void SetMaxNoSteps( G4int val);
|
||||
|
||||
public: // without description
|
||||
|
||||
G4double SetHmin(G4double newval);
|
||||
inline void SetHmin(G4double newval);
|
||||
|
||||
protected:
|
||||
|
||||
void WarnSmallStepSize( G4double hnext, G4double hstep,
|
||||
G4double h, G4double xDone,
|
||||
G4int noSteps);
|
||||
void WarnTooManyStep( G4double x1start, G4double x2end, G4double xCurrent);
|
||||
void WarnEndPointTooFar (G4double endPointDist,
|
||||
G4double hStepSize ,
|
||||
G4double epsilonRelative,
|
||||
G4int debugFlag);
|
||||
void WarnSmallStepSize( G4double hnext, G4double hstep,
|
||||
G4double h, G4double xDone,
|
||||
G4int noSteps);
|
||||
void WarnTooManyStep( G4double x1start, G4double x2end, G4double xCurrent);
|
||||
void WarnEndPointTooFar (G4double endPointDist,
|
||||
G4double hStepSize ,
|
||||
G4double epsilonRelative,
|
||||
G4int debugFlag);
|
||||
// Issue warnings for undesirable situations
|
||||
|
||||
private:
|
||||
|
||||
G4double hminimum_val;
|
||||
G4MagInt_Driver(const G4MagInt_Driver&);
|
||||
G4MagInt_Driver& operator=(const G4MagInt_Driver&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
G4double hminimum_val;
|
||||
// Minimum Step allowed in a Step.
|
||||
|
||||
const G4int nvar;
|
||||
G4int nvar;
|
||||
|
||||
G4MagIntegratorStepper *pIntStepper;
|
||||
G4int fMaxNoSteps;
|
||||
static const G4int fMaxStepBase;
|
||||
G4MagIntegratorStepper *pIntStepper;
|
||||
G4int fMaxNoSteps;
|
||||
static const G4int fMaxStepBase;
|
||||
|
||||
G4double safety;
|
||||
G4double pshrnk; // exponent for shrinking
|
||||
G4double pgrow; // exponent for growth
|
||||
G4double errcon;
|
||||
G4double safety;
|
||||
G4double pshrnk; // exponent for shrinking
|
||||
G4double pgrow; // exponent for growth
|
||||
G4double errcon;
|
||||
// Parameters used to grow and shrink trial stepsize.
|
||||
|
||||
static const G4double max_stepping_increase;
|
||||
static const G4double max_stepping_decrease;
|
||||
static const G4double max_stepping_increase;
|
||||
static const G4double max_stepping_decrease;
|
||||
// Maximum stepsize increase/decrease factors.
|
||||
};
|
||||
|
||||
|
||||
@@ -5,52 +5,61 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagIntegratorDriver.icc,v 1.4 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagIntegratorDriver.icc,v 1.5 2000/11/01 15:15:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
inline G4double G4MagInt_Driver::GetHmin()
|
||||
inline
|
||||
G4double G4MagInt_Driver::GetHmin() const
|
||||
{
|
||||
return hminimum_val;
|
||||
}
|
||||
|
||||
inline G4double G4MagInt_Driver::Hmin()
|
||||
inline
|
||||
G4double G4MagInt_Driver::Hmin() const
|
||||
{
|
||||
return hminimum_val;
|
||||
}
|
||||
|
||||
inline G4double G4MagInt_Driver::GetSafety()
|
||||
inline
|
||||
G4double G4MagInt_Driver::GetSafety() const
|
||||
{
|
||||
return safety;
|
||||
}
|
||||
|
||||
inline G4double G4MagInt_Driver::GetPshrnk()
|
||||
inline
|
||||
G4double G4MagInt_Driver::GetPshrnk() const
|
||||
{
|
||||
return pshrnk;
|
||||
}
|
||||
|
||||
inline G4double G4MagInt_Driver::GetPgrow()
|
||||
inline
|
||||
G4double G4MagInt_Driver::GetPgrow() const
|
||||
{
|
||||
return pgrow;
|
||||
}
|
||||
|
||||
inline G4double G4MagInt_Driver::GetErrcon()
|
||||
inline
|
||||
G4double G4MagInt_Driver::GetErrcon() const
|
||||
{
|
||||
return errcon;
|
||||
}
|
||||
|
||||
inline G4double G4MagInt_Driver::SetHmin(G4double newval)
|
||||
inline
|
||||
void G4MagInt_Driver::SetHmin(G4double newval)
|
||||
{
|
||||
return hminimum_val;
|
||||
hminimum_val = newval;
|
||||
}
|
||||
|
||||
inline G4double G4MagInt_Driver::ComputeAndSetErrcon()
|
||||
inline
|
||||
G4double G4MagInt_Driver::ComputeAndSetErrcon()
|
||||
{
|
||||
errcon = pow(max_stepping_increase/GetSafety(),1.0/GetPgrow());
|
||||
return errcon;
|
||||
}
|
||||
|
||||
inline void G4MagInt_Driver::ReSetParameters( G4double new_safety )
|
||||
inline
|
||||
void G4MagInt_Driver::ReSetParameters(G4double new_safety)
|
||||
{
|
||||
safety = new_safety;
|
||||
pshrnk = -1.0 / pIntStepper->IntegratorOrder();
|
||||
@@ -58,66 +67,65 @@ inline void G4MagInt_Driver::ReSetParameters( G4double new_safety )
|
||||
ComputeAndSetErrcon();
|
||||
}
|
||||
|
||||
inline void G4MagInt_Driver::SetSafety(G4double val)
|
||||
inline
|
||||
void G4MagInt_Driver::SetSafety(G4double val)
|
||||
{
|
||||
safety=val;
|
||||
ComputeAndSetErrcon();
|
||||
}
|
||||
|
||||
inline void G4MagInt_Driver::SetPgrow(G4double val)
|
||||
inline
|
||||
void G4MagInt_Driver::SetPgrow(G4double val)
|
||||
{
|
||||
pgrow=val;
|
||||
ComputeAndSetErrcon();
|
||||
}
|
||||
|
||||
inline void G4MagInt_Driver::SetErrcon(G4double val)
|
||||
inline
|
||||
void G4MagInt_Driver::SetErrcon(G4double val)
|
||||
{
|
||||
errcon=val;
|
||||
}
|
||||
|
||||
inline void G4MagInt_Driver::RenewStepperAndAdjust(G4MagIntegratorStepper *pItsStepper)
|
||||
inline
|
||||
void G4MagInt_Driver::RenewStepperAndAdjust(G4MagIntegratorStepper *pItsStepper)
|
||||
{
|
||||
pIntStepper = pItsStepper;
|
||||
ReSetParameters();
|
||||
}
|
||||
|
||||
inline void G4MagInt_Driver:: SetChargeMomentumMass(
|
||||
const G4double particleCharge, // in e+ units
|
||||
const G4double MomentumXc,
|
||||
const G4double Mass )
|
||||
inline
|
||||
void G4MagInt_Driver::SetChargeMomentumMass(G4double particleCharge, // e+
|
||||
G4double MomentumXc,
|
||||
G4double Mass )
|
||||
{
|
||||
pIntStepper->GetEquationOfMotion()
|
||||
->SetChargeMomentumMass(particleCharge, MomentumXc, Mass);
|
||||
}
|
||||
|
||||
// Constructor
|
||||
//
|
||||
inline G4MagInt_Driver::G4MagInt_Driver( G4double hminimum,
|
||||
G4MagIntegratorStepper *pItsStepper,
|
||||
G4int numComponents)
|
||||
: nvar(numComponents)
|
||||
{
|
||||
RenewStepperAndAdjust( pItsStepper );
|
||||
hminimum_val= hminimum;
|
||||
fMaxNoSteps = fMaxStepBase / pIntStepper->IntegratorOrder();
|
||||
inline
|
||||
const G4MagIntegratorStepper* G4MagInt_Driver::GetStepper() const
|
||||
{
|
||||
return pIntStepper;
|
||||
}
|
||||
|
||||
inline G4MagIntegratorStepper* G4MagInt_Driver::GetStepper()
|
||||
{ return pIntStepper; }
|
||||
inline
|
||||
G4int G4MagInt_Driver::GetMaxNoSteps() const
|
||||
{
|
||||
return fMaxNoSteps;
|
||||
}
|
||||
|
||||
inline G4int G4MagInt_Driver::GetMaxNoSteps()
|
||||
{ return fMaxNoSteps; }
|
||||
inline
|
||||
void G4MagInt_Driver::SetMaxNoSteps(G4int val)
|
||||
{
|
||||
fMaxNoSteps= val;
|
||||
}
|
||||
|
||||
inline void G4MagInt_Driver::SetMaxNoSteps(G4int val)
|
||||
{ fMaxNoSteps= val; }
|
||||
|
||||
inline void G4MagInt_Driver::GetDerivatives(
|
||||
const G4FieldTrack y_curr, // const, INput
|
||||
G4double dydx[] ) // OUTput
|
||||
inline
|
||||
void G4MagInt_Driver::GetDerivatives(const G4FieldTrack y_curr, // const, INput
|
||||
G4double dydx[]) // OUTput
|
||||
{
|
||||
G4double tmpValArr[G4FieldTrack::ncompSVEC];
|
||||
y_curr.DumpToArray( tmpValArr );
|
||||
pIntStepper -> RightHandSide( tmpValArr , dydx );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagIntegratorStepper.hh,v 1.4 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagIntegratorStepper.hh,v 1.5 2000/11/01 15:15:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4MagIntegratorStepper
|
||||
@@ -30,12 +30,12 @@ class G4MagIntegratorStepper
|
||||
public: // with description
|
||||
|
||||
G4MagIntegratorStepper(G4Mag_EqRhs *EqRhs, G4int num_variables);
|
||||
~G4MagIntegratorStepper(){;}
|
||||
virtual ~G4MagIntegratorStepper();
|
||||
// Constructor and destructor. No actions.
|
||||
|
||||
virtual void Stepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double h,
|
||||
G4double yout[],
|
||||
G4double yerr[] ) = 0 ;
|
||||
// The stepper for the Runge Kutta integration.
|
||||
@@ -47,22 +47,22 @@ class G4MagIntegratorStepper
|
||||
// Estimate the maximum distance of a chord from the true path
|
||||
// over the segment last integrated.
|
||||
|
||||
void NormaliseTangentVector( G4double vec[6] );
|
||||
inline void NormaliseTangentVector( G4double vec[6] );
|
||||
// Simple utility function to (re)normalise 'unit velocity' vector.
|
||||
|
||||
virtual void RightHandSide( const double y[], double dydx[] );
|
||||
virtual void RightHandSide( const double y[], double dydx[] );
|
||||
// Utility method to supply the standard Evaluation of the
|
||||
// Right Hand side of the associated equation.
|
||||
|
||||
G4int GetNumberOfVariables();
|
||||
void SetNumberOfVariables(G4int newNo);
|
||||
inline G4int GetNumberOfVariables() const;
|
||||
inline void SetNumberOfVariables(G4int newNo);
|
||||
// Get/Set the number of variables that the stepper will compile over.
|
||||
|
||||
virtual G4int IntegratorOrder() = 0;
|
||||
virtual G4int IntegratorOrder() const = 0;
|
||||
// Returns the order of the integrator
|
||||
// i.e. its error behaviour is of the order O(h^order).
|
||||
|
||||
G4EquationOfMotion *GetEquationOfMotion() const;
|
||||
inline G4EquationOfMotion *GetEquationOfMotion();
|
||||
// As some steppers (eg RKG3) require other methods of Eq_Rhs
|
||||
// this function allows for access to them.
|
||||
|
||||
@@ -70,13 +70,18 @@ class G4MagIntegratorStepper
|
||||
|
||||
#if 0
|
||||
void
|
||||
SetChargeAndMomentum( const G4double particleCharge, // in e+ units
|
||||
const G4double MomentumXc)
|
||||
SetChargeAndMomentum( G4double particleCharge, // in e+ units
|
||||
G4double MomentumXc)
|
||||
// Supply the standard Evaluation of the Right Hand side
|
||||
// of the associated equation.
|
||||
{theEquation_Rhs -> SetChargeAndMomentum(particleCharge, MomentumXc);}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
G4MagIntegratorStepper(const G4MagIntegratorStepper&);
|
||||
G4MagIntegratorStepper& operator=(const G4MagIntegratorStepper&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -5,23 +5,30 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagIntegratorStepper.icc,v 1.3 1999/12/15 14:49:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagIntegratorStepper.icc,v 1.4 2000/11/01 15:15:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
inline G4EquationOfMotion* G4MagIntegratorStepper::GetEquationOfMotion() const
|
||||
{ return fEquation_Rhs; }
|
||||
|
||||
inline void G4MagIntegratorStepper::RightHandSide( const double y[], double dydx[] )
|
||||
{ fEquation_Rhs-> RightHandSide(y, dydx); }
|
||||
inline
|
||||
G4EquationOfMotion* G4MagIntegratorStepper::GetEquationOfMotion()
|
||||
{
|
||||
return fEquation_Rhs;
|
||||
}
|
||||
|
||||
inline G4int G4MagIntegratorStepper::GetNumberOfVariables()
|
||||
{ return fNumberOfVariables; }
|
||||
inline void G4MagIntegratorStepper::SetNumberOfVariables(G4int newNo)
|
||||
{ fNumberOfVariables = newNo; }
|
||||
inline
|
||||
G4int G4MagIntegratorStepper::GetNumberOfVariables() const
|
||||
{
|
||||
return fNumberOfVariables;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MagIntegratorStepper::SetNumberOfVariables(G4int newNo)
|
||||
{
|
||||
fNumberOfVariables = newNo;
|
||||
}
|
||||
|
||||
inline void G4MagIntegratorStepper::
|
||||
NormaliseTangentVector( G4double vec[6] )
|
||||
inline
|
||||
void G4MagIntegratorStepper::NormaliseTangentVector( G4double vec[6] )
|
||||
{
|
||||
double drds2 = vec[3]*vec[3]+vec[4]*vec[4]+vec[5]*vec[5];
|
||||
|
||||
@@ -31,4 +38,3 @@ NormaliseTangentVector( G4double vec[6] )
|
||||
vec[i+3] *= normx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Mag_EqRhs.hh,v 1.4 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Mag_EqRhs.hh,v 1.5 2000/11/01 15:15:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4Mag_EqRhs
|
||||
@@ -34,27 +34,26 @@ class G4Mag_EqRhs : public G4EquationOfMotion
|
||||
public: // with description
|
||||
|
||||
G4Mag_EqRhs( G4MagneticField *magField );
|
||||
~G4Mag_EqRhs();
|
||||
virtual ~G4Mag_EqRhs();
|
||||
// Constructor and destructor. No actions.
|
||||
|
||||
virtual void EvaluateRhsGivenB( const G4double y[],
|
||||
const G4double B[3],
|
||||
G4double dydx[] ) const = 0;
|
||||
const G4double B[3],
|
||||
G4double dydx[] ) const = 0;
|
||||
// Given the value of the field "B", this function
|
||||
// calculates the value of the derivative dydx.
|
||||
// This is the _only_ function a subclass must define.
|
||||
// The other two functions use Rhs_givenB.
|
||||
|
||||
G4double FCof() const;
|
||||
inline G4double FCof() const;
|
||||
|
||||
virtual void
|
||||
SetChargeMomentumMass( const G4double particleCharge, // in e+ units
|
||||
const G4double MomentumXc,
|
||||
const G4double mass);
|
||||
virtual void SetChargeMomentumMass( G4double particleCharge, // in e+ units
|
||||
G4double MomentumXc,
|
||||
G4double mass);
|
||||
|
||||
private:
|
||||
|
||||
G4double fCof_val;
|
||||
G4double fCof_val;
|
||||
|
||||
static const G4double fUnitConstant; // Set in G4Mag_EqRhs.cc
|
||||
// to 0.299792458
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Mag_SpinEqRhs.hh,v 1.3 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Mag_SpinEqRhs.hh,v 1.4 2000/11/01 15:15:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4Mag_SpinEqRhs
|
||||
@@ -26,8 +26,8 @@
|
||||
#include "G4Mag_EqRhs.hh"
|
||||
#include "G4MagneticField.hh"
|
||||
|
||||
class G4Mag_SpinEqRhs : public G4Mag_EqRhs{
|
||||
|
||||
class G4Mag_SpinEqRhs : public G4Mag_EqRhs
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4Mag_SpinEqRhs( G4MagneticField* MagField )
|
||||
@@ -35,9 +35,9 @@ class G4Mag_SpinEqRhs : public G4Mag_EqRhs{
|
||||
~G4Mag_SpinEqRhs() {;}
|
||||
// Constructor and destructor. No actions.
|
||||
|
||||
void SetChargeMomentumMass(const G4double particleCharge, // in e+ units
|
||||
const G4double MomentumXc,
|
||||
const G4double mass);
|
||||
void SetChargeMomentumMass(G4double particleCharge, // in e+ units
|
||||
G4double MomentumXc,
|
||||
G4double mass);
|
||||
|
||||
void EvaluateRhsGivenB( const G4double y[],
|
||||
const G4double B[3],
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Mag_UsualEqRhs.hh,v 1.3 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4Mag_UsualEqRhs
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4MagneticField.hh,v 1.4 2000/05/10 12:36:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4MagneticField.hh,v 1.5 2000/11/01 15:15:50 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4MagneticField
|
||||
@@ -41,12 +41,12 @@ class G4MagneticField : public G4Field
|
||||
double *Bfield ) const = 0;
|
||||
};
|
||||
|
||||
// Implementation
|
||||
// Inline implementations
|
||||
|
||||
inline G4MagneticField::G4MagneticField() {}
|
||||
inline G4MagneticField::~G4MagneticField() {}
|
||||
inline G4MagneticField::G4MagneticField(const G4MagneticField &) {}
|
||||
inline G4MagneticField& G4MagneticField::operator = (const G4MagneticField &)
|
||||
{ return *this; }
|
||||
inline G4MagneticField& G4MagneticField::operator = (const G4MagneticField &p)
|
||||
{ if (&p == this) return *this; *this = p; return *this; }
|
||||
|
||||
#endif /* G4MAGNETIC_FIELD_DEF */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4RKG3_Stepper.hh,v 1.4 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4RKG3_Stepper.hh,v 1.5 2000/11/01 15:15:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4RKG3_Stepper
|
||||
@@ -36,7 +36,7 @@ class G4RKG3_Stepper : public G4MagIntegratorStepper
|
||||
|
||||
void Stepper( const G4double yIn[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double h,
|
||||
G4double yOut[],
|
||||
G4double yErr[] );
|
||||
// The method which must be provided, even if less efficient.
|
||||
@@ -45,7 +45,7 @@ class G4RKG3_Stepper : public G4MagIntegratorStepper
|
||||
|
||||
void StepNoErr( const G4double tIn[7],
|
||||
const G4double dydx[7],
|
||||
const G4double Step,
|
||||
G4double Step,
|
||||
G4double tOut[7],
|
||||
G4double B[3] );
|
||||
// Integrator RK Stepper from G3 with only two field evaluation per
|
||||
@@ -55,7 +55,7 @@ class G4RKG3_Stepper : public G4MagIntegratorStepper
|
||||
|
||||
void StepWithEst( const G4double tIn[7],
|
||||
const G4double dydx[7],
|
||||
const G4double Step,
|
||||
G4double Step,
|
||||
G4double tOut[7],
|
||||
G4double& alpha2, // to delete ?
|
||||
G4double& beta2,
|
||||
@@ -68,11 +68,11 @@ class G4RKG3_Stepper : public G4MagIntegratorStepper
|
||||
|
||||
public: // without description
|
||||
|
||||
G4int IntegratorOrder() { return 4; };
|
||||
G4int IntegratorOrder() const { return 4; }
|
||||
|
||||
protected:
|
||||
// void Field( const double Point[3],
|
||||
// double Bfield[3] ) const
|
||||
// void Field( const G4double Point[3],
|
||||
// G4double Bfield[3] ) const
|
||||
// { EqRhs-> GetFieldValue( Point, Bfield ) ; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SimpleHeum.hh,v 1.3 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4SimpleHeum.hh,v 1.4 2000/11/01 15:15:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4SimpleHeum
|
||||
@@ -39,16 +39,16 @@ class G4SimpleHeum : public G4MagErrorStepper
|
||||
|
||||
void DumbStepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double h,
|
||||
G4double yout[]);
|
||||
|
||||
public: // without description
|
||||
|
||||
G4int IntegratorOrder() { return 3; }
|
||||
G4int IntegratorOrder() const { return 3; }
|
||||
|
||||
private:
|
||||
|
||||
const G4int fNumberOfVariables;
|
||||
G4int fNumberOfVariables;
|
||||
|
||||
G4double* dydxTemp ;
|
||||
G4double* dydxTemp2 ;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SimpleRunge.hh,v 1.3 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4SimpleRunge.hh,v 1.4 2000/11/01 15:15:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4SimpleRunge
|
||||
@@ -40,12 +40,12 @@ class G4SimpleRunge : public G4MagErrorStepper
|
||||
|
||||
void DumbStepper( const G4double y[],
|
||||
const G4double dydx[],
|
||||
const G4double h,
|
||||
G4double h,
|
||||
G4double yout[]);
|
||||
|
||||
public: // without description
|
||||
|
||||
G4int IntegratorOrder() { return 2; }
|
||||
G4int IntegratorOrder() const { return 2; }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UniformElectricField.hh,v 1.3 2000/04/27 09:14:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UniformElectricField.hh,v 1.4 2000/11/01 15:15:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4UniformElectricField
|
||||
@@ -50,7 +50,8 @@ class G4UniformElectricField : public G4ElectroMagneticField
|
||||
G4double B[] ) const ;
|
||||
|
||||
private:
|
||||
G4double fFieldComponents[6] ;
|
||||
|
||||
G4double fFieldComponents[6] ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UniformMagField.hh,v 1.3 2000/04/27 09:14:07 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UniformMagField.hh,v 1.4 2000/11/01 15:15:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//
|
||||
// class G4UniformMagField
|
||||
@@ -47,15 +47,16 @@ class G4UniformMagField : public G4MagneticField
|
||||
// Copy constructor and assignment operator.
|
||||
|
||||
void GetFieldValue(const G4double yTrack[3] ,
|
||||
G4double *MagField ) const ;
|
||||
G4double *MagField) const ;
|
||||
|
||||
void SetFieldValue( const G4ThreeVector& newFieldValue );
|
||||
void SetFieldValue(const G4ThreeVector& newFieldValue);
|
||||
|
||||
G4ThreeVector GetConstantFieldValue() const;
|
||||
// Return the field value
|
||||
// Return the field value
|
||||
|
||||
private:
|
||||
G4double fFieldComponents[3] ;
|
||||
|
||||
G4double fFieldComponents[3] ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user