Project

General

Profile

Support #916

draw Particle By ID

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
Simulation
Target version:
-
Start date:
21 February 2012
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

Hi Chris,

I'm trying to implement the drawing particle colours by what type of particle they are. I can't quite remember how we did it before and was wondering if you remember? I've looked around and found this code which registers a new model for the visualisation.

  G4TrajectoryDrawByParticleID* model = new G4TrajectoryDrawByParticleID;
  model->SetDefault("cyan");
  model->Set("gamma", "green");
  model->Set("e+", "magenta");
  model->Set("e-", G4Colour(0.3, 0.3, 0.3));
  visManager->RegisterModel(model);

I'm sure this belongs in MAUSVisManager.cc but can't seem to get it to compile? Perhaps I have put it in the wrong place? My MAUSVisManager.cc is attached.


Files

MAUSVisManager.cc (4.81 KB) MAUSVisManager.cc Littlefield, Matthew, 21 February 2012 13:59
#1

Updated by Littlefield, Matthew almost 12 years ago

  • Category set to Simulation
#2

Updated by Rogers, Chris almost 12 years ago

Using the code you attached. Need

#include <G4TrajectoryDrawByParticleID.hh>

and also

  G4TrajectoryDrawByParticleID* model = new G4TrajectoryDrawByParticleID;
  model->SetDefault("cyan");
  model->Set("gamma", "green");
  model->Set("e+", "magenta");
  model->Set("e-", G4Colour(0.3, 0.3, 0.3));
  RegisterModel(model); // NOTE THE CHANGE HERE

visManager is not a separate object.

I checked this compiles, I didn't try running it.

#3

Updated by Rogers, Chris almost 12 years ago

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

Also available in: Atom PDF