OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
OpalParticle Class Reference

#include <OpalParticle.h>

Collaboration diagram for OpalParticle:

Public Types

enum  { X , Y , L , INVALID }

Public Member Functions

 OpalParticle (int64_t id, double x, double px, double y, double py, double z, double pz, double time, double q, double m)
 Constructor.
 OpalParticle (int64_t id, Vector_t const &R, Vector_t const &P, double time, double q, double m)
 OpalParticle ()
void setX (double)
 Set the horizontal position in m.
void setPx (double)
 Set the horizontal momentum.
void setY (double)
 Set the vertical displacement in m.
void setPy (double)
 Set the vertical momentum.
void setZ (double)
 Set longitudinal position in m.
void setPz (double)
 Set the longitudinal momentum.
void setR (Vector_t const &)
 Set position in m.
void setP (Vector_t const &)
 Set momentum.
void setTime (double t)
 Set the time.
int64_t getId () const
 Get the id of the particle.
double operator[] (unsigned int) const
 Get coordinate.
double getX () const
 Get horizontal position in m.
double getPx () const
 Get horizontal momentum (no dimension).
double getY () const
 Get vertical displacement in m.
double getPy () const
 Get vertical momentum (no dimension).
double getZ () const
 Get longitudinal displacement c*t in m.
double getPz () const
 Get relative momentum error (no dimension).
const Vector_tgetR () const
 Get position in m.
const Vector_tgetP () const
 Get momentum.
double getTime () const
 Get time.
double getCharge () const
 Get charge in Coulomb.
double getMass () const
 Get mass in GeV/c^2.

Private Attributes

int64_t id_m
Vector_t R_m
Vector_t P_m
double time_m
double charge_m
double mass_m

Detailed Description

Definition at line 23 of file OpalParticle.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
INVALID 

Definition at line 28 of file OpalParticle.h.

Constructor & Destructor Documentation

◆ OpalParticle() [1/3]

OpalParticle::OpalParticle ( int64_t id,
double x,
double px,
double y,
double py,
double z,
double pz,
double time,
double q,
double m )

Constructor.

Definition at line 25 of file OpalParticle.cpp.

References charge_m, id_m, mass_m, P_m, R_m, and time_m.

◆ OpalParticle() [2/3]

OpalParticle::OpalParticle ( int64_t id,
Vector_t const & R,
Vector_t const & P,
double time,
double q,
double m )

Definition at line 39 of file OpalParticle.cpp.

References charge_m, id_m, mass_m, P_m, R_m, and time_m.

◆ OpalParticle() [3/3]

OpalParticle::OpalParticle ( )

Definition at line 21 of file OpalParticle.cpp.

Member Function Documentation

◆ getCharge()

double OpalParticle::getCharge ( ) const
inline

Get charge in Coulomb.

Definition at line 243 of file OpalParticle.h.

References charge_m.

Referenced by DistributionMoments::computeStatistics(), and LossDataSink::saveH5().

◆ getId()

int64_t OpalParticle::getId ( ) const
inline

Get the id of the particle.

Definition at line 176 of file OpalParticle.h.

References id_m.

Referenced by DistributionMoments::isParticleExcluded(), LossDataSink::saveASCII(), and LossDataSink::saveH5().

◆ getMass()

double OpalParticle::getMass ( ) const
inline

Get mass in GeV/c^2.

Definition at line 249 of file OpalParticle.h.

References mass_m.

Referenced by DistributionMoments::computeMeans(), DistributionMoments::computeStatistics(), and LossDataSink::saveH5().

◆ getP()

◆ getPx()

double OpalParticle::getPx ( ) const
inline

◆ getPy()

double OpalParticle::getPy ( ) const
inline

◆ getPz()

double OpalParticle::getPz ( ) const
inline

Get relative momentum error (no dimension).

Definition at line 219 of file OpalParticle.h.

References L, and P_m.

Referenced by Tracker::applyTransform(), LossDataSink::computeSetStatistics(), PartBunchBase< T, Dim >::maximumAmplitudes(), LossDataSink::saveASCII(), and LossDataSink::saveH5().

◆ getR()

const Vector_t & OpalParticle::getR ( ) const
inline

Get position in m.

Definition at line 225 of file OpalParticle.h.

References R_m.

Referenced by PartBunchBase< T, Dim >::push_back(), and PartBunchBase< T, Dim >::setParticle().

◆ getTime()

double OpalParticle::getTime ( ) const
inline

◆ getX()

◆ getY()

◆ getZ()

double OpalParticle::getZ ( ) const
inline

◆ operator[]()

double OpalParticle::operator[] ( unsigned int i) const
inline

Get coordinate.

Definition at line 182 of file OpalParticle.h.

References P_m, PAssert_LT, and R_m.

◆ setP()

void OpalParticle::setP ( Vector_t const & P)
inline

Set momentum.

Definition at line 164 of file OpalParticle.h.

References P_m.

◆ setPx()

void OpalParticle::setPx ( double val)
inline

Set the horizontal momentum.

Definition at line 140 of file OpalParticle.h.

References P_m, and X.

Referenced by Tracker::applyThinMultipole(), Tracker::applyThinSBend(), and Tracker::applyTransform().

◆ setPy()

void OpalParticle::setPy ( double val)
inline

Set the vertical momentum.

Definition at line 146 of file OpalParticle.h.

References P_m, and Y.

Referenced by Tracker::applyThinMultipole(), Tracker::applyThinSBend(), and Tracker::applyTransform().

◆ setPz()

void OpalParticle::setPz ( double val)
inline

Set the longitudinal momentum.

Definition at line 152 of file OpalParticle.h.

References L, and P_m.

◆ setR()

void OpalParticle::setR ( Vector_t const & R)
inline

Set position in m.

Definition at line 158 of file OpalParticle.h.

References R_m.

◆ setTime()

void OpalParticle::setTime ( double t)
inline

Set the time.

Definition at line 170 of file OpalParticle.h.

References time_m.

◆ setX()

void OpalParticle::setX ( double val)
inline

Set the horizontal position in m.

Definition at line 122 of file OpalParticle.h.

References R_m, and X.

Referenced by Tracker::applyDrift(), and Tracker::applyTransform().

◆ setY()

void OpalParticle::setY ( double val)
inline

Set the vertical displacement in m.

Definition at line 128 of file OpalParticle.h.

References R_m, and Y.

Referenced by Tracker::applyDrift(), and Tracker::applyTransform().

◆ setZ()

void OpalParticle::setZ ( double val)
inline

Set longitudinal position in m.

Definition at line 134 of file OpalParticle.h.

References L, and R_m.

Referenced by Tracker::applyDrift(), and Tracker::applyTransform().

Member Data Documentation

◆ charge_m

double OpalParticle::charge_m
private

Definition at line 117 of file OpalParticle.h.

Referenced by getCharge(), OpalParticle(), and OpalParticle().

◆ id_m

int64_t OpalParticle::id_m
private

Definition at line 113 of file OpalParticle.h.

Referenced by getId(), OpalParticle(), and OpalParticle().

◆ mass_m

double OpalParticle::mass_m
private

Definition at line 118 of file OpalParticle.h.

Referenced by getMass(), OpalParticle(), and OpalParticle().

◆ P_m

Vector_t OpalParticle::P_m
private

◆ R_m

Vector_t OpalParticle::R_m
private

Definition at line 114 of file OpalParticle.h.

Referenced by getR(), getX(), getY(), getZ(), OpalParticle(), OpalParticle(), operator[](), setR(), setX(), setY(), and setZ().

◆ time_m

double OpalParticle::time_m
private

Definition at line 116 of file OpalParticle.h.

Referenced by getTime(), OpalParticle(), OpalParticle(), and setTime().


The documentation for this class was generated from the following files: