3
3
#include " G4UImanager.hh"
4
4
#include " G4UIterminal.hh"
5
5
#include " G4UItcsh.hh"
6
+ #include " G4UIGAG.hh"
7
+ #include " G4VisExecutive.hh"
8
+ #include " G4TrajectoryDrawByParticleID.hh"
6
9
#include " WCSimDetectorConstruction.hh"
7
10
#include " WCSimPhysicsList.hh"
8
11
#include " WCSimPhysicsMessenger.hh"
@@ -54,17 +57,40 @@ int main(int argc,char** argv)
54
57
UI->ApplyCommand (" /control/execute jobOptions.mac" );
55
58
56
59
// Visualization
57
- G4VisManager* visManager = new WCSimVisManager;
60
+ // G4VisManager* visManager = new WCSimVisManager;
61
+ G4VisManager* visManager = new G4VisExecutive;
58
62
visManager->Initialize ();
59
63
64
+ // create new drawByParticleID model
65
+ G4TrajectoryDrawByParticleID* mymodel = new G4TrajectoryDrawByParticleID;
66
+
67
+ // Configure model
68
+ mymodel->SetDefault (" cyan" );
69
+ mymodel->Set (" gamma" ," green" );
70
+ mymodel->Set (" nu_e" ," yellow" );
71
+ mymodel->Set (" nu_mu" ," yellow" );
72
+ mymodel->Set (" anti_nu_e" ," yellow" );
73
+ mymodel->Set (" anti_nu_mu" ," yellow" );
74
+ mymodel->Set (" e-" ," blue" );
75
+ mymodel->Set (" mu-" ," black" );
76
+ mymodel->Set (" e+" ," red" );
77
+ mymodel->Set (" mu+" ," white" );
78
+ mymodel->Set (" proton" ," magenta" );
79
+ mymodel->Set (" neutron" ," Grey" );
80
+
81
+
82
+
83
+
84
+ visManager->RegisterModel (mymodel);
60
85
61
86
// Set user action classes
62
87
WCSimPrimaryGeneratorAction* myGeneratorAction = new
63
88
WCSimPrimaryGeneratorAction (WCSimdetector);
64
-
65
89
runManager->SetUserAction (myGeneratorAction);
66
90
67
- WCSimRunAction* myRunAction = new WCSimRunAction;
91
+
92
+
93
+ WCSimRunAction* myRunAction = new WCSimRunAction (WCSimdetector);
68
94
runManager->SetUserAction (myRunAction);
69
95
70
96
runManager->SetUserAction (new WCSimEventAction (myRunAction, WCSimdetector,
@@ -87,20 +113,33 @@ int main(int argc,char** argv)
87
113
// Visualization Macro
88
114
UI->ApplyCommand (" /control/execute vis.mac" );
89
115
116
+
117
+
90
118
// Start Interactive Mode
91
119
session->SessionStart ();
92
120
93
121
delete session;
94
122
}
95
123
else // Batch mode
96
124
{
125
+
126
+ // Start UI Session
127
+ // G4UIsession* session = new G4UIterminal(new G4UItcsh);
128
+ // G4UIsession* session = new G4UIGAG();
129
+
97
130
G4String command = " /control/execute " ;
98
131
G4String fileName = argv[1 ];
99
132
100
133
// Visualization Macro
101
134
// UI->ApplyCommand("/control/execute vis.mac");//K.Z.: dangerous position for such command, has to
102
135
// removed.
103
136
UI->ApplyCommand (command+fileName);
137
+
138
+ // Start Interactive Mode
139
+ // session->SessionStart();
140
+
141
+
142
+ // delete session;
104
143
}
105
144
106
145
delete visManager;
0 commit comments