Skip to content
Snippets Groups Projects
Commit de18abb4 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: add units: GeV, mm, ns

parent 3edd5e5d
No related branches found
No related tags found
No related merge requests found
......@@ -25,8 +25,11 @@ bool G4PrimaryCnvTool::mutate(G4Event* anEvent) {
// vertex
const plcio::DoubleThree& vertex = p.getVertex();
double t = p.getMass();
G4PrimaryVertex* g4vtx = new G4PrimaryVertex(vertex.x, vertex.y, vertex.z, t);
double t = p.getTime()*CLHEP::ns;
G4PrimaryVertex* g4vtx = new G4PrimaryVertex(vertex.x*CLHEP::mm,
vertex.y*CLHEP::mm,
vertex.z*CLHEP::mm,
t);
// pdg/particle
int pdgcode = p.getPDG();
G4ParticleTable* particletbl = G4ParticleTable::GetParticleTable();
......@@ -35,9 +38,9 @@ bool G4PrimaryCnvTool::mutate(G4Event* anEvent) {
// momentum
const plcio::FloatThree& momentum = p.getMomentum();
G4PrimaryParticle* g4prim = new G4PrimaryParticle(particle_def,
momentum.x,
momentum.y,
momentum.z);
momentum.x*CLHEP::GeV,
momentum.y*CLHEP::GeV,
momentum.z*CLHEP::GeV);
g4vtx->SetPrimary(g4prim);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment