Bug #978
Simulation - Coloured Particles and Accumulated Tracks
100%
Description
I'm making this issue to see if anyone has any ideas on the problem. Also to keep track of my bug hunting because this doesn't seem like a very nice bug.
OK, I have added the code to MAUSVisManager.cc, in my branch, which accumulates the tracks into one output and also changes the colours of the particles to our specifications. This causes one of the tests to fail. The test is test_MapCppSimulation.py this produces the error,
====================================================================== FAIL: test_visualisation (__main__.MapCppSimulationTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "test_MapCppSimulation.py", line 127, in test_visualisation self.assertEqual(ps.returncode, 0, msg='Failed to run visualisation') AssertionError: Failed to run visualisation ---------------------------------------------------------------------- Ran 6 tests in 2.304s FAILED (failures=1)
the method which is failing is comparing the return code of the simulation with 0 and raising an error if this isn't true. So, the bug is in run_visualisation_for_tests.py. When this is run it produces,
*** G4Exception : KeyExists issued by : G4VisListManager<T>::Register(T* ptr) Key Unspecified already registered *** Fatal Error In Argument *** core dump *** *** G4Exception: Aborting execution *** Aborted
This is produced by a method in G4VisListManager.hh. It has something to do with a ptr that is pointing to something that is unspecified.
I shall keep hunting but if anyone sees this and has a idea or knows what is the problem please post something.
Updated by Littlefield, Matthew over 11 years ago
Actually I don't think this is the problem the two tests in run_visualisation_for_tests.py run on their own but not when the two are together. Perhaps the files being produced are the problem and need to be cleaned up between tests?
Updated by Littlefield, Matthew over 11 years ago
I don't know what the Geant4 bug is and I have been searching for a couple of days now with no results. However I have solved the problem I think. I have split the two methods in run_visualisation_for_tests.py into two files. One is run_visualisation_for_tests.py and the other is run_visualisation_vrml2file_no_event.py and I have added a another method to test_MapCppSimulation.py which calls the second file and checks the same things as the method like,
def test_visualisation_vrml2file_no_event(self): test = os.path.join(os.environ['MAUS_ROOT_DIR'], 'src', 'map',\ 'MapCppSimulation', 'run_visualisation_vrml2file_no_event.py') ps = subprocess.Popen(['python', test]) ps.wait() self.assertEqual(ps.returncode, 0, msg='Failed to run visualisation')
These tests still check the same thing as their functionality hasn't changed and now the tests all pass. :-)
If your happy with this Chris R then Ill close it. It also means that the code is there to change the colour of particles and accumulate tracks as well. I shall write some tests for these.
Updated by Littlefield, Matthew over 11 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Tests committed to maus/merge
Updated by Rogers, Chris over 11 years ago
- Target version changed from Future MAUS release to MAUS-v0.2.4