summaryrefslogtreecommitdiff
path: root/tests/test_pdf.py
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-09-13 16:10:04 -0400
committerStan Seibert <stan@mtrr.org>2011-09-13 16:10:04 -0400
commit4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75 (patch)
tree90a910177777115b6ef7ad2780b09ca69ff87109 /tests/test_pdf.py
parent1ed35a8420b73afa76c12c82f4aebc31132650d9 (diff)
parent6f0703602270d03f4025221f13fee21aa842a863 (diff)
downloadchroma-4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75.tar.gz
chroma-4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75.tar.bz2
chroma-4ab542a6f7e8dfbe6aeec2eb1b71176e2e851e75.zip
merge
Diffstat (limited to 'tests/test_pdf.py')
-rw-r--r--tests/test_pdf.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_pdf.py b/tests/test_pdf.py
index c7c9394..571cbd4 100644
--- a/tests/test_pdf.py
+++ b/tests/test_pdf.py
@@ -11,7 +11,7 @@ from chroma.sim import Simulation
class TestPDF(unittest.TestCase):
def setUp(self):
- self.detector = chroma.detectors.find("microlbne")
+ self.detector = chroma.detectors.microlbne()
self.detector.build()
self.vertex_gen = constant_particle_gun('e-', (0,0,0), (1,0,0), 10)
@@ -19,7 +19,9 @@ class TestPDF(unittest.TestCase):
'''Create a hit count and (q,t) PDF for 10 MeV events in MicroLBNE'''
g4generator = G4ParallelGenerator(1, water_wcsim)
- gpu_instance = gpu.GPU(0)
+
+ context = gpu.create_cuda_context()
+
gpu_geometry = gpu.GPUGeometry(self.detector)
nthreads_per_block, max_blocks = 64, 1024
@@ -48,6 +50,8 @@ class TestPDF(unittest.TestCase):
for i, nhits in enumerate(hitcount):
self.assertEqual(nhits, pdf[i].sum())
+ context.pop()
+
def testSimPDF(self):
sim = Simulation(self.detector)