Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
@@ -30,64 +30,101 @@
// Abstract Base Class for the right hand size of the equation of
// motion of a particle in a field.
// Created: J.Apostolakis, 1998
// Author: John Apostolakis (CERN), 1998
// -------------------------------------------------------------------
#ifndef G4EQUATIONOFMOTION_HH
#define G4EQUATIONOFMOTION_HH
#include "G4Types.hh"
#include "G4Field.hh" // required in inline method implementations
#include "G4FieldParameters.hh"
#include "G4ChargeState.hh"
/**
* @brief G4EquationOfMotion is the abstract base class for the right
* hand size of the equation of motion of a particle in a field.
*/
class G4EquationOfMotion
{
public: // with description
public:
G4EquationOfMotion( G4Field* Field );
virtual ~G4EquationOfMotion();
// Constructor and virtual destructor. No operations.
/**
* Constructor for G4EquationOfMotion.
* @param[in] Field Pointer to the field.
*/
G4EquationOfMotion( G4Field* Field );
virtual void EvaluateRhsGivenB( const G4double y[],
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.
/**
* Default virtual Destructor.
*/
virtual ~G4EquationOfMotion() = default;
virtual void SetChargeMomentumMass(G4ChargeState particleCharge,
G4double MomentumXc,
G4double MassXc2) = 0;
// Set the charge, momentum and mass of the current particle
// --> used to set the equation's coefficients ...
/**
* Calculates the value of the derivative, given the value of the field.
* @param[in] y Coefficients array.
* @param[in] Field Field value.
* @param[out] dydx Derivatives array.
*/
virtual void EvaluateRhsGivenB( const G4double y[],
const G4double B[3],
G4double dydx[] ) const = 0;
inline void RightHandSide( const G4double y[],
G4double dydx[] ) const;
// This calculates the value of the derivative dydx at y.
// It is the usual enquiry function.
// ---------------------------
// (It is not virtual, but calls the virtual function above.)
/**
* Sets the charge, momentum and mass of the current particle.
* Used to set the equation's coefficients.
* @param[in] particleCharge Magnetic charge and moments in e+ units.
* @param[in] MomentumXc Particle momentum.
* @param[in] mass Particle mass.
*/
virtual void SetChargeMomentumMass(G4ChargeState particleCharge,
G4double MomentumXc,
G4double MassXc2) = 0;
inline void EvaluateRhsReturnB( const G4double y[],
G4double dydx[],
G4double Field[] ) const;
// Same as RHS above, but also returns the value of B.
// Should be made the new default ? after putting dydx & B in a class.
/**
* Returns the equation type-ID, "kUserEquation".
*/
virtual G4EquationType GetEquationType() const { return kUserEquation; }
inline void GetFieldValue( const G4double Point[4],
G4double Field[] ) const;
// Obtain only the field - the stepper assumes it is pure Magnetic.
// Not protected, because G4RKG3_Stepper uses it directly.
/**
* Calculates the value of the derivative 'dydx' at 'y'.
* Calls the virtual function above.
* @param[in] y Coefficients array.
* @param[out] dydx Derivatives array.
*/
inline void RightHandSide( const G4double y[],
G4double dydx[] ) const;
inline const G4Field* GetFieldObj() const;
inline G4Field* GetFieldObj();
inline void SetFieldObj(G4Field* pField);
/**
* Calculates the value of the derivative 'dydx' at 'y' as above,
* but also returns the value of B.
* @param[in] y Coefficients array.
* @param[out] dydx Derivatives array.
* @param[out] Field Field value.
*/
inline void EvaluateRhsReturnB( const G4double y[],
G4double dydx[],
G4double Field[] ) const;
/**
* Returns the 'Field' value at the given time 'Point'.
* @param[in] Point The time point (x,y,z,t).
* @param[out] Field The returned field value.
*/
inline void GetFieldValue( const G4double Point[4],
G4double Field[] ) const;
/**
* Accessors and modifier for the field.
*/
inline const G4Field* GetFieldObj() const;
inline G4Field* GetFieldObj();
inline void SetFieldObj(G4Field* pField);
private:
G4Field* itsField = nullptr;
G4Field* itsField = nullptr;
};
#include "G4EquationOfMotion.icc"