Bug #978

Simulation - Coloured Particles and Accumulated Tracks

Added by Littlefield, Matthew about 12 years ago. Updated almost 12 years ago.

Littlefield, Matthew
Target version:
Start date:
19 April 2012
Due date:
% Done:


Estimated time:
New Issue


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, 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 this produces the error,

FAIL: test_visualisation (__main__.MapCppSimulationTestCase)
Traceback (most recent call last):
  File "", 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 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 ***

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 about 12 years ago

Actually I don't think this is the problem the two tests in 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 about 12 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 into two files. One is and the other is and I have added a another method to 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', '')
        ps = subprocess.Popen(['python', test])
        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 about 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Tests committed to maus/merge


Updated by Rogers, Chris almost 12 years ago

  • Target version changed from Future MAUS release to MAUS-v0.2.4

Also available in: Atom PDF