Skip to content
Snippets Groups Projects
Commit a580aa08 authored by Dave Casper's avatar Dave Casper
Browse files

Merge branch 'master-geniereader-units' into 'master'

Fix critical units error

See merge request faser/calypso!193
parents d3dc802b 792150ea
Branches master
No related tags found
No related merge requests found
Pipeline #4089043 passed
......@@ -3,6 +3,8 @@
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from GeneratorModules.EvgenAlg import EvgenAlg
from AthenaPython.PyAthena import StatusCode
from AthenaCommon.SystemOfUnits import GeV, m
import ROOT
__author__ = "Dave Caser <dcasper@uci.edu>"
......@@ -20,7 +22,7 @@ class GenieReader(EvgenAlg):
from AthenaPython.PyAthena import HepMC as HepMC
evt.weights().push_back(1.0)
pos = HepMC.FourVector(self.evtStore["vx"]*1000, self.evtStore["vy"]*1000, self.evtStore["vz"]*1000, 0)
pos = HepMC.FourVector(self.evtStore["vx"]*m, self.evtStore["vy"]*m, self.evtStore["vz"]*m, 0)
gv = HepMC.GenVertex(pos)
ROOT.SetOwnership(gv, False)
evt.add_vertex(gv)
......@@ -36,9 +38,9 @@ class GenieReader(EvgenAlg):
for i in range(nParticles):
gp = HepMC.GenParticle()
mom = HepMC.FourVector(px[i], py[i], pz[i], E[i])
mom = HepMC.FourVector(px[i]*GeV, py[i]*GeV, pz[i]*GeV, E[i]*GeV)
gp.set_momentum(mom)
gp.set_generated_mass(M[i])
gp.set_generated_mass(M[i]*GeV)
gp.set_pdg_id(pdgc[i])
genie_status = status[i]
if (genie_status == 0): # initial particle
......
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