Geant4.10
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4.10.00.p01
examples
extended
persistency
P03
textGeom.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
//
26
// $Id: textGeom.cc 76481 2013-11-11 10:49:21Z gcosmo $
27
//
28
/// \file persistency/P03/textGeom.cc
29
/// \brief Main program of the persistency/P03 example
30
//
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33
#include "
ExTGDetectorConstruction.hh
"
34
#include "
ExTGDetectorConstructionWithSD.hh
"
35
#include "
ExTGDetectorConstructionWithCpp.hh
"
36
#include "
ExTGDetectorConstructionWithCuts.hh
"
37
#include "
ExTGPhysicsList.hh
"
38
#include "
ExTGPrimaryGeneratorAction.hh
"
39
#include "
ExTGActionInitialization.hh
"
40
41
#ifdef G4MULTITHREADED
42
#include "
G4MTRunManager.hh
"
43
#else
44
#include "
G4RunManager.hh
"
45
#endif
46
47
#include "
G4UImanager.hh
"
48
49
#ifdef G4VIS_USE
50
#include "
G4VisExecutive.hh
"
51
#endif
52
53
#ifdef G4UI_USE
54
#include "
G4UIExecutive.hh
"
55
#endif
56
57
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58
59
int
main
(
int
argc,
char
** argv)
60
{
61
// Run manager
62
//
63
#ifdef G4MULTITHREADED
64
G4MTRunManager
* runManager =
new
G4MTRunManager
;
65
runManager->
SetNumberOfThreads
(1);
66
#else
67
G4RunManager
* runManager =
new
G4RunManager
;
68
#endif
69
70
// User Initialization classes (mandatory)
71
//
72
runManager->
SetUserInitialization
(
new
ExTGDetectorConstruction
);
73
74
//
75
runManager->
SetUserInitialization
(
new
ExTGPhysicsList
);
76
77
// User Action classes
78
//
79
//MT runManager->SetUserAction(new ExTGPrimaryGeneratorAction);
80
81
runManager->
SetUserInitialization
(
new
ExTGActionInitialization
);
82
83
// Run action that dumps GEANT4 in-memory geometry to text file
84
//MT runManager->SetUserAction(new ExTGRunAction);
85
86
// Initialize G4 kernel
87
//
88
// runManager->Initialize();
89
90
// Get the pointer to the User Interface manager
91
//
92
G4UImanager
* UImanager =
G4UImanager::GetUIpointer
();
93
94
#ifdef G4VIS_USE
95
G4VisManager
* visManager =
new
G4VisExecutive
;
96
visManager->
Initialize
();
97
#endif
98
99
if
(argc!=1)
// batch mode
100
{
101
G4String
command =
"/control/execute "
;
102
G4String
fileName = argv[1];
103
UImanager->
ApplyCommand
(command+fileName);
104
}
105
else
// interactive mode : define visualization and UI terminal
106
{
107
#ifdef G4UI_USE
108
G4UIExecutive
* ui =
new
G4UIExecutive
(argc, argv);
109
#ifdef G4VIS_USE
110
UImanager->
ApplyCommand
(
"/control/execute run.mac"
);
111
#endif
112
ui->
SessionStart
();
113
delete
ui;
114
#endif
115
}
116
117
// Free the store: user actions, physics_list and detector_description are
118
// owned and deleted by the run manager, so they should not
119
// be deleted in the main() program !
120
121
#ifdef G4VIS_USE
122
delete
visManager;
123
#endif
124
delete
runManager;
125
126
return
0;
127
}
128
129
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130
ExTGActionInitialization.hh
Definition of the ActionInitialization class.
G4RunManager::SetUserInitialization
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Definition:
G4RunManager.cc:774
main
int main(int argc, char **argv)
Definition:
textGeom.cc:59
ExTGDetectorConstruction
Detector construction class using text geometry file.
Definition:
ExTGDetectorConstruction.hh:41
G4UIExecutive.hh
G4MTRunManager::SetNumberOfThreads
void SetNumberOfThreads(G4int n)
Definition:
G4MTRunManager.cc:179
G4RunManager.hh
G4UIExecutive::SessionStart
void SessionStart()
Definition:
G4UIExecutive.cc:304
G4UIExecutive
Definition:
G4UIExecutive.hh:60
G4MTRunManager
Definition:
G4MTRunManager.hh:50
ExTGPrimaryGeneratorAction.hh
Definition of the ExTGPrimaryGeneratorAction class.
G4VisExecutive.hh
G4UImanager::GetUIpointer
static G4UImanager * GetUIpointer()
Definition:
G4UImanager.cc:58
G4VisExecutive
Definition:
G4VisExecutive.hh:120
ExTGDetectorConstructionWithCuts.hh
Definition of the ExTGDetectorConstructionWithCuts class.
ExTGDetectorConstructionWithCpp.hh
Definition of the ExTGDetectorConstructionWithCpp class.
ExTGDetectorConstructionWithSD.hh
Definition of the ExTGDetectorConstructionWithSD class.
G4RunManager
Definition:
G4RunManager.hh:138
ExTGDetectorConstruction.hh
Definition of the ExTGDetectorConstruction class.
G4UImanager.hh
G4VisManager::Initialize
void Initialize()
ExTGActionInitialization
Definition:
ExTGActionInitialization.hh:39
G4UImanager
Definition:
G4UImanager.hh:56
G4VisManager
Definition:
G4VisManager.hh:119
ExTGPhysicsList
Definition:
ExTGPhysicsList.hh:43
G4MTRunManager.hh
ExTGPhysicsList.hh
Definition of the ExTGPhysicsList class.
G4UImanager::ApplyCommand
G4int ApplyCommand(const char *aCommand)
Definition:
G4UImanager.cc:419
G4String
Definition:
examples/extended/parallel/TopC/ParN02/AnnotatedFiles/G4String.hh:45
Generated on Wed Apr 30 2014 15:55:30 for Geant4.10 by
1.8.7