Application main program.
142{
143
144
145
146#ifdef G4MULTITHREADED
147 ROOT::EnableThreadSafety();
148#endif
149
150
151
152
153#ifdef USE_GEANT4
154 std::string g4Geometry = "geomRootToGeant4";
155 std::string g4PhysicsList = "emStandard+optical";
156 std::string g4SpecialPhysics = "stepLimiter";
157 std::string g4Macro = "g4config.in";
158 std::string g4Macro2 = "g4config2.in";
159 std::string g4VisMacro = "g4vis.in";
160 std::string g4Session = "";
161#endif
162#ifdef USE_GEANT3
163 std::string g3Geometry = "TGeant3TGeo";
164#endif
167
168 for (Int_t i = 1; i < argc; i = i + 2) {
169 std::cout << "processing " << argv[i] << " with " << argv[i + 1]
170 << std::endl;
171#ifdef USE_GEANT4
172 if (std::string(argv[i]) == "--g4-geometry" ||
173 std::string(argv[i]) == "-g4g")
174 g4Geometry = argv[i + 1];
175 else if (std::string(argv[i]) == "--g4-physics-list" ||
176 std::string(argv[i]) == "-g4pl")
177 g4PhysicsList = argv[i + 1];
178 else if (std::string(argv[i]) == "--g4-special-physics" ||
179 std::string(argv[i]) == "-g4sp")
180 g4SpecialPhysics = argv[i + 1];
181 else if (std::string(argv[i]) == "--g4-macro" ||
182 std::string(argv[i]) == "-g4m")
183 g4Macro = argv[i + 1];
184 else if (std::string(argv[i]) == "--g4-macro2" ||
185 std::string(argv[i]) == "-g4m2")
186 g4Macro2 = argv[i + 1];
187 else if (std::string(argv[i]) == "--g4-vis-macro" ||
188 std::string(argv[i]) == "-g4vm")
189 g4VisMacro = argv[i + 1];
190 else if (std::string(argv[i]) == "--g4-session" ||
191 std::string(argv[i]) == "-g4s")
192 g4Session = argv[i + 1];
193#endif
194#ifdef USE_GEANT3
195 if (std::string(argv[i]) == "--g3-geometry" ||
196 std::string(argv[i]) == "-g3g")
197 g3Geometry = argv[i + 1];
198#endif
199 else if (std::string(argv[i]) == "--root-macro" ||
200 std::string(argv[i]) == "-rm")
202 else if (std::string(argv[i]) == "--verbose" ||
203 std::string(argv[i]) == "-v")
205 else {
206 PrintUsage("testE06");
207 return 1;
208 }
209 }
210
212#ifdef USE_GEANT4
213 PrintG4Configuration("testE06", g4Geometry, g4PhysicsList, g4SpecialPhysics,
214 g4Macro, g4Macro2, g4VisMacro, g4Session,
rootMacro);
215#endif
216#ifdef USE_GEANT3
217 PrintG3Configuration(
"testE06", g3Geometry,
rootMacro);
218#endif
219 }
220
221
222
223
227
228
229#ifdef USE_GEANT4
230 if (g4Geometry.find("VMC") != std::string::npos) {
232 }
233#endif
234#ifdef USE_GEANT3
235 if (g3Geometry == "TGeant3") {
237 }
238#endif
239
240#ifdef USE_GEANT4
241
244
245
246
247 TGeant4* geant4 = new TGeant4(
248 "TGeant4", "The Geant4 Monte Carlo", runConfiguration, argc, argv);
249
250
251
252 if (g4Macro.size()) {
253 geant4->ProcessGeantMacro(g4Macro.data());
254 }
255#endif
256
257#ifdef USE_GEANT3
258 TGeant3* geant3 = 0;
259 if (g3Geometry == "TGeant3") {
260 geant3 = new TGeant3("C++ Interface to Geant3");
261 }
262 else if (g3Geometry == "TGeant3TGeo") {
263 geant3 = new TGeant3TGeo("C++ Interface to Geant3");
264 }
265 else {
266 PrintUsage("testE06");
267 return 1;
268 }
269 gMC->SetProcess("CKOV", 1);
270 gMC->SetCut("CUTELE", 10e-06);
271 gMC->SetCut("CUTGAM", 10e-06);
272 geant3->SetSWIT(4, 1000);
273
274#endif
275
276
278
280
281
282
283
284#ifdef USE_GEANT4
285
286
287 if (g4Macro.size()) {
288 geant4->ProcessGeantMacro(g4Macro2.data());
289 }
290
291 if (g4VisMacro.size()) {
292 geant4->ProcessGeantMacro(g4VisMacro.data());
293 }
294#endif
295
296
298 }
299 else {
300
302 }
303
304 delete appl;
305}
Implementation of the TVirtualMCApplication.
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
Ex06PrimaryGenerator * GetPrimaryGenerator() const
void SetNofPrimaries(Int_t nofPrimaries)