Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
templates.hh File Reference
#include <climits>
#include <limits>

Go to the source code of this file.

Macros

#define HIGH_PRECISION   1
 
#define DBL_MIN   std::numeric_limits<double>::min()
 
#define DBL_DIG   std::numeric_limits<double>::digits10
 
#define DBL_MAX   std::numeric_limits<double>::max()
 
#define DBL_EPSILON   std::numeric_limits<double>::epsilon()
 
#define FLT_MIN   std::numeric_limits<float>::min()
 
#define FLT_DIG   std::numeric_limits<float>::digits10
 
#define FLT_MAX   std::numeric_limits<float>::max()
 
#define FLT_EPSILON   std::numeric_limits<float>::epsilon()
 
#define MAXFLOAT   std::numeric_limits<float>::max()
 
#define INT_MAX   std::numeric_limits<int>::max()
 
#define INT_MIN   std::numeric_limits<int>::min()
 
#define LOG_EKIN_MIN   -30
 
#define G4_SQR_DEFINED
 

Typedefs

typedef double Float
 

Functions

template<class T >
void G4SwapPtr (T *&a, T *&b)
 
template<class T >
void G4SwapObj (T *a, T *b)
 
template<class T >
sqr (const T &x)
 
int G4lrint (double ad)
 
int G4lint (double ad)
 
int G4rint (double ad)
 
template<typename... _Args>
void G4ConsumeParameters (_Args &&...)
 

Macro Definition Documentation

◆ DBL_DIG

#define DBL_DIG   std::numeric_limits<double>::digits10

Definition at line 58 of file templates.hh.

◆ DBL_EPSILON

#define DBL_EPSILON   std::numeric_limits<double>::epsilon()

Definition at line 66 of file templates.hh.

◆ DBL_MAX

#define DBL_MAX   std::numeric_limits<double>::max()

Definition at line 62 of file templates.hh.

◆ DBL_MIN

#define DBL_MIN   std::numeric_limits<double>::min()

Definition at line 54 of file templates.hh.

◆ FLT_DIG

#define FLT_DIG   std::numeric_limits<float>::digits10

Definition at line 74 of file templates.hh.

◆ FLT_EPSILON

#define FLT_EPSILON   std::numeric_limits<float>::epsilon()

Definition at line 82 of file templates.hh.

◆ FLT_MAX

#define FLT_MAX   std::numeric_limits<float>::max()

Definition at line 78 of file templates.hh.

◆ FLT_MIN

#define FLT_MIN   std::numeric_limits<float>::min()

Definition at line 70 of file templates.hh.

◆ G4_SQR_DEFINED

#define G4_SQR_DEFINED

Definition at line 122 of file templates.hh.

◆ HIGH_PRECISION

#define HIGH_PRECISION   1

Definition at line 41 of file templates.hh.

◆ INT_MAX

#define INT_MAX   std::numeric_limits<int>::max()

Definition at line 90 of file templates.hh.

◆ INT_MIN

#define INT_MIN   std::numeric_limits<int>::min()

Definition at line 94 of file templates.hh.

◆ LOG_EKIN_MIN

#define LOG_EKIN_MIN   -30

Definition at line 98 of file templates.hh.

◆ MAXFLOAT

#define MAXFLOAT   std::numeric_limits<float>::max()

Definition at line 86 of file templates.hh.

Typedef Documentation

◆ Float

typedef double Float

Definition at line 45 of file templates.hh.

Function Documentation

◆ G4ConsumeParameters()

template<typename... _Args>
void G4ConsumeParameters ( _Args &&  ...)
inline

◆ G4lint()

int G4lint ( double  ad)
inline

Definition at line 139 of file templates.hh.

140{
141 return (ad > 0) ? static_cast<int>(ad) : static_cast<int>(ad - 1.);
142}

◆ G4lrint()

int G4lrint ( double  ad)
inline

Definition at line 134 of file templates.hh.

135{
136 return (ad > 0) ? static_cast<int>(ad + .5) : static_cast<int>(ad - .5);
137}

Referenced by G4EmBiasingManager::ActivateSecondaryBiasing(), G4Material::AddElement(), G4Material::AddMaterial(), G4BinaryLightIonReaction::ApplyYourself(), G4LowEIonFragmentation::ApplyYourself(), G4AdjointCSManager::BuildCrossSectionMatrices(), G4KokoulinMuonNuclearXS::BuildCrossSectionTable(), G4VEnergyLossProcess::BuildLambdaTable(), G4CrossSectionPairGG::BuildPhysicsTable(), G4BGGNucleonElasticXS::BuildPhysicsTable(), G4BGGPionElasticXS::BuildPhysicsTable(), G4BGGPionInelasticXS::BuildPhysicsTable(), G4BGGNucleonInelasticXS::BuildPhysicsTable(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4eBremsstrahlungRelModel::ComputeCrossSectionPerAtom(), G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom(), G4LivermorePolarizedPhotoElectricModel::ComputeCrossSectionPerAtom(), G4IonCoulombScatteringModel::ComputeCrossSectionPerAtom(), G4eCoulombScatteringModel::ComputeCrossSectionPerAtom(), G4hCoulombScatteringModel::ComputeCrossSectionPerAtom(), G4JAEAElasticScatteringModel::ComputeCrossSectionPerAtom(), G4JAEAPolarizedElasticScatteringModel::ComputeCrossSectionPerAtom(), G4LivermoreComptonModel::ComputeCrossSectionPerAtom(), G4LivermorePolarizedComptonModel::ComputeCrossSectionPerAtom(), G4LivermorePolarizedPhotoElectricGDModel::ComputeCrossSectionPerAtom(), G4LivermorePolarizedRayleighModel::ComputeCrossSectionPerAtom(), G4LivermoreRayleighModel::ComputeCrossSectionPerAtom(), G4LowEPComptonModel::ComputeCrossSectionPerAtom(), G4LowEPPolarizedComptonModel::ComputeCrossSectionPerAtom(), G4BoldyshevTripletModel::ComputeCrossSectionPerAtom(), G4PairProductionRelModel::ComputeCrossSectionPerAtom(), G4LivermoreGammaConversion5DModel::ComputeCrossSectionPerAtom(), G4LivermoreGammaConversionModel::ComputeCrossSectionPerAtom(), G4WentzelVIModel::ComputeCrossSectionPerAtom(), G4WentzelVIRelModel::ComputeCrossSectionPerAtom(), G4UrbanAdjointMscModel::ComputeCrossSectionPerAtom(), G4UrbanMscModel::ComputeCrossSectionPerAtom(), G4EmCalculator::ComputeCrossSectionPerAtom(), G4eBremsstrahlungRelModel::ComputeDEDXPerVolume(), G4AtimaEnergyLossModel::ComputeDEDXPerVolume(), G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(), G4hBremsstrahlungModel::ComputeDMicroscopicCrossSection(), G4PairProductionRelModel::ComputeDXSectionPerAtom(), G4PairProductionRelModel::ComputeRelDXSectionPerAtom(), G4PairProductionRelModel::ComputeXSectionPerAtom(), G4KineticTrack::Decay(), G4Fissioner::deExcite(), G4PreCompoundModel::DeExcite(), G4AtimaFluctuations::Dispersion(), G4Element::G4Element(), G4IonisParamElm::G4IonisParamElm(), G4Material::G4Material(), G4mplIonisationWithDeltaModel::G4mplIonisationWithDeltaModel(), G4ComponentGGNuclNuclXsc::GetCoulombBarier(), G4ComponentSAIDTotalXS::GetElasticElementCrossSection(), G4ComponentGGHadronNucleusXsc::GetElasticElementCrossSection(), G4ComponentGGNuclNuclXsc::GetElasticElementCrossSection(), G4IonsKoxCrossSection::GetElementCrossSection(), G4IonsShenCrossSection::GetElementCrossSection(), G4IonsSihverCrossSection::GetElementCrossSection(), G4TripathiCrossSection::GetElementCrossSection(), G4CrossSectionPairGG::GetElementCrossSection(), G4HadronElasticDataSet::GetElementCrossSection(), G4HadronInelasticDataSet::GetElementCrossSection(), G4GeneralSpaceNNCrossSection::GetElementCrossSection(), G4TripathiLightCrossSection::GetElementCrossSection(), G4PionMinusField::GetField(), G4MesonAbsorption::GetFinalState(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXsc(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscPDG(), G4ComponentGGHadronNucleusXsc::GetHNinelasticXsc(), G4ComponentSAIDTotalXS::GetInelasticElementCrossSection(), G4ComponentGGHadronNucleusXsc::GetInelasticElementCrossSection(), G4ComponentGGNuclNuclXsc::GetInelasticElementCrossSection(), G4IonsShenCrossSection::GetIsoCrossSection(), G4MuonMinusBoundDecay::GetMuonDecayRate(), G4ComponentGGHadronNucleusXsc::GetProductionElementCrossSection(), G4ProtonInelasticCrossSection::GetProtonCrossSection(), G4ComponentGGNuclNuclXsc::GetRatioQE(), G4ComponentGGNuclNuclXsc::GetRatioSD(), G4CollisionInitialState::GetTargetBaryonNumber(), G4CollisionInitialState::GetTargetCharge(), G4ComponentSAIDTotalXS::GetTotalElementCrossSection(), G4ComponentGGHadronNucleusXsc::GetTotalElementCrossSection(), G4ComponentGGNuclNuclXsc::GetTotalElementCrossSection(), G4JAEAElasticScatteringModel::Initialise(), G4JAEAPolarizedElasticScatteringModel::Initialise(), G4LivermoreComptonModel::Initialise(), G4LivermorePolarizedComptonModel::Initialise(), G4LivermorePolarizedRayleighModel::Initialise(), G4LowEPComptonModel::Initialise(), G4LowEPPolarizedComptonModel::Initialise(), G4eplusTo2GammaOKVIModel::Initialise(), G4WentzelVIModel::Initialise(), G4hhIonisation::InitialiseEnergyLossProcess(), G4mplIonisation::InitialiseEnergyLossProcess(), G4hIonisation::InitialiseEnergyLossProcess(), G4GammaGeneralProcess::InitialiseProcess(), G4GoudsmitSaundersonTable::InitSCPCorrection(), G4eDPWAElasticDCS::InitSCPCorrection(), G4EmCorrections::IonHighOrderCorrections(), G4TripathiLightCrossSection::IsElementApplicable(), G4VXResonance::IsospinCorrection(), G4MuPairProductionModel::MaxSecondaryEnergyForElement(), G4eCoulombScatteringModel::MinPrimaryEnergy(), G4hCoulombScatteringModel::MinPrimaryEnergy(), G4VEnergyLossProcess::PreparePhysicsTable(), G4ParticleHPChannel::Register(), G4ElectronIonPair::SampleNumberOfIonsAlongStep(), G4eBremParametrizedModel::SampleSecondaries(), G4JAEAElasticScatteringModel::SampleSecondaries(), G4JAEAPolarizedElasticScatteringModel::SampleSecondaries(), G4LivermoreComptonModel::SampleSecondaries(), G4LivermorePolarizedPhotoElectricGDModel::SampleSecondaries(), G4LivermorePolarizedPhotoElectricModel::SampleSecondaries(), G4LivermoreRayleighModel::SampleSecondaries(), G4PAIModel::SampleSecondaries(), G4PAIPhotModel::SampleSecondaries(), G4PEEffectFluoModel::SampleSecondaries(), G4Scatterer::Scatter(), G4QuasiElasticChannel::Scatter(), G4ElementSelector::SelectZandA(), G4Fragment::SetA(), G4KM_OpticalEqRhs::SetFactor(), G4EmParameters::SetMaxEnergy(), G4VEmProcess::SetMaxKinEnergy(), G4EmParameters::SetMinEnergy(), G4VEmProcess::SetMinKinEnergy(), G4EmParameters::SetNumberOfBins(), G4EmParameters::SetNumberOfBinsPerDecade(), G4Nucleus::SetParameters(), G4ScreeningMottCrossSection::SetupKinematic(), G4IonCoulombCrossSection::SetupTarget(), and G4Fragment::SetZ().

◆ G4rint()

int G4rint ( double  ad)
inline

Definition at line 144 of file templates.hh.

145{
146 return (ad > 0) ? static_cast<int>(ad + 1) : static_cast<int>(ad);
147}

◆ G4SwapObj()

template<class T >
void G4SwapObj ( T *  a,
T *  b 
)
inline

Definition at line 112 of file templates.hh.

113{
114 T tmp = *a;
115 *a = *b;
116 *b = tmp;
117}

Referenced by G4KineticTrack::G4KineticTrack(), and G4MesonSplitter::SplitMeson().

◆ G4SwapPtr()

template<class T >
void G4SwapPtr ( T *&  a,
T *&  b 
)
inline

Definition at line 104 of file templates.hh.

105{
106 T* tmp = a;
107 a = b;
108 b = tmp;
109}

◆ sqr()

template<class T >
T sqr ( const T &  x)
inline

Definition at line 128 of file templates.hh.

129{
130 return x * x;
131}

Referenced by G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), G4Transportation::AlongStepGetPhysicalInteractionLength(), G4ITTransportation::AlongStepGetPhysicalInteractionLength(), G4FTFAnnihilation::Annihilate(), G4KineticTrackVector::BoostBeam(), G4Reggeons::CalculateXs(), G4Reggeons::Chi_pomeron(), G4Reggeons::Chi_reggeon(), G4KDTree::HyperRect::CompareDistSqr(), G4PolarizedComptonModel::ComputeAsymmetryPerAtom(), G4Navigator::ComputeSafety(), G4PathFinder::ComputeStep(), G4AngularDistributionNP::CosTheta(), G4AngularDistributionPP::CosTheta(), G4DiffractiveExcitation::CreateStrings(), G4Parton::DefineMomentumInZ(), G4GHEKinematicsVector::Defs1(), G4QGSParticipants::DeterminePartonMomenta(), G4AngularDistribution::DifferentialCrossSection(), G4PolyconeSide::DistanceAway(), G4EllipticalCone::DistanceToIn(), G4Paraboloid::DistanceToIn(), G4EllipticalCone::DistanceToOut(), G4Paraboloid::DistanceToOut(), G4PathFinder::DoNextLinearStep(), G4ITPathFinder::DoNextLinearStep(), G4ElasticHNScattering::ElasticScattering(), G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), G4SimpleLocator::EstimateIntersectionPoint(), G4ErrorMag_UsualEqRhs::EvaluateRhsGivenB(), G4Mag_SpinEqRhs::EvaluateRhsGivenB(), G4QuarkExchange::ExciteParticipants(), G4SingleDiffractiveExcitation::ExciteParticipants(), G4QGSDiffractiveExcitation::ExciteParticipants(), G4DiffractiveExcitation::ExciteParticipants(), G4ExcitedStringDecay::FragmentStrings(), G4Navigator::G4Navigator(), G4NuclearFermiDensity::G4NuclearFermiDensity(), G4PolarizedComptonCrossSection::G4PolarizedComptonCrossSection(), G4QGSParticipants::G4QGSParticipants(), G4Reggeons::G4Reggeons(), G4NuclearFermiDensity::GetDeriv(), G4MesonAbsorption::GetFinalState(), G4FTFParticipants::GetList(), G4PolarizationHelper::GetParticleFrameX(), G4PolarizationHelper::GetParticleFrameY(), G4Sphere::GetPointOnSurface(), G4Hype::GetPointOnSurface(), G4Paraboloid::GetPointOnSurface(), G4TwistedTubs::GetPointOnSurface(), G4Reggeons::GetProbabilities(), G4PolarizationHelper::GetSpinInPRF(), G4GHEKinematicsVector::Impu(), G4FTFParameters::InitForInteraction(), G4PolarizedAnnihilationCrossSection::Initialize(), G4PolarizedComptonCrossSection::Initialize(), G4Paraboloid::Inside(), G4IntersectingCone::LineHitsCone1(), G4IntersectingCone::LineHitsCone2(), G4PathFinder::Locate(), G4GHEKinematicsVector::Lor(), G4KDTree::NearestInRange(), G4MagInt_Driver::OneGoodStep(), G4OldMagIntDriver::OneGoodStep(), G4VLongitudinalStringDecay::ProduceOneHadron(), G4GeneratorPrecompoundInterface::Propagate(), G4MagInt_Driver::QuickAdvance(), G4OldMagIntDriver::QuickAdvance(), G4PathFinder::ReLocate(), G4SafetyHelper::ReLocateWithinVolume(), G4ITSafetyHelper::ReLocateWithinVolume(), G4GeomTools::RemoveRedundantVertices(), G4AntiNuclElastic::SampleInvariantT(), G4PolarizedAnnihilationModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), G4PolarizedMollerBhabhaModel::SampleSecondaries(), G4QuasiElasticChannel::Scatter(), G4QGSParticipants::SelectInteractions(), G4EqEMFieldWithEDM::SetChargeMomentumMass(), G4EqEMFieldWithSpin::SetChargeMomentumMass(), G4Mag_SpinEqRhs::SetChargeMomentumMass(), G4RepleteEofM::SetChargeMomentumMass(), G4QGSDiffractiveExcitation::String(), G4PolyconeSide::SurfaceArea(), G4Paraboloid::SurfaceNormal(), G4PolarizedAnnihilationCrossSection::TotalXSection(), G4PolarizedComptonCrossSection::TotalXSection(), G4RKPropagation::Transport(), G4KineticTrack::Update4Momentum(), and G4KineticTrack::UpdateTrackingMomentum().