Bug #915
Some configuration options fail for geant visualisation
100%
Description
Rogers screwed up a merge and accidentally left in some configuration options that don't actually work for GEANT4 visualisation. The following cards are currently broken and don't work...
accumulate_tracks = 1 # this accumulates the tracks into one vrml file 1 = yes, 0 = no #particle colour alterations default_vis_colour = {"red":0. , "green":100. ,"blue":0.} #green pi_plus_vis_colour = {"red":255. , "green":250. ,"blue":240.} # white pi_minus_vis_colour = {"red":105. , "green":105. ,"blue":105.} # grey mu_plus_vis_colour = {"red":25. , "green":25. ,"blue":112.} # dark blue mu_minus_vis_colour = {"red":135. , "green":206. ,"blue":250.} # light blue e_plus_vis_colour = {"red":250. , "green":0. ,"blue":0.} # red e_minus_vis_colour = {"red":250. , "green":69. ,"blue":0.} # orange red gamma_vis_colour = {"red":255. , "green":20. ,"blue":147.} # pink neutron_vis_colour = {"red":139. , "green":69. ,"blue":19.} # brown photon_vis_colour = {"red":255. , "green":255. ,"blue":0.} # yellow
Files
Updated by Rogers, Chris almost 12 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Comemnt deleted (meant to be in 916)
Updated by Rogers, Chris almost 12 years ago
- Status changed from Closed to Open
- Assignee changed from Rogers, Chris to Littlefield, Matthew
- % Done changed from 100 to 0
Updated by Rogers, Chris almost 12 years ago
But I moved it to Matt as he seems to be working on it (thanks Matt)
Updated by Littlefield, Matthew almost 12 years ago
- Assignee changed from Littlefield, Matthew to Rogers, Chris
this now works except I can't figure out how to get the colours from the ConfigurationDefaults. I think its best to store the RGB values in a threeVector like
G4ThreeVector default_vis_colour = JsonWrapper::GetProperty (conf, "default_vis_colour", JsonWrapper::intValue).asInt();
this is being taken from the dicts in the Config
default_vis_colour = {"red":0. , "green":100. ,"blue":0.} #green
but the json wrapper doesn't have threeVector types? Whats the best way to do this? Cheers
NB: I've assigned it to you Chris just to ask the question (in case you don't see it).
You can assign it back to me after :-) many thanks
Updated by Rogers, Chris almost 12 years ago
Yeah you have to do something like:
G4ThreeVector GetColour(std::string colour_name) { Json::Value json_rgb = JsonWrapper::GetProperty(conf, colour_name, JsonWrapper::objectValue); G4ThreeVector rgb; rgb[0] = JsonWrapper::GetProperty(json_rgb, "red", JsonWrapper::realValue).asDouble(); rgb[1] = JsonWrapper::GetProperty(json_rgb, "green", JsonWrapper::realValue).asDouble(); rgb[2] = JsonWrapper::GetProperty(json_rgb, "blue", JsonWrapper::realValue).asDouble(); return rgb; }
and call like:
G4ThreeVector rgb = GetColour("default_vis_colour");
Updated by Littlefield, Matthew almost 12 years ago
- File ColouredPartciles.png ColouredPartciles.png added
This is finished now and I believe it works and Ive pushed it to my branch. The MAUSVisManager.cc and .hh files may need to be quickly checked because I made a new function GetColour (like above) and when I added the function to the private members of the class it complained so I took it out because I have declared the function before its use in the cc file. My c++ skills aren't as good as python so not sure if I declared the function in the header correctly.
Also, I think Ill have to check, somehow, that the right particles are coloured correctly because I cant see all the colours by eye in the visualisation.
Updated by Littlefield, Matthew almost 12 years ago
This all works ok except it fails one of the tests. it fails on test_MapCppSimulation.py and I then traced this to run_visualisation_for_tests.py where it complains that there isn't an accumulate_tracks and particle colours tags in the configuration. When I add these and run the files the run_visualisation_for_tests.py aborts without any traceback!? EEK! I have also fixed a cpplint error and pushed this to my branch without the added config stuff to run_visualisation_for_tests.py. Revision 676 :-)
Updated by Rogers, Chris over 11 years ago
- Assignee changed from Rogers, Chris to Littlefield, Matthew
- Workflow changed from New Issue to In Documentation
Is this now fixed? Can you edit the documentation in doc/doc_src/simulation.tex and then we can close the issue...
Updated by Rogers, Chris over 11 years ago
Yes please (ps: edit the tables in visualisation section)
Updated by Rogers, Chris over 11 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Updated by Rogers, Chris over 11 years ago
- Target version changed from Future MAUS release to MAUS-v0.2.5