VMC Examples
Version 6.6
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
}
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 Thu Nov 28 2024 11:31:17 for VMC Examples by
1.12.0