diff options
| author | Anthony LaTorre <devnull@localhost> | 2013-11-08 22:03:49 -0600 |
|---|---|---|
| committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:39 -0700 |
| commit | 8374553fcc23b127d0edd9d3f02239bc15d7d9d6 (patch) | |
| tree | 63526ce7ca00eebb282d81f7c2a7831685efb717 /chroma | |
| parent | 4d81f5272d94c6e3d7932d5e06146ec1fcc99450 (diff) | |
| download | chroma-8374553fcc23b127d0edd9d3f02239bc15d7d9d6.tar.gz chroma-8374553fcc23b127d0edd9d3f02239bc15d7d9d6.tar.bz2 chroma-8374553fcc23b127d0edd9d3f02239bc15d7d9d6.zip | |
cleanup tests
Diffstat (limited to 'chroma')
| -rw-r--r-- | chroma/generator/vertex.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chroma/generator/vertex.py b/chroma/generator/vertex.py index b49ad90..3629b5b 100644 --- a/chroma/generator/vertex.py +++ b/chroma/generator/vertex.py @@ -5,6 +5,7 @@ from chroma.pi0 import pi0_decay from chroma import event from chroma.sample import uniform_sphere from chroma.itertoolset import repeatfunc +from chroma.transform import norm # generator parts for use with gun() @@ -43,7 +44,7 @@ def flat(e_lo, e_hi): def particle_gun(particle_name_iter, pos_iter, dir_iter, ke_iter, t0_iter=constant(0.0), start_id=0): for i, particle_name, pos, dir, ke, t0 in izip(count(start_id), particle_name_iter, pos_iter, dir_iter, ke_iter, t0_iter): - dir /= np.linalg.norm(dir) + dir = dir/norm(dir) vertex = event.Vertex(particle_name, pos, dir, ke, t0=t0) ev_vertex = event.Event(i, vertex, [vertex]) yield ev_vertex @@ -54,7 +55,7 @@ def pi0_gun(pos_iter, dir_iter, ke_iter, t0_iter=constant(0.0), start_id=0, gamm gamma1_dir_iter = isotropic() for i, pos, dir, ke, t0, gamma1_dir in izip(count(start_id), pos_iter, dir_iter, ke_iter, t0_iter, gamma1_dir_iter): - dir /= np.linalg.norm(dir) + dir = dir/norm(dir) primary_vertex = event.Vertex('pi0', pos, dir, ke, t0=t0) # In rest frame |
