summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2012-05-24 11:34:34 -0400
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:39 -0700
commit3400bcdaea699db49199d09ef045d75b28fc9cd7 (patch)
tree144c071cdbce03e35c347c94b12cfbc7b8c8dad5
parent57424359aefd4221c64582573c8424c61fd7dc51 (diff)
downloadchroma-3400bcdaea699db49199d09ef045d75b28fc9cd7.tar.gz
chroma-3400bcdaea699db49199d09ef045d75b28fc9cd7.tar.bz2
chroma-3400bcdaea699db49199d09ef045d75b28fc9cd7.zip
Minor change to allow eval_pdf to take a generator that emits
chroma.event.Photons objects to compute PDF values rather than a generator of Event objects.
-rw-r--r--chroma/sim.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/chroma/sim.py b/chroma/sim.py
index a8b0c90..1ffa7f3 100644
--- a/chroma/sim.py
+++ b/chroma/sim.py
@@ -145,6 +145,8 @@ class Simulation(object):
if isinstance(first_element, event.Event):
iterable = self.photon_generator.generate_events(iterable)
+ elif isinstance(first_element, event.Photons):
+ iterable = (event.Event(photons_beg=x) for x in iterable)
for ev in iterable:
gpu_photons_no_scatter = gpu.GPUPhotons(ev.photons_beg, ncopies=nreps)