58 double p_sq, mod_p, pz, mass, energy;
62 std::cerr <<
"There is no PDG code for MARS id " << marsParticle->
particleId() << std::endl;
68 if(!massOpt.has_value()) {
69 std::cerr <<
"PDG code " <<
m_pdgId <<
" is not in the particle data table." << std::endl;
72 mass = massOpt.value();
77 p_sq = std::pow(marsParticle->
kineticEnergy() * 1000.0 + mass, 2) - std::pow(mass,2);
78 mod_p = std::sqrt(p_sq);
97 energy=std::sqrt(std::pow(mass,2)+std::pow(mod_p,2));
116 double p_sq, mod_p, pz, mass, energy;
123 std::cerr <<
"There is no PDG code for FLUKA id " << flukaParticle->
flukaId() << std::endl;
129 if(!massOpt.has_value()) {
130 std::cerr <<
"PDG code " <<
m_pdgId <<
" is not in the particle data table." << std::endl;
133 mass = massOpt.value();
138 p_sq = std::pow(flukaParticle->
kineticEnergy() * 1000.0 + mass, 2) - std::pow(mass,2);
139 mod_p = std::sqrt(p_sq);
156 energy=std::sqrt(std::pow(mass,2)+std::pow(mod_p,2));
182 if(flukaParticle->
type() == 0) {
195 std::cout.precision(6);
196 std::cout.width(11); std::cout <<
m_pdgId <<
" ";
197 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.px() <<
" ";
198 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.py() <<
" ";
199 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.pz() <<
" ";
200 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_fourVector.e() <<
" ";
205 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_weight << std::endl;
206 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.x() <<
" ";
207 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.y() <<
" ";
208 std::cout.width(13); std::cout.precision(6); std::cout << std::scientific <<
m_positionAtPrimary.z() <<
" ";
209 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.
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.
std::shared_ptr< GenData > m_gendata
A shared pointer to the GenData helper object.
double weight() const
A function to return the weight of this particle within the input beam background simulation file.
int fill(MarsParticle *marsParticle)
A function to fill the data members from an input MarsParticle object.
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.
Class for particle data access in GenBase.
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.
HepMC3::FourVector FourVector