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 = "emStandard";
146 std::string g4SpecialPhysics = "stepLimiter";
147 std::string g4Macro = "";
148 std::string g4VisMacro = "";
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("testE01");
193 return 1;
194 }
195 }
196
198#ifdef USE_GEANT4
199 PrintG4Configuration("testE01", g4Geometry, g4PhysicsList, g4SpecialPhysics,
200 g4Macro, g4VisMacro, g4Session,
rootMacro);
201#endif
202#ifdef USE_GEANT3
203 PrintG3Configuration(
"testE01", 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
240 geant4->ProcessGeantCommand("/mcVerbose/all 1");
241#endif
242
243#ifdef USE_GEANT3
244 TGeant3* geant3 = 0;
245 if (g3Geometry == "TGeant3") {
246 geant3 = new TGeant3("C++ Interface to Geant3");
247 }
248 else if (g3Geometry == "TGeant3TGeo") {
249 geant3 = new TGeant3TGeo("C++ Interface to Geant3");
250 }
251 else {
252 PrintUsage("testE01");
253 return 1;
254 }
255 geant3->SetHADR(0);
256#endif
257
258
260
263 }
264 else {
265
267 }
268
269 delete appl;
270}
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)
void RunMC(Int_t nofEvents)
void SetOldGeometry(Bool_t oldGeometry=kTRUE)