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
@@ -29,80 +29,92 @@
//
// Container for magnetic charge and moments.
// Authors: J.Apostolakis, P.Gumplinger - 10 April 2013
// Authors: J.Apostolakis (CERN), P.Gumplinger (TRIUMF), 10.04.2013
// -------------------------------------------------------------------
#ifndef G4CHARGESTATE_HH
#define G4CHARGESTATE_HH
#include "globals.hh"
/**
* @brief G4ChargeState is a container for magnetic charge and moments.
*/
class G4ChargeState
{
public:
public:
inline G4ChargeState(G4double charge,
G4double magnetic_dipole_moment,
G4double pdgSpin,
G4double electric_dipole_moment = 0.0,
G4double magnetic_charge = 0.0);
/**
* Constructor for G4ChargeState.
* @param[in] charge Particle charge.
* @param[in] magnetic_dipole_moment Magnetic dipole moment.
* @param[in] pdgSpin Spin.
* @param[in] electric_dipole_moment Electric dipole moment.
* @param[in] magnetic_charge Magnetic charge for monopoles.
*/
inline G4ChargeState(G4double charge,
G4double magnetic_dipole_moment,
G4double pdgSpin,
G4double electric_dipole_moment = 0.0,
G4double magnetic_charge = 0.0);
inline G4ChargeState( const G4ChargeState& right );
inline G4ChargeState& operator = ( const G4ChargeState& right );
/**
* Copy constructor and assignment operator.
*/
inline G4ChargeState( const G4ChargeState& right );
inline G4ChargeState& operator = ( const G4ChargeState& right );
void SetChargeSpinMoments(G4double charge,
G4double pdgSpin,
G4double magnetic_dipole_moment= DBL_MAX,
G4double electric_dipole_moment= DBL_MAX,
G4double magnetic_charge= DBL_MAX );
// Revise the charge, pdgSpin, and optionally both moments
// and magnetic charge
/**
* Default Destructor.
*/
~G4ChargeState() = default;
void SetCharge(G4double charge){ fCharge = charge; }
G4double GetCharge() const { return fCharge; }
// Revise the charge (in units of the positron charge)
/**
* Revises the charge, pdgSpin, and optionally both moments and
* magnetic charge.
*/
void SetChargeSpinMoments(G4double charge,
G4double pdgSpin,
G4double magnetic_dipole_moment= DBL_MAX,
G4double electric_dipole_moment= DBL_MAX,
G4double magnetic_charge= DBL_MAX );
/**
* Revises the charge (in units of the positron charge).
*/
inline void SetCharge(G4double charge);
inline G4double GetCharge() const;
// Basic Get / Set methods
/**
* Modifiers and accessors.
*/
inline void SetPDGSpin(G4double spin);
inline G4double GetPDGSpin() const;
inline void SetSpin(G4double spin);
inline G4double GetSpin() const;
inline void SetMagneticDipoleMoment(G4double moment);
inline G4double GetMagneticDipoleMoment() const;
inline void SetElectricDipoleMoment(G4double moment);
inline G4double ElectricDipoleMoment() const;
inline void SetMagneticCharge(G4double charge);
inline G4double MagneticCharge() const;
void SetPDGSpin(G4double spin){ fSpin = spin; }
G4double GetPDGSpin() const { return fSpin; }
void SetMagneticDipoleMoment(G4double moment){ fMagn_dipole = moment; }
G4double GetMagneticDipoleMoment() const { return fMagn_dipole; }
void SetElectricDipoleMoment(G4double moment){ fElec_dipole = moment; }
G4double ElectricDipoleMoment() const { return fElec_dipole; }
void SetMagneticCharge(G4double charge){ fMagneticCharge=charge; }
G4double MagneticCharge() const { return fMagneticCharge; }
// Auxiliary methods to set several properties at once
inline void SetChargeMdm(G4double charge, G4double mag_dipole_moment);
// SetCharge and Magnetic Dipole Moment
inline void SetChargeMdmSpin(G4double charge,
G4double magnetic_dipole_moment,
G4double pdgSpin);
inline void SetChargeSpin(G4double charge,
G4double pdgSpin);
// Revise the charge, spin and all both moments
inline void SetChargeDipoleMoments(G4double charge,
/**
* Auxiliary methods to set several properties at once.
*/
inline void SetChargeMdm(G4double charge, G4double mag_dipole_moment);
inline void SetChargeMdmSpin(G4double charge,
G4double magnetic_dipole_moment,
G4double electric_dipole_moment);
inline void SetChargesAndMoments(G4double charge,
G4double magnetic_dipole_moment,
G4double electric_dipole_moment,
G4double magnetic_charge );
// Obsolete
//
inline void SetSpin(G4double spin){ SetPDGSpin( spin); }
inline G4double GetSpin() const { return GetPDGSpin(); }
G4double pdgSpin);
inline void SetChargeSpin(G4double charge,
G4double pdgSpin);
inline void SetChargeDipoleMoments(G4double charge,
G4double magnetic_dipole_moment,
G4double electric_dipole_moment);
inline void SetChargesAndMoments(G4double charge,
G4double magnetic_dipole_moment,
G4double electric_dipole_moment,
G4double magnetic_charge );
private:
@@ -115,78 +127,6 @@ class G4ChargeState
// Inline methods implementation
inline G4ChargeState::G4ChargeState(G4double charge,
G4double magnetic_dipole_moment,
G4double spin,
G4double electric_dipole_moment,
G4double magnetic_charge)
{
fCharge = charge;
fSpin = spin;
fMagn_dipole = magnetic_dipole_moment;
fElec_dipole = electric_dipole_moment;
fMagneticCharge = magnetic_charge;
}
#include "G4ChargeState.icc"
inline G4ChargeState::G4ChargeState( const G4ChargeState& right )
{
fCharge = right.fCharge;
fSpin = right.fSpin;
fMagn_dipole = right.fMagn_dipole;
fElec_dipole = right.fElec_dipole;
fMagneticCharge = right.fMagneticCharge;
}
inline G4ChargeState& G4ChargeState::operator = ( const G4ChargeState& right )
{
if (&right == this) { return *this; }
fCharge = right.fCharge;
fSpin = right.fSpin;
fMagn_dipole = right.fMagn_dipole;
fElec_dipole = right.fElec_dipole;
fMagneticCharge = right.fMagneticCharge;
return *this;
}
inline void G4ChargeState::SetChargeMdm(G4double charge, G4double mdipole_mom)
{
SetCharge( charge );
SetMagneticDipoleMoment( mdipole_mom );
}
inline void G4ChargeState::SetChargeMdmSpin(G4double charge,
G4double magDipoleMoment,
G4double pdgSpin)
{
SetChargeMdm( charge, magDipoleMoment );
SetPDGSpin( pdgSpin );
}
inline void G4ChargeState::SetChargeSpin(G4double charge,
G4double pdgSpin)
{
SetCharge( charge );
SetPDGSpin( pdgSpin );
}
inline void
G4ChargeState::SetChargeDipoleMoments(G4double charge,
G4double magneticDM,
G4double electricDM)
{
SetChargeMdm( charge, magneticDM );
SetElectricDipoleMoment( electricDM );
}
inline void
G4ChargeState::SetChargesAndMoments(G4double charge,
G4double magneticDM,
G4double electricDM,
G4double magnetic_charge )
{
SetChargeDipoleMoments( charge, magneticDM, electricDM);
SetMagneticCharge( magnetic_charge );
}
#endif