Application main program.
116{
117
118
119
120#ifdef G4MULTITHREADED
121 ROOT::EnableThreadSafety();
122#endif
123
124
125
126
127#ifdef USE_GEANT4
128 std::string g4Geometry = "geomRootToGeant4";
129 std::string g4PhysicsList = "FTFP_BERT+monopole";
130 std::string g4SpecialPhysics = "stepLimiter";
131 std::string g4Macro = "g4config.in";
132 std::string g4Macro2 = "g4config2.in";
133
134 std::string g4VisMacro = "";
135 std::string g4Session = "";
136#endif
139
140 for (Int_t i = 1; i < argc; i = i + 2) {
141 std::cout << "processing " << argv[i] << " with " << argv[i + 1]
142 << std::endl;
143#ifdef USE_GEANT4
144 if (std::string(argv[i]) == "--g4-geometry" ||
145 std::string(argv[i]) == "-g4g")
146 g4Geometry = argv[i + 1];
147 else if (std::string(argv[i]) == "--g4-physics-list" ||
148 std::string(argv[i]) == "-g4pl")
149 g4PhysicsList = argv[i + 1];
150 else if (std::string(argv[i]) == "--g4-special-physics" ||
151 std::string(argv[i]) == "-g4sp")
152 g4SpecialPhysics = argv[i + 1];
153 else if (std::string(argv[i]) == "--g4-macro" ||
154 std::string(argv[i]) == "-g4m")
155 g4Macro = argv[i + 1];
156 else if (std::string(argv[i]) == "--g4-vis-macro" ||
157 std::string(argv[i]) == "-g4vm")
158 g4VisMacro = argv[i + 1];
159 else if (std::string(argv[i]) == "--g4-session" ||
160 std::string(argv[i]) == "-g4s")
161 g4Session = argv[i + 1];
162 else if (std::string(argv[i]) == "--root-macro" ||
163 std::string(argv[i]) == "-rm")
165#else
166 if (std::string(argv[i]) == "--root-macro" || std::string(argv[i]) == "-rm")
168#endif
169 else if (std::string(argv[i]) == "--verbose" ||
170 std::string(argv[i]) == "-v")
172 else {
173 PrintUsage("testMonopole");
174 return 1;
175 }
176 }
177
179#ifdef USE_GEANT4
180 PrintG4Configuration("testMonopole", g4Geometry, g4PhysicsList,
181 g4SpecialPhysics, g4Macro, g4Macro2, g4VisMacro, g4Session,
rootMacro);
182#endif
183 }
184
185
186
187
189 "ExampleMonopole", "The example Monopole MC MC application");
190
191
192
193
194
195
196
204
205#ifdef USE_GEANT4
206
208 g4Geometry, g4PhysicsList, g4SpecialPhysics, false, false);
209
210
211 TGeant4* geant4 = new TGeant4(
212 "TGeant4", "The Geant4 Monte Carlo", runConfiguration, argc, argv);
213
214
215
216 if (g4Macro.size()) {
217 geant4->ProcessGeantMacro(g4Macro.data());
218 }
219#endif
220
221
224#ifdef USE_GEANT4
225 if (g4Macro2.size()) {
226
227 geant4->ProcessGeantMacro("g4config2.in");
228 }
229
230
231 if (g4VisMacro.size()) {
232 geant4->ProcessGeantMacro(g4VisMacro.data());
233 }
234#endif
236 }
237 else {
238
240 }
241
242 delete appl;
243}
The detector construction (via TGeo )
void SetAbsorberSizeYZ(Double_t sizeYZ)
void SetAbsorberSizeX(Double_t sizeX)
void SetMaxStepSize(Double_t maxStepSize)
void SetAbsorberMaterial(const TString &name)
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)
void SetBinSize(Double_t binSize)
void RunMC(Int_t nofEvents)
DetectorConstruction * GetDetectorConstruction() const