8#include "HepPDT/ParticleDataTable.hh"
54 double p_sq, mod_p, pz, mass, energy;
58 std::cerr <<
"There is no PDG code for MARS id " << marsParticle->
particleId() << std::endl;
63 const HepPDT::ParticleData* particleData = particleDataTable->particle(HepPDT::ParticleID(std::abs(
m_pdgId)));
66 mass = particleData->mass().value();
69 std::cerr <<
"PDG code " <<
m_pdgId <<
" is not in the particle data table." << std::endl;
76 p_sq = std::pow(marsParticle->
kineticEnergy() * 1000.0 + mass, 2) - std::pow(mass,2);
77 mod_p = std::sqrt(p_sq);
96 energy=std::sqrt(std::pow(mass,2)+std::pow(mod_p,2));
115 double p_sq, mod_p, pz, mass, energy;
122 std::cerr <<
"There is no PDG code for FLUKA id " << flukaParticle->
flukaId() << std::endl;
127 const HepPDT::ParticleData* particleData = particleDataTable->particle(HepPDT::ParticleID(std::abs(
m_pdgId)));
130 mass = particleData->mass().value();
133 std::cerr <<
"PDG code " <<
m_pdgId <<
" is not in the particle data table." << std::endl;
140 p_sq = std::pow(flukaParticle->
kineticEnergy() * 1000.0 + mass, 2) - std::pow(mass,2);
141 mod_p = std::sqrt(p_sq);
158 energy=std::sqrt(std::pow(mass,2)+std::pow(mod_p,2));
184 if(flukaParticle->
type() == 0) {
197 std::cout.precision(6);
198 std::cout.width(11); std::cout <<
m_pdgId <<
" ";
199 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.px() <<
" ";
200 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.py() <<
" ";
201 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.pz() <<
" ";
202 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.e() <<
" ";
207 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_weight << std::endl;
208 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.x() <<
" ";
209 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.y() <<
" ";
210 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.z() <<
" ";
211 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.t() << std::endl;
long m_pdgId
The PDG Id of the particle.
long pdgId() const
A function to return the PDG id of this particle.
HepMC::FourVector m_positionAtScoringPlane
Position of the particle at the scoring plane (x,y,z,t).
void print()
A function to print the contents of this particle.
double m_weight
The resultant particle weight after normalisation and rescaling.
HepMC::FourVector fourVector() const
A function to return the momentum fourvector of this particle.
int fill(const HepPDT::ParticleDataTable *particleDataTable, MarsParticle *marsParticle)
A function to fill the data members from an input MarsParticle object.
HepMC::FourVector m_positionAtPrimary
Position of the particle at the primary interaction point (x,y,z,y).
HepMC::FourVector m_fourVector
A four vector describing this particle at the scoring plane.
double weight() const
A function to return the weight of this particle within the input beam background simulation file.
HepMC::FourVector positionAtScoringPlane() const
A function to return the position fourvector of this particle with respect to the scoring plane.
HepMC::FourVector positionAtPrimary() const
A function to return the position fourvector of this particle with respect to the primary interaction...
A class to describe a FLUKA particle read from an input ASCII file.
HepMC::FourVector positionAtPrimary(void) const
A function to return the position of the primary interaction.
int flukaId(void) const
A function to return the FLUKA particle Id of this particle.
HepMC::FourVector directionalCosines(void) const
A function to return the directional cosines of this particle.
double weight(void) const
A function to return the particle or event weight.
HepMC::FourVector positionAtScoringPlane(void) const
A function to return the fourvector position with respect to the scoring plane of this particle.
double kineticEnergy(void) const
A function to return the relativistic kinetic energy of this particle.
int type(void) const
A function to return the type of this FlukaParticle.
int pdgId()
A function to return the PDG id of this particle.
A class to describe a MARS particle read from an input ASCII file.
HepMC::FourVector positionAtScoringPlane() const
A function to the position of this particle with respect to the scoring plane.
HepMC::FourVector directionalCosines() const
A function to return the directional cosines of this particle.
double kineticEnergy() const
A function to return the relativistic kinetic energy of this particle.
double weight() const
A function to return the weight associated with this particle in the input ASCII file.
int pdgId()
A function to return the PDG id for this particle.
int particleId() const
A function to return the particle identify of this particle.