diff options
author | Stan Seibert <stan@mtrr.org> | 2011-08-20 16:49:33 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-08-20 16:49:33 -0400 |
commit | e87676dd3c3a8982349937e88af7465ec6a9f982 (patch) | |
tree | bbe1bd536b87b8f757506220f914c3023dd2ed6e /tests | |
parent | 124c7ce98de956e4c1817627f1fd0e2faf281bc6 (diff) | |
download | chroma-e87676dd3c3a8982349937e88af7465ec6a9f982.tar.gz chroma-e87676dd3c3a8982349937e88af7465ec6a9f982.tar.bz2 chroma-e87676dd3c3a8982349937e88af7465ec6a9f982.zip |
A failing test demonstrating the faiure of G4ParallelGenerator to produce photons when the parent particle is at (1,0,0)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_generator_photon.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_generator_photon.py b/tests/test_generator_photon.py new file mode 100644 index 0000000..9684126 --- /dev/null +++ b/tests/test_generator_photon.py @@ -0,0 +1,20 @@ +import unittest + +import chroma.generator.photon +from chroma.generator.vertex import constant_particle_gun +from chroma.optics import water_wcsim + +class TestG4ParallelGenerator(unittest.TestCase): + def test_center(self): + '''Generate Cherenkov light at the center of the world volume''' + gen = chroma.generator.photon.G4ParallelGenerator(1, water_wcsim) + vertex = constant_particle_gun('e-', (0,0,0), (1,0,0), 100) + for event in gen.generate_events(10, vertex): + self.assertGreater(len(event.photon_start.positions), 0) + + def test_off_center(self): + '''Generate Cherenkov light at (1 m, 0 m, 0 m)''' + gen = chroma.generator.photon.G4ParallelGenerator(1, water_wcsim) + vertex = constant_particle_gun('e-', (1,0,0), (1,0,0), 100) + for event in gen.generate_events(10, vertex): + self.assertGreater(len(event.photon_start.positions), 0) |