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

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

#include "MCApplication.h"
#include "PrimaryGenerator.h"
#include "TROOT.h"
Include dependency graph for exampleTR.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 TR application executable.

Date
18/12/2015
Author
I. Hrivnacova; IPN, Orsay

Definition in file exampleTR.cxx.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Application main program.

Definition at line 31 of file exampleTR.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)
42 new VMC::TR::MCApplication("ExampleTR", "The exampleTR MC application");
44 appl->SetPrintModulo(10000);
45
46#ifdef USE_GEANT4
47 // RunConfiguration for Geant4
48 TG4RunConfiguration* runConfiguration =
49 new TG4RunConfiguration("geomRootToGeant4", "emStandard", "", false, false);
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 new TGeant3TGeo("C++ Interface to Geant3");
62 gMC->SetProcess("DRAY", 1);
63 gMC->SetProcess("LOSS", 1);
64 gMC->SetProcess("HADR", 0);
65#endif
66
67 // Run example
68 appl->InitMC("");
69
70#ifdef USE_GEANT4
71 // Customise Geant4 setting after initialization:
72 geant4->ProcessGeantMacro("g4config2.in");
73
74 // Setting Geant4 visualization
75 // geant4->ProcessGeantMacro("g4vis.in");
76#endif
77
78 appl->RunMC(5000);
79
80 delete appl;
81}
Implementation of the TVirtualMCApplication.
PrimaryGenerator * GetPrimaryGenerator() const
void SetPrintModulo(Int_t value)
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)
void SetNofPrimaries(Int_t nofPrimaries)