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

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

#include "Ex06MCApplication.h"
#include "Ex06PrimaryGenerator.h"
#include "TROOT.h"
Include dependency graph for exampleE06.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 E06 application executable.

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

Definition in file exampleE06.cxx.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Application main program.

Definition at line 31 of file exampleE06.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 // Create MC application (thread local)
41 Ex06MCApplication* appl =
42 new Ex06MCApplication("ExampleE06", "The exampleE06 MC application");
44 // appl->SetVerboseLevel(3);
45
46#ifdef USE_GEANT4
47 // RunConfiguration for Geant4
48 TG4RunConfiguration* runConfiguration =
49 new TG4RunConfiguration("geomRootToGeant4", "emStandard+optical");
50
51 // TGeant4
52 TGeant4* geant4 = new TGeant4(
53 "TGeant4", "The Geant4 Monte Carlo", runConfiguration, argc, argv);
54
55 // Customise Geant4 setting
56 // (verbose level, global range cut, ..)
57 geant4->ProcessGeantMacro("g4config.in");
58#endif
59
60#ifdef USE_GEANT3
61 TGeant3* geant3 = new TGeant3TGeo("C++ Interface to Geant3");
62 gMC->SetProcess("CKOV", 1);
63 gMC->SetCut("CUTELE", 10e-06);
64 gMC->SetCut("CUTGAM", 10e-06);
65 geant3->SetSWIT(4, 1000);
66 // reduce printing from GTREVE_ROOT (sets one printing per 1000 tracks)
67#endif
68
69 // Run example
70 appl->InitMC("");
71
72 // Activate storing tracks
73 // gMC->SetCollectTracks(kTRUE);
74
75#ifdef USE_GEANT4
76 // Customise Geant4 setting
77 // (verbose level, global range cut, ..)
78 geant4->ProcessGeantMacro("g4config2.in");
79 // Setting Geant4 visualization
80 geant4->ProcessGeantMacro("g4vis.in");
81#endif
82
83 // Run MC
84 appl->RunMC(5);
85
86 delete appl;
87}
Implementation of the TVirtualMCApplication.
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)
Ex06PrimaryGenerator * GetPrimaryGenerator() const
void SetNofPrimaries(Int_t nofPrimaries)