9 #include "G4RunManager.hh" 10 #include "G4VisExecutive.hh" 11 #include "G4TrajectoryDrawByParticleID.hh" 23 vector<string> commands;
26 double PHI_VERB = gemcOpt.
args[
"PHY_VERBOSITY"].arg ;
27 int OVERL = (int) gemcOpt.
args[
"CHECK_OVERLAPS"].arg ;
28 int DAWN_N = (
int) gemcOpt.
args[
"DAWN_N"].arg ;
29 int SAVE_ALL_MOTHERS = (int) gemcOpt.
args[
"SAVE_ALL_MOTHERS"].arg ;
32 sprintf(phi_verb,
"%d", (
int) PHI_VERB);
33 string proc_verb1 =
"/process/setVerbose ";
34 string proc_verb2 =
"/process/verbose ";
35 proc_verb1.append(phi_verb);
36 proc_verb1.append(
" all");
37 proc_verb2.append(phi_verb);
41 double TRACK_VERB = gemcOpt.
args[
"G4TRACK_VERBOSITY"].arg ;
43 sprintf(track_verb,
"%d", (
int) TRACK_VERB);
44 string tra_verb =
"/tracking/verbose ";
45 tra_verb.append(track_verb);
46 commands.push_back(tra_verb);
50 commands.push_back(
"/tracking/storeTrajectory 2");
52 commands.push_back(
"/tracking/storeTrajectory 0");
56 commands.push_back(
"/control/verbose 0");
57 commands.push_back(
"/geometry/navigator/verbose 0");
58 commands.push_back(
"/event/verbose 0");
59 commands.push_back(
"/run/verbose 0");
60 commands.push_back(
"/run/particle/verbose 0");
61 commands.push_back(
"/material/verbose 0");
62 commands.push_back(proc_verb1.c_str());
63 commands.push_back(proc_verb2.c_str());
64 commands.push_back(
"/process/eLoss/verbose 0");
65 commands.push_back(
"/vis/verbose 0");
66 commands.push_back(
"/vis/viewer/flush");
67 commands.push_back(
"/process/setVerbose 0");
73 commands.push_back(
"/geometry/test/grid_test 1");
76 commands.push_back(
"/geometry/test/cylinder_test 1");
82 sprintf(dawn,
"%d", DAWN_N);
83 string DN =
"/run/beamOn ";
86 commands.push_back(
"/vis/open DAWNFILE");
87 commands.push_back(
"/vis/drawVolume");
88 commands.push_back(
"/vis/scene/add/trajectories rich smooth");
89 commands.push_back(
"/vis/scene/add/hits");
90 commands.push_back(
"/vis/scene/endOfEventAction accumulate -1");
91 commands.push_back(DN);
104 vector<string> commands;
105 commands.push_back(
"/vis/scene/create Hall-B");
106 double use_qt = gemcOpt.
args[
"USE_QT"].arg;
107 int HIGH_RES = (int) gemcOpt.
args[
"HIGH_RES"].arg ;
111 commands.push_back(
"/vis/open OGLI " + gemcOpt.
args[
"geometry"].args);
114 commands.push_back(
"/vis/open OGLS " + gemcOpt.
args[
"geometry"].args);
117 commands.push_back(
"/vis/viewer/set/autoRefresh 1");
124 commands.push_back(
"/vis/scene/add/trajectories rich smooth");
125 commands.push_back(
"/vis/viewer/set/background .8 .9 .98 1");
126 commands.push_back(
"/vis/scene/add/hits");
128 commands.push_back(
"/vis/scene/endOfEventAction accumulate -1");
132 commands.push_back(
"/vis/scene/add/trajectories");
133 commands.push_back(
"/vis/scene/add/hits");
134 commands.push_back(
"/vis/scene/endOfEventAction accumulate -1");
148 G4TrajectoryDrawByParticleID* gemcColorIDModel =
new G4TrajectoryDrawByParticleID(
"gemcColorIDModel");
149 gemcColorIDModel->SetDefault(
"gray");
150 gemcColorIDModel->Set(
"neutron",
"black");
151 gemcColorIDModel->Set(
"gamma",
"blue");
152 gemcColorIDModel->Set(
"e-",
"cyan");
153 gemcColorIDModel->Set(
"pi+",
"magenta");
154 gemcColorIDModel->Set(
"pi-",
"yellow");
155 gemcColorIDModel->Set(
"proton", G4Colour(0.95, 0.6, 0.3));
157 G4ParticleTable *particleTable = G4ParticleTable::GetParticleTable();
158 for(
int i=0; i<particleTable->entries(); i++)
160 string pname = particleTable->GetParticleName(i);
161 double charge = particleTable->FindParticle(pname)->GetPDGCharge();
163 if(pname !=
"neutron" &&
171 gemcColorIDModel->Set(pname,
"red");
173 gemcColorIDModel->Set(pname,
"white");
175 gemcColorIDModel->Set(pname,
"green");
179 VM->RegisterModel(gemcColorIDModel);
180 VM->SelectTrajectoryModel(gemcColorIDModel->Name());
vector< string > init_dmesg(gemc_opts gemcOpt)
General Initialization Routine.
vector< string > init_dvmesg(gemc_opts gemcOpt, G4VisManager *VM)
Initialization Routine for Visualization.
map< string, opts > args
Options map.