19#include "BDSParticleCoords.hh"
21#include "G4ThreeVector.hh"
22#include "G4Transform3D.hh"
24#include "CLHEP/Geometry/Point3D.h"
28BDSParticleCoords::BDSParticleCoords():
38BDSParticleCoords::BDSParticleCoords(G4double xIn,
54BDSParticleCoords::BDSParticleCoords(G4ThreeVector pos,
69 if (transform == G4Transform3D::Identity)
72 G4ThreeVector originalPos = G4ThreeVector(x,y,z);
73 G4ThreeVector newPos = transform * (HepGeom::Point3D<G4double>)originalPos;
74 G4ThreeVector originalMom = G4ThreeVector(xp,yp,zp);
75 G4ThreeVector newMom = transform * (HepGeom::Vector3D<G4double>)originalMom;
77 newMom.x(), newMom.y(), newMom.z(),
104 out <<
"Position: (" << x <<
", " << y <<
", " << z <<
")";
105 out <<
", Momentum: (" << xp <<
", " << yp <<
", " << zp <<
")";
106 out <<
", t: " << T << G4endl;
A set of particle coordinates.
virtual void Print(std::ostream &out) const
Actual print out method so it can be called from a derived class.
void AddOffset(const G4ThreeVector &offset)
Apply an offset to the spatial coordinates only - assignment.
BDSParticleCoords ApplyTransform(const G4Transform3D &transform) const
Apply a transform to the coordinates and return a copy of them transformed.
BDSParticleCoords ApplyOffset(const G4ThreeVector &offset) const
Apply an offset to the spatial coordinates only and return a copy.