82 inline double mass()
const;
94 inline double px()
const;
100 inline double py()
const;
106 inline double pz()
const;
115 inline double charge()
const;
126 void print(std::ostream& out)
const;
130 void read(std::istream& in);
199 inline std::ostream& operator<<(std::ostream& out,
const marley::Particle& p)
Momentum four-vector for a simulated particle.
Definition: Particle.hh:32
void set_mass(double m)
Set the particle's mass.
Definition: Particle.hh:177
int pdg_code_
Particle Data Group code identifying this particle
Definition: Particle.hh:159
double mass() const
Get the particle's mass (MeV)
Definition: Particle.hh:176
double kinetic_energy() const
Get the particle's kinetic energy (MeV)
Definition: Particle.cc:99
void set_total_energy(double Etot)
Set the particle's total energy.
Definition: Particle.hh:180
void set_charge(int q)
Set the particle's charge.
Definition: Particle.hh:195
double py() const
Get the y component of the particle's 3-momentum (MeV)
Definition: Particle.hh:186
double mass_
mass (MeV)
Definition: Particle.hh:162
void set_pz(double pz)
Set the z component of the particle's 3-momentum.
Definition: Particle.hh:190
void clear()
Resets all data members to zero.
Definition: Particle.cc:132
void set_py(double py)
Set the y component of the particle's 3-momentum.
Definition: Particle.hh:187
void from_json(const marley::JSON &json)
Replaces the existing object contents with new ones loaded from a JSON representation of a Particle.
Definition: Particle.cc:139
double charge() const
Get the particle's charge in units of the proton charge.
Definition: Particle.hh:194
double momentum_magnitude() const
Get the magnitude of the particle's 3-momentum (MeV)
Definition: Particle.cc:94
double four_momentum_[4]
momentum 4-vector for this particle (MeV)
Definition: Particle.hh:154
marley::JSON to_json() const
Create a JSON representation of this Particle.
Definition: Particle.cc:120
int charge_
Electric charge (net charge in the case of atoms) expressed as an integer multiple of the proton char...
Definition: Particle.hh:172
double total_energy() const
Get the particle's total energy (MeV)
Definition: Particle.hh:179
double pz() const
Get the z component of the particle's 3-momentum (MeV)
Definition: Particle.hh:189
void set_px(double px)
Set the x component of the particle's 3-momentum.
Definition: Particle.hh:184
int pdg_code() const
Get the Particle Data Group code for this particle.
Definition: Particle.hh:192
double px() const
Get the x component of the particle's 3-momentum (MeV)
Definition: Particle.hh:183
void read(std::istream &in)
Read in this particle from a std::istream. Any previous contents of this particle will be deleted.
Definition: Particle.cc:115
void print(std::ostream &out) const
Print information about this particle to a std::ostream.
Definition: Particle.cc:109