Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
extended
persistency
gdml
G03
gdml_ext.cc
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
28
//
29
//
30
// $Id$
31
//
32
//
33
// --------------------------------------------------------------
34
// GEANT 4 - read_ext
35
//
36
// --------------------------------------------------------------
37
38
// Geant4 includes
39
//
40
#include "
G4RunManager.hh
"
41
#include "
G4UImanager.hh
"
42
#include "
globals.hh
"
43
44
// A pre-built physics list
45
//
46
#include "
QGSP_BERT.hh
"
47
48
// Example includes
49
//
50
#include "
G03DetectorConstruction.hh
"
51
#include "
G03PrimaryGeneratorAction.hh
"
52
#include "
G03RunAction.hh
"
53
54
#ifdef G4VIS_USE
55
#include "
G4VisExecutive.hh
"
56
#endif
57
58
#ifdef G4UI_USE
59
#include "
G4UIExecutive.hh
"
60
#endif
61
62
int
main
(
int
argc,
char
** argv)
63
{
64
65
// Construct the default run manager
66
//
67
G4RunManager
* runManager =
new
G4RunManager
;
68
69
// Set mandatory initialization and user action classes
70
//
71
G03DetectorConstruction
* detector =
new
G03DetectorConstruction
;
72
runManager->
SetUserInitialization
(detector);
73
runManager->
SetUserInitialization
(
new
QGSP_BERT
);
74
runManager->
SetUserAction
(
new
G03PrimaryGeneratorAction
);
75
G03RunAction
* runAction =
new
G03RunAction
;
76
runManager->
SetUserAction
(runAction);
77
78
// Initialisation of runManager via macro for the interactive mode
79
// This gives possibility to give different names for GDML file to READ
80
81
#ifdef G4VIS_USE
82
// Initialize visualization
83
//
84
G4VisManager
* visManager =
new
G4VisExecutive
;
85
visManager->
Initialize
();
86
#endif
87
88
// run initialisation macro
89
G4UImanager
* UImanager =
G4UImanager::GetUIpointer
();
90
if
( argc==1 )
// Define UI session for interactive mode.
91
{
92
#ifdef G4UI_USE
93
G4UIExecutive
* ui =
new
G4UIExecutive
(argc, argv);
94
#ifdef G4VIS_USE
95
UImanager->
ApplyCommand
(
"/control/execute vis.mac"
);
96
#endif
97
ui->
SessionStart
();
98
delete
ui;
99
#endif
100
}
101
else
// Batch mode
102
{
103
#ifdef G4UI_USE
104
G4UIExecutive
* ui =
new
G4UIExecutive
(argc, argv);
105
G4String
command =
"/control/execute "
;
106
G4String
fileName = argv[1];
107
UImanager->
ApplyCommand
(command+fileName);
108
ui->
SessionStart
();
109
delete
ui;
110
#endif
111
}
112
113
#ifdef G4VIS_USE
114
delete
visManager;
115
#endif
116
117
// Job termination
118
//
119
delete
runManager;
120
121
return
0;
122
}
Generated on Sat May 25 2013 14:33:00 for Geant4 by
1.8.4