147#ifdef G4MULTITHREADED
148 ROOT::EnableThreadSafety();
155 std::string g4Geometry =
"geomRootToGeant4";
156 std::string g4PhysicsList =
"FTFP_BERT";
157 std::string g4SpecialPhysics =
"stepLimiter";
158 std::string g4Macro =
"g4config.in";
159 std::string g4VisMacro =
"g4vis.in";
160 std::string g4Session =
"";
161 std::string g4UserClass =
"";
164 std::string g3Geometry =
"TGeant3TGeo";
169 for (Int_t i = 1; i < argc; i = i + 2) {
170 std::cout <<
"processing " << argv[i] <<
" with " << argv[i + 1]
173 if (std::string(argv[i]) ==
"--g4-geometry" ||
174 std::string(argv[i]) ==
"-g4g")
175 g4Geometry = argv[i + 1];
176 else if (std::string(argv[i]) ==
"--g4-physics-list" ||
177 std::string(argv[i]) ==
"-g4pl")
178 g4PhysicsList = argv[i + 1];
179 else if (std::string(argv[i]) ==
"--g4-special-physics" ||
180 std::string(argv[i]) ==
"-g4sp")
181 g4SpecialPhysics = argv[i + 1];
182 else if (std::string(argv[i]) ==
"--g4-macro" ||
183 std::string(argv[i]) ==
"-g4m")
184 g4Macro = argv[i + 1];
185 else if (std::string(argv[i]) ==
"--g4-vis-macro" ||
186 std::string(argv[i]) ==
"-g4vm")
187 g4VisMacro = argv[i + 1];
188 else if (std::string(argv[i]) ==
"--g4-session" ||
189 std::string(argv[i]) ==
"-g4s")
190 g4Session = argv[i + 1];
192 else if (std::string(argv[i]) ==
"--g4-user-class" ||
193 std::string(argv[i]) ==
"-g4uc")
194 g4UserClass = argv[i + 1];
197 if (std::string(argv[i]) ==
"--g3-geometry" ||
198 std::string(argv[i]) ==
"-g3g")
199 g3Geometry = argv[i + 1];
201 else if (std::string(argv[i]) ==
"--root-macro" ||
202 std::string(argv[i]) ==
"-rm")
204 else if (std::string(argv[i]) ==
"--verbose" ||
205 std::string(argv[i]) ==
"-v")
208 PrintUsage(
"testE03");
215 PrintG4Configuration(
"testE03", g4Geometry, g4PhysicsList, g4SpecialPhysics,
216 g4Macro, g4VisMacro, g4Session, g4UserClass,
rootMacro);
219 PrintG3Configuration(
"testE03", g3Geometry,
rootMacro);
230 if (g4Geometry.find(
"VMC") != std::string::npos) {
235 if (g3Geometry ==
"TGeant3") {
243 if (!g4UserClass.size()) {
247 else if (g4UserClass ==
"geometry") {
251 else if (g4UserClass ==
"physics-list") {
254 else if (g4UserClass ==
"regions") {
258 else if (g4UserClass ==
"field") {
263 PrintUsage(
"testE03");
268 TGeant4* geant4 =
new TGeant4(
269 "TGeant4",
"The Geant4 Monte Carlo", runConfiguration, argc, argv);
273 if (g4Macro.size()) {
274 geant4->ProcessGeantMacro(g4Macro.data());
279 if (g3Geometry ==
"TGeant3") {
280 new TGeant3(
"C++ Interface to Geant3");
282 else if (g3Geometry ==
"TGeant3TGeo") {
283 new TGeant3TGeo(
"C++ Interface to Geant3");
286 PrintUsage(
"testE03");
289 gMC->SetProcess(
"DRAY", 1);
290 gMC->SetProcess(
"LOSS", 1);
291 gMC->SetProcess(
"HADR", 0);
299 if (g4VisMacro.size()) {
300 geant4->ProcessGeantMacro(g4VisMacro.data());