VMC Examples
Version 6.7
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
1
2
3
6
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
~
Functions
1
2
3
6
a
b
c
d
e
f
g
h
i
m
o
p
r
s
t
u
~
Variables
c
f
n
Enumerations
Enumerator
Files
File List
File Members
All
3
b
c
e
f
g
h
i
l
m
n
o
r
s
t
u
v
Functions
b
c
g
h
i
l
m
n
o
r
s
t
u
v
Variables
Typedefs
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Modules
Pages
Loading...
Searching...
No Matches
examples
E01
exampleE01.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Virtual Monte Carlo examples
3
// Copyright (C) 2014 Ivana Hrivnacova
4
// All rights reserved.
5
//
6
// For the licensing terms see geant4_vmc/LICENSE.
7
// Contact: root-vmc@cern.ch
8
//-------------------------------------------------
9
10
/// \file exampleE01.cxx
11
/// \brief The Geant4 VMC example E01 application executable
12
///
13
/// The Geant4 VMC application executable
14
/// with explicitely instantiated TGeant3 or TGeant4 and linked
15
/// with all libraries.
16
///
17
/// \date 26/02/2014
18
/// \author I. Hrivnacova; IPN, Orsay
19
20
#include "
Ex01MCApplication.h
"
21
22
#ifdef USE_GEANT4
23
#include "TG4RunConfiguration.h"
24
#include "TGeant4.h"
25
#endif
26
27
#ifdef USE_GEANT3
28
#include "TGeant3TGeo.h"
29
#endif
30
31
#include "TROOT.h"
32
33
/// Application main program
34
int
main
(
int
argc,
char
** argv)
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
}
34
int
main
(
int
argc,
char
** argv) {
…
}
Ex01MCApplication.h
Definition of the Ex01MCApplication class.
Ex01MCApplication
Implementation of the TVirtualMCApplication.
Definition
Ex01MCApplication.h:32
Ex01MCApplication::InitMC
void InitMC(const char *setup)
Definition
Ex01MCApplication.cxx:222
Ex01MCApplication::RunMC
void RunMC(Int_t nofEvents)
Definition
Ex01MCApplication.cxx:244
TG4RunConfiguration
main
int main(int argc, char **argv)
Application main program.
Definition
exampleE01.cxx:34
Generated on Tue Apr 1 2025 13:04:57 for VMC Examples by
1.13.2