Skip to content
Snippets Groups Projects
Commit 6a7e673b authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

fix: use positional arguments in hepmc3.GenEvent constructor

parent fe5d5e28
Branches
No related tags found
1 merge request!297fix: use positional arguments in hepmc3.GenEvent constructor
...@@ -21,7 +21,7 @@ PARTICLES = { ...@@ -21,7 +21,7 @@ PARTICLES = {
def gen_event(p, theta, phi, pid, mass): def gen_event(p, theta, phi, pid, mass):
evt = hm.GenEvent(momentum_unit=hm.Units.MomentumUnit.GEV, length_unit=hm.Units.LengthUnit.MM) evt = hm.GenEvent(hm.Units.MomentumUnit.GEV, hm.Units.LengthUnit.MM)
# final state # final state
state = 1 state = 1
e0 = np.sqrt(p*p + mass*mass) e0 = np.sqrt(p*p + mass*mass)
......
...@@ -21,7 +21,7 @@ PARTICLES = { ...@@ -21,7 +21,7 @@ PARTICLES = {
def gen_event(p, theta, phi, pid, mass): def gen_event(p, theta, phi, pid, mass):
evt = hm.GenEvent(momentum_unit=hm.Units.MomentumUnit.GEV, length_unit=hm.Units.LengthUnit.MM) evt = hm.GenEvent(hm.Units.MomentumUnit.GEV, hm.Units.LengthUnit.MM)
# final state # final state
state = 1 state = 1
e0 = np.sqrt(p*p + mass*mass) e0 = np.sqrt(p*p + mass*mass)
......
...@@ -22,7 +22,7 @@ PARTICLES = { ...@@ -22,7 +22,7 @@ PARTICLES = {
# p in GeV, angle in degree, vertex in mm # p in GeV, angle in degree, vertex in mm
def gen_event(prange=(8, 100), arange=(0, 20), phrange=(0., 360.), parts=[(p, m) for p, m in PARTICLES.values()]): def gen_event(prange=(8, 100), arange=(0, 20), phrange=(0., 360.), parts=[(p, m) for p, m in PARTICLES.values()]):
evt = hm.GenEvent(momentum_unit=hm.Units.MomentumUnit.GEV, length_unit=hm.Units.LengthUnit.MM) evt = hm.GenEvent(hm.Units.MomentumUnit.GEV, hm.Units.LengthUnit.MM)
pid, mass = parts[np.random.randint(len(parts))] pid, mass = parts[np.random.randint(len(parts))]
# final state # final state
......
...@@ -22,7 +22,7 @@ PARTICLES = { ...@@ -22,7 +22,7 @@ PARTICLES = {
def gen_event(p, theta, phi, pid, mass): def gen_event(p, theta, phi, pid, mass):
evt = hm.GenEvent(momentum_unit=hm.Units.MomentumUnit.GEV, length_unit=hm.Units.LengthUnit.MM) evt = hm.GenEvent(hm.Units.MomentumUnit.GEV, hm.Units.LengthUnit.MM)
# final state # final state
state = 1 state = 1
e0 = np.sqrt(p*p + mass*mass) e0 = np.sqrt(p*p + mass*mass)
......
...@@ -20,7 +20,7 @@ PARTICLES = [ ...@@ -20,7 +20,7 @@ PARTICLES = [
# p in GeV, angle in degree, vertex in mm # p in GeV, angle in degree, vertex in mm
def gen_event(prange=(8, 100), arange=(0, 20)): def gen_event(prange=(8, 100), arange=(0, 20)):
evt = hm.GenEvent(momentum_unit=hm.Units.MomentumUnit.GEV, length_unit=hm.Units.LengthUnit.MM) evt = hm.GenEvent(hm.Units.MomentumUnit.GEV, hm.Units.LengthUnit.MM)
pid, mass = PARTICLES[np.random.randint(len(PARTICLES))] pid, mass = PARTICLES[np.random.randint(len(PARTICLES))]
# final state # final state
......
...@@ -21,7 +21,7 @@ PARTICLES = { ...@@ -21,7 +21,7 @@ PARTICLES = {
def gen_event(p, theta, phi, pid, mass): def gen_event(p, theta, phi, pid, mass):
evt = hm.GenEvent(momentum_unit=hm.Units.MomentumUnit.GEV, length_unit=hm.Units.LengthUnit.MM) evt = hm.GenEvent(hm.Units.MomentumUnit.GEV, hm.Units.LengthUnit.MM)
# final state # final state
state = 1 state = 1
e0 = np.sqrt(p*p + mass*mass) e0 = np.sqrt(p*p + mass*mass)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment