VMC Examples Version 6.6
Loading...
Searching...
No Matches
exampleE03c.cxx File Reference

The Geant4 VMC example E03c application executable. More...

#include "Ex03PrimaryGenerator.h"
#include "Ex03cMCApplication.h"
#include "TROOT.h"
Include dependency graph for exampleE03c.cxx:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 Application main program.
 

Detailed Description

The Geant4 VMC example E03c application executable.

Date
30/04/2019
Author
Benedikt Volkel, CERN

Definition in file exampleE03c.cxx.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Application main program.

Definition at line 31 of file exampleE03c.cxx.

32{
33// Initialize Root threading.
34// (Multi-threading is triggered automatically if Geant4 was built
35// in MT mode.)
36#ifdef G4MULTITHREADED
37 ROOT::EnableThreadSafety();
38#endif
39
40 Bool_t isMulti = false;
41 Int_t debug = 0;
42#ifdef USE_MULTI
43 isMulti = true;
44 debug = 1;
45#endif
46
47 // Create MC application (thread local)
49 "ExampleE03", "The exampleE03 MC application", isMulti, isMulti);
51 appl->SetPrintModulo(1);
52 appl->SetDebug(debug);
53
54#ifdef USE_GEANT4
55 // RunConfiguration for Geant4
56 TG4RunConfiguration* runConfiguration =
57 new TG4RunConfiguration("geomRoot", "FTFP_BERT", "", false, false);
58
59 // TGeant4
60 TGeant4* geant4 = new TGeant4(
61 "TGeant4", "The Geant4 Monte Carlo", runConfiguration, argc, argv);
62
63 // Customise Geant4 setting
64 // (verbose level, global range cut, ..)
65 geant4->ProcessGeantMacro("g4config.in");
66#endif
67
68#ifdef USE_GEANT3
69 TGeant3TGeo* geant3 =
70 new TGeant3TGeo("C++ Interface to Geant3 with TGeo geometry");
71 geant3->SetProcess("DRAY", 1);
72 geant3->SetProcess("LOSS", 1);
73 geant3->SetProcess("HADR", 0);
74#endif
75
76 // Run example
77#ifdef USE_MULTI
78 appl->InitMC();
79#else
80 appl->InitMC("");
81#endif
82
83#ifdef USE_GEANT4
84#ifndef USE_MULTI
85 // Setting Geant4 visualization
86 geant4->ProcessGeantMacro("g4vis.in");
87#endif
88#endif
89
90 appl->RunMC(5);
91
92 delete appl;
93}
void SetNofPrimaries(Int_t nofPrimaries)
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)
void RunMC(Int_t nofEvents)
void SetDebug(Int_t debug)
Set debug option for multiple run.
Ex03PrimaryGenerator * GetPrimaryGenerator() const
void SetPrintModulo(Int_t value)