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

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 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)
 

Macro Definition Documentation

◆ DBL_DIG

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

Definition at line 79 of file templates.hh.

◆ DBL_EPSILON

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

Definition at line 87 of file templates.hh.

◆ DBL_MAX

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

Definition at line 83 of file templates.hh.

◆ DBL_MIN

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

Definition at line 75 of file templates.hh.

◆ FLT_DIG

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

Definition at line 95 of file templates.hh.

◆ FLT_EPSILON

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

Definition at line 103 of file templates.hh.

◆ FLT_MAX

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

Definition at line 99 of file templates.hh.

◆ FLT_MIN

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

Definition at line 91 of file templates.hh.

◆ G4_SQR_DEFINED

#define G4_SQR_DEFINED

Definition at line 139 of file templates.hh.

◆ HIGH_PRECISION

#define HIGH_PRECISION   1

Definition at line 62 of file templates.hh.

◆ INT_MAX

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

Definition at line 111 of file templates.hh.

◆ INT_MIN

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

Definition at line 115 of file templates.hh.

◆ MAXFLOAT

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

Definition at line 107 of file templates.hh.

Typedef Documentation

◆ Float

typedef double Float

Definition at line 66 of file templates.hh.

Function Documentation

◆ G4lint()

int G4lint ( double  ad)
inline

Definition at line 168 of file templates.hh.

169{
170 return (ad>0) ? static_cast<int>(ad) : static_cast<int>(ad-1.);
171}

◆ G4lrint()

int G4lrint ( double  ad)
inline

Definition at line 163 of file templates.hh.

164{
165 return (ad>0) ? static_cast<int>(ad+.5) : static_cast<int>(ad-.5);
166}

Referenced by G4EmBiasingManager::ActivateSecondaryBiasing(), G4VAtomDeexcitation::AlongStepDeexcitation(), G4BinaryLightIonReaction::ApplyYourself(), G4LowEIonFragmentation::ApplyYourself(), G4BGGNucleonElasticXS::BuildPhysicsTable(), G4BGGNucleonInelasticXS::BuildPhysicsTable(), G4BGGPionElasticXS::BuildPhysicsTable(), G4BGGPionInelasticXS::BuildPhysicsTable(), G4CrossSectionPairGG::BuildPhysicsTable(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4Clebsch::ClebschGordan(), G4Fissioner::collide(), G4VCrossSectionDataSet::ComputeCrossSection(), G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom(), G4LivermorePolarizedPhotoElectricModel::ComputeCrossSectionPerAtom(), G4LivermoreRayleighModel::ComputeCrossSectionPerAtom(), G4WentzelVIModel::ComputeCrossSectionPerAtom(), G4WentzelVIRelModel::ComputeCrossSectionPerAtom(), G4KineticTrack::Decay(), G4PreCompoundModel::DeExcite(), G4CrossSectionDataStore::GetCrossSection(), G4ComponentSAIDTotalXS::GetElasticElementCrossSection(), G4ComponentGGNuclNuclXsc::GetElementCrossSection(), G4GGNuclNuclCrossSection::GetElementCrossSection(), G4IonsKoxCrossSection::GetElementCrossSection(), G4IonsShenCrossSection::GetElementCrossSection(), G4IonsSihverCrossSection::GetElementCrossSection(), G4TripathiCrossSection::GetElementCrossSection(), G4CrossSectionPairGG::GetElementCrossSection(), G4IonProtonCrossSection::GetElementCrossSection(), G4HadronElasticDataSet::GetElementCrossSection(), G4HadronFissionDataSet::GetElementCrossSection(), G4HadronInelasticDataSet::GetElementCrossSection(), G4GeneralSpaceNNCrossSection::GetElementCrossSection(), G4TripathiLightCrossSection::GetElementCrossSection(), G4PionMinusField::GetField(), G4MesonAbsorption::GetFinalState(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXsc(), G4ComponentGGNuclNuclXsc::GetHadronNucleonXsc(), G4GGNuclNuclCrossSection::GetHadronNucleonXsc(), G4GlauberGribovCrossSection::GetHadronNucleonXsc(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscNS(), G4GlauberGribovCrossSection::GetHadronNucleonXscNS(), G4ComponentGGHadronNucleusXsc::GetHadronNucleonXscPDG(), G4GlauberGribovCrossSection::GetHadronNucleonXscPDG(), G4ComponentGGHadronNucleusXsc::GetHNinelasticXsc(), G4GlauberGribovCrossSection::GetHNinelasticXsc(), G4ComponentSAIDTotalXS::GetInelasticElementCrossSection(), G4IonsShenCrossSection::GetIsoCrossSection(), G4ComponentGGHadronNucleusXsc::GetNucleusRadius(), G4GlauberGribovCrossSection::GetNucleusRadius(), G4ProtonInelasticCrossSection::GetProtonCrossSection(), G4CollisionInitialState::GetTargetBaryonNumber(), G4CollisionInitialState::GetTargetCharge(), G4ComponentSAIDTotalXS::GetTotalElementCrossSection(), G4LivermoreRayleighModel::Initialise(), G4VAtomDeexcitation::InitialiseAtomicDeexcitation(), G4hhIonisation::InitialiseEnergyLossProcess(), G4mplIonisation::InitialiseEnergyLossProcess(), G4HadronNucleonXsc::IsApplicable(), G4TripathiLightCrossSection::IsElementApplicable(), G4VXResonance::IsospinCorrection(), G4NeutronHPChannel::Register(), G4ElectronIonPair::SampleNumberOfIonsAlongStep(), G4WentzelVIModel::SampleScattering(), G4WentzelVIRelModel::SampleScattering(), G4eBremParametrizedModel::SampleSecondaries(), G4eBremsstrahlungRelModel::SampleSecondaries(), G4LivermorePhotoElectricModel::SampleSecondaries(), G4LivermorePolarizedPhotoElectricModel::SampleSecondaries(), G4LivermoreRayleighModel::SampleSecondaries(), G4LowEPComptonModel::SampleSecondaries(), G4eBremsstrahlungModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4PEEffectFluoModel::SampleSecondaries(), G4CrossSectionDataStore::SampleZandA(), G4Scatterer::Scatter(), G4QuasiElasticChannel::Scatter(), G4NeutronCaptureXS::SelectIsotope(), G4ElementSelector::SelectZandA(), G4Fragment::SetA(), G4KM_OpticalEqRhs::SetFactor(), G4VEmProcess::SetMaxKinEnergy(), G4VEmProcess::SetMinKinEnergy(), G4Nucleus::SetParameters(), G4Fragment::SetZ(), and G4Clebsch::Wigner3J().

◆ G4rint()

int G4rint ( double  ad)
inline

Definition at line 173 of file templates.hh.

174{
175 return (ad>0) ? static_cast<int>(ad+1) : static_cast<int>(ad);
176}

◆ G4SwapObj()

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

Definition at line 129 of file templates.hh.

130{
131 T tmp= *a;
132 *a = *b;
133 *b = tmp;
134}

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

◆ G4SwapPtr()

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

Definition at line 121 of file templates.hh.

122{
123 T* tmp= a;
124 a = b;
125 b = tmp;
126}

◆ sqr()

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

Definition at line 145 of file templates.hh.

146{
147 return x*x;
148}

Referenced by G4KDTree::__NearestInRange(), G4KDTree::__NearestToNode(), G4KDTree::__NearestToPosition(), G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), G4Transportation::AlongStepGetPhysicalInteractionLength(), G4ITTransportation::AlongStepGetPhysicalInteractionLength(), G4FTFAnnihilation::Annihilate(), G4KineticTrackVector::BoostBeam(), G4QFragmentation::Breeder(), G4QIonIonCollision::Breeder(), G4PairProductionRelModel::CalcLPMFunctions(), G4Ellipsoid::CalculateExtent(), CalculatePointSafety(), G4QFragmentation::ChooseX(), G4QIonIonCollision::ChooseX(), HyperRect::CompareDistSqr(), G4PolarizedComptonModel::ComputeAsymmetryPerAtom(), G4AngularDistributionNP::CosTheta(), G4AngularDistributionPP::CosTheta(), G4DiffractiveExcitation::CreateStrings(), G4QParton::DefineMomentumInZ(), G4Parton::DefineMomentumInZ(), G4GHEKinematicsVector::Defs1(), G4AngularDistribution::DifferentialCrossSection(), G4PolyconeSide::DistanceAway(), G4Ellipsoid::DistanceToIn(), G4EllipticalCone::DistanceToIn(), G4Paraboloid::DistanceToIn(), G4Ellipsoid::DistanceToOut(), G4EllipticalCone::DistanceToOut(), G4Paraboloid::DistanceToOut(), G4PathFinder::DoNextLinearStep(), G4HEInelastic::ElasticScattering(), G4BrentLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), G4SimpleLocator::EstimateIntersectionPoint(), G4ErrorMag_UsualEqRhs::EvaluateRhsGivenB(), G4Mag_SpinEqRhs::EvaluateRhsGivenB(), G4QFragmentation::EvaporateResidual(), G4QFragmentation::ExciteDiffParticipants(), G4QIonIonCollision::ExciteDiffParticipants(), G4SingleDiffractiveExcitation::ExciteParticipants(), G4QFragmentation::ExciteSingDiffParticipants(), G4QIonIonCollision::ExciteSingDiffParticipants(), G4HEAntiNeutronInelastic::FirstIntInCasAntiNeutron(), G4HEAntiProtonInelastic::FirstIntInCasAntiProton(), G4HEKaonPlusInelastic::FirstIntInCasKaonPlus(), G4HEKaonZeroInelastic::FirstIntInCasKaonZero(), G4HEKaonZeroLongInelastic::FirstIntInCasKaonZero(), G4HEKaonZeroShortInelastic::FirstIntInCasKaonZero(), G4HENeutronInelastic::FirstIntInCasNeutron(), G4HEPionMinusInelastic::FirstIntInCasPionMinus(), G4HEPionPlusInelastic::FirstIntInCasPionPlus(), G4HEProtonInelastic::FirstIntInCasProton(), G4FTFParameters::G4FTFParameters(), G4NuclearFermiDensity::G4NuclearFermiDensity(), G4PolarizedComptonCrossSection::G4PolarizedComptonCrossSection(), G4QEnvironment::G4QEnvironment(), G4QFragmentation::G4QFragmentation(), G4QIonIonCollision::G4QIonIonCollision(), G4HEInelastic::GammaRand(), G4QFragmentation::GaussianPt(), G4QIonIonCollision::GaussianPt(), G4ReactionDynamics::GenerateXandPt(), G4NuclearFermiDensity::GetDeriv(), G4MesonAbsorption::GetFinalState(), G4VKinkyStringDecay::GetLightConeGluonZ(), G4FTFParticipants::GetList(), G4QNucleus::GetNucleons4Momentum(), G4PolarizationHelper::GetParticleFrameX(), G4PolarizationHelper::GetParticleFrameY(), G4Polycone::GetPointOnCone(), G4Cons::GetPointOnSurface(), G4Orb::GetPointOnSurface(), G4Sphere::GetPointOnSurface(), G4Ellipsoid::GetPointOnSurface(), G4EllipticalCone::GetPointOnSurface(), G4EllipticalTube::GetPointOnSurface(), G4Hype::GetPointOnSurface(), G4Paraboloid::GetPointOnSurface(), G4Polycone::GetPointOnSurface(), G4Polyhedra::GetPointOnSurface(), G4TwistedTubs::GetPointOnSurface(), G4QProbability::GetPomCohProbability(), G4QProbability::GetPomDubDiffProbability(), G4QProbability::GetQexDubDiffProbability(), G4QProbability::GetQexElProbability(), G4QProbability::GetQexInelProbability(), G4QProbability::GetQexTotProbability(), G4CSGSolid::GetRadiusInRing(), G4PolarizationHelper::GetSpinInPRF(), G4HEInelastic::HighEnergyCascading(), G4HEInelastic::HighEnergyClusterProduction(), G4GHEKinematicsVector::Impu(), G4HEVector::Impu(), G4PolarizedAnnihilationCrossSection::Initialize(), G4PolarizedComptonCrossSection::Initialize(), G4Ellipsoid::Inside(), G4EllipticalCone::Inside(), G4Paraboloid::Inside(), G4QString::LightFragmentationTest(), G4VLongitudinalStringDecay::LightFragmentationTest(), G4IntersectingCone::LineHitsCone1(), G4IntersectingCone::LineHitsCone2(), G4GHEKinematicsVector::Lor(), G4HEVector::Lor(), G4HEInelastic::MediumEnergyCascading(), G4HEInelastic::MediumEnergyClusterProduction(), G4HEInelastic::NBodyPhaseSpace(), G4KDTree::NearestInRange(), G4MagInt_Driver::OneGoodStep(), G4HEInelastic::QuasiElasticScattering(), G4MagInt_Driver::QuickAdvance(), G4SafetyHelper::ReLocateWithinVolume(), G4AntiNuclElastic::SampleInvariantT(), G4VLongitudinalStringDecay::SampleQuarkPt(), G4PolarizedAnnihilationModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), G4PolarizedMollerBhabhaModel::SampleSecondaries(), G4QuasiElasticChannel::Scatter(), G4QGSParticipants::SelectInteractions(), G4EqEMFieldWithEDM::SetChargeMomentumMass(), G4EqEMFieldWithSpin::SetChargeMomentumMass(), G4Mag_SpinEqRhs::SetChargeMomentumMass(), G4QHadron::SplitUp(), G4QGSDiffractiveExcitation::String(), G4QNucleus::SubtractNucleon(), G4PolyconeSide::SurfaceArea(), G4EllipticalCone::SurfaceNormal(), G4Paraboloid::SurfaceNormal(), G4PolarizedAnnihilationCrossSection::TotalXSection(), G4PolarizedComptonCrossSection::TotalXSection(), G4RKPropagation::Transport(), G4HEInelastic::TuningOfHighEnergyCascading(), G4KineticTrack::Update4Momentum(), and G4KineticTrack::UpdateTrackingMomentum().