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

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

#include "Ex01MCApplication.h"
#include "TROOT.h"
Include dependency graph for exampleE01.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 E01 application executable.

The Geant4 VMC application executable with explicitely instantiated TGeant3 or TGeant4 and linked with all libraries.

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

Definition in file exampleE01.cxx.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Application main program.

Definition at line 34 of file exampleE01.cxx.

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