Application main program.
132{
133
134
135
136#ifdef G4MULTITHREADED
137 ROOT::EnableThreadSafety();
138#endif
139
140
141
142
143#ifdef USE_GEANT4
144 std::string g4Geometry = "geomRootToGeant4";
145 std::string g4PhysicsList = "FTFP_BERT";
146 std::string g4SpecialPhysics = "stepLimiter";
147 std::string g4Macro = "g4config.in";
148 std::string g4VisMacro = "g4vis.in";
149 std::string g4Session = "";
150#endif
151#ifdef USE_GEANT3
152 std::string g3Geometry = "TGeant3TGeo";
153#endif
156
157 for (Int_t i = 1; i < argc; i = i + 2) {
158 std::cout << "processing " << argv[i] << " with " << argv[i + 1]
159 << std::endl;
160#ifdef USE_GEANT4
161 if (std::string(argv[i]) == "--g4-geometry" ||
162 std::string(argv[i]) == "-g4g")
163 g4Geometry = argv[i + 1];
164 else if (std::string(argv[i]) == "--g4-physics-list" ||
165 std::string(argv[i]) == "-g4pl")
166 g4PhysicsList = argv[i + 1];
167 else if (std::string(argv[i]) == "--g4-special-physics" ||
168 std::string(argv[i]) == "-g4sp")
169 g4SpecialPhysics = argv[i + 1];
170 else if (std::string(argv[i]) == "--g4-macro" ||
171 std::string(argv[i]) == "-g4m")
172 g4Macro = argv[i + 1];
173 else if (std::string(argv[i]) == "--g4-vis-macro" ||
174 std::string(argv[i]) == "-g4vm")
175 g4VisMacro = argv[i + 1];
176 else if (std::string(argv[i]) == "--g4-session" ||
177 std::string(argv[i]) == "-g4s")
178 g4Session = argv[i + 1];
179#endif
180#ifdef USE_GEANT3
181 if (std::string(argv[i]) == "--g3-geometry" ||
182 std::string(argv[i]) == "-g3g")
183 g3Geometry = argv[i + 1];
184#endif
185 else if (std::string(argv[i]) == "--root-macro" ||
186 std::string(argv[i]) == "-rm")
188 else if (std::string(argv[i]) == "--verbose" ||
189 std::string(argv[i]) == "-v")
191 else {
192 PrintUsage("testE02");
193 return 1;
194 }
195 }
196
198#ifdef USE_GEANT4
199 PrintG4Configuration("testE02", g4Geometry, g4PhysicsList, g4SpecialPhysics,
200 g4Macro, g4VisMacro, g4Session,
rootMacro);
201#endif
202#ifdef USE_GEANT3
203 PrintG3Configuration(
"testE02", g3Geometry,
rootMacro);
204#endif
205 }
206
207
208
209
212
213#ifdef USE_GEANT4
214 if (g4Geometry.find("VMC") != std::string::npos) {
216 }
217#endif
218#ifdef USE_GEANT3
219 if (g3Geometry == "TGeant3") {
221 }
222#endif
223
224#ifdef USE_GEANT4
225
228
229
230
231 TGeant4* geant4 = new TGeant4(
232 "TGeant4", "The Geant4 Monte Carlo", runConfiguration, argc, argv);
233
234
235
236 if (g4Macro.size()) {
237 geant4->ProcessGeantMacro(g4Macro.data());
238 }
239#endif
240
241#ifdef USE_GEANT3
242 TGeant3* geant3 = 0;
243 if (g3Geometry == "TGeant3") {
244 geant3 = new TGeant3("C++ Interface to Geant3");
245 }
246 else if (g3Geometry == "TGeant3TGeo") {
247 geant3 = new TGeant3TGeo("C++ Interface to Geant3");
248 }
249 else {
250 PrintUsage("exampleE01");
251 return 1;
252 }
253 geant3->SetHADR(0);
254#endif
255
256
258
260#ifdef USE_GEANT4
261
262 if (g4VisMacro.size()) {
263 geant4->ProcessGeantMacro(g4VisMacro.data());
264 }
265#endif
267 }
268 else {
269
271 }
272
273 delete appl;
274}
Implementation of the TVirtualMCApplication.
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)