19#ifndef BDSOUTPUTROOTPARTICLEDATA_H
20#define BDSOUTPUTROOTPARTICLEDATA_H
51 double rigidity(
const double totalEnergy)
const
53 if (!(std::abs(
charge) > std::numeric_limits<double>::epsilon()))
55 if (totalEnergy <=
mass)
60 double momentum = std::sqrt(std::pow(totalEnergy,2) - std::pow(
mass,2));
61 double brho = momentum / 0.29979245799999998 /
charge;
64 double rigidity(
const double totalEnergy,
const double chargeIn)
const
66 if (!(std::abs(chargeIn) > std::numeric_limits<double>::epsilon()))
68 if (totalEnergy <=
mass)
73 double momentum = std::sqrt(std::pow(totalEnergy,2) - std::pow(
mass,2));
74 double brho = momentum / 0.29979245799999998 / chargeIn;
88 double rigidity(
const double totalEnergy)
const
90 if (!(std::abs(
charge) > std::numeric_limits<double>::epsilon()))
92 if (totalEnergy <=
mass)
94 double momentum = std::sqrt(std::pow(totalEnergy,2) - std::pow(
mass,2));
95 double brho = momentum / 0.29979245799999998 /
charge;
98 double rigidity(
const double totalEnergy,
const double chargeIn)
const
100 if (!(std::abs(chargeIn) > std::numeric_limits<double>::epsilon()))
102 if (totalEnergy <=
mass)
104 double momentum = std::sqrt(std::pow(totalEnergy,2) - std::pow(
mass,2));
105 double brho = momentum / 0.29979245799999998 / chargeIn;
114 virtual void Flush();
116 const ParticleInfo GetParticleInfo(
const int& pdgID)
const;
117 const IonInfo GetIonInfo(
const int& pdgID)
const;
118 int Charge(
const int& pdgID)
const;
119 double Mass(
const int& pdgID)
const;
123 const double& totalEnergy)
const;
127 const double& totalEnergy)
const;
129 std::string Name(
const int& pdgID)
const;
130 int IonA(
const int& pdgID)
const;
131 int IonZ(
const int& pdgID)
const;
134 inline bool IsIon(
const int& pdgID)
const {
return pdgID > 1000000000;}
138 void Fill(G4bool fillIons);
141 std::map<int, ParticleInfo> particles;
142 std::map<int, IonInfo> ions;
Geant4 particle data for particles used in simulation.
bool IsIon(const int &pdgID) const
This doesn't count a proton (even with electrons) as an ion.
void Fill(G4bool fillIons)
Fill maps of particle information from Geant4.
double KineticEnergy(const int &pdgID, const double &totalEnergy) const
Calculate kinetic energy of particle given PDG ID and total energy in GeV.
virtual void Flush()
Clear maps.
double Rigidity(const int &pdgID, const double &totalEnergy) const
Calculate rigidity of particle given PDG ID and total energy in GeV.
Simple particle information to be stored per ion specifically.
std::string name
Name of particle.
int z
Atomic number - number of protons in nucleus.
int charge
Charge in units of e.
int a
Mass number - number of nucleons in nucleus.
Simple particle information to be stored per particle.
int charge
Charge in units of e.
std::string name
Name of particle.