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

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

#include "Ex02MCApplication.h"
#include "TROOT.h"
Include dependency graph for exampleE02.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 E02 application executable.

Date
26/02/2014
Author
I. Hrivnacova; IPN, Orsay

Definition in file exampleE02.cxx.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Application main program.

Definition at line 30 of file exampleE02.cxx.

31{
32 // Initialize Root threading.
33 // (Multi-threading is triggered automatically if Geant4 was built
34 // in MT mode.)
35#ifdef G4MULTITHREADED
36 ROOT::EnableThreadSafety();
37#endif
38
39 // Create MC application (thread local)
40 Ex02MCApplication* appl =
41 new Ex02MCApplication("ExampleE02", "The exampleE02 MC application");
42
43#ifdef USE_GEANT4
44 // RunConfiguration for Geant4
45 TG4RunConfiguration* runConfiguration =
46 new TG4RunConfiguration("geomRootToGeant4", "FTFP_BERT");
47
48 // TGeant4
49 TGeant4* geant4 = new TGeant4(
50 "TGeant4", "The Geant4 Monte Carlo", runConfiguration, argc, argv);
51
52 // Customise Geant4 setting
53 // (verbose level, global range cut, ..)
54 geant4->ProcessGeantMacro("g4config.in");
55#endif
56
57#ifdef USE_GEANT3
58 TGeant3* geant3 = new TGeant3TGeo("C++ Interface to Geant3");
59 geant3->SetHADR(0);
60#endif
61
62 // Run from this main
63 appl->InitMC("");
64
65#ifdef USE_GEANT4
66 // Setting Geant4 visualization
67 geant4->ProcessGeantMacro("g4vis.in");
68#endif
69 appl->RunMC(5);
70
71 delete appl;
72}
Implementation of the TVirtualMCApplication.
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)