Project

General

Profile

Bug #915

Some configuration options fail for geant visualisation

Added by Rogers, Chris almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Littlefield, Matthew
Category:
common_py
Target version:
Start date:
20 February 2012
Due date:
% Done:

100%

Estimated time:
Workflow:
In Documentation

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

ColouredPartciles.png (61.6 KB) ColouredPartciles.png Littlefield, Matthew, 22 February 2012 12:05
#1

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)

#2

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
#3

Updated by Rogers, Chris almost 12 years ago

But I moved it to Matt as he seems to be working on it (thanks Matt)

#4

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

#5

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");
#6

Updated by Littlefield, Matthew almost 12 years ago

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.

#7

Updated by Rogers, Chris almost 12 years ago

What revision number?

#8

Updated by Littlefield, Matthew almost 12 years ago

revision 675

#9

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 :-)

#10

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...

#11

Updated by Littlefield, Matthew over 11 years ago

and push the edited doc text to maus/merge?

#12

Updated by Rogers, Chris over 11 years ago

Yes please (ps: edit the tables in visualisation section)

#13

Updated by Littlefield, Matthew over 11 years ago

this is finished now and in maus/merge

#14

Updated by Rogers, Chris over 11 years ago

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

Updated by Rogers, Chris over 11 years ago

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

Also available in: Atom PDF