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
electromagnetic
TestEm10
TestEm10.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
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35
36
#include "
G4RunManager.hh
"
37
#include "
G4UImanager.hh
"
38
#include "
Randomize.hh
"
39
40
#include "
Em10DetectorConstruction.hh
"
41
// #include "ALICEDetectorConstruction.hh"
42
#include "
Em10PhysicsList.hh
"
43
#include "
Em10PrimaryGeneratorAction.hh
"
44
#include "
Em10RunAction.hh
"
45
#include "
Em10EventAction.hh
"
46
#include "
Em10SteppingAction.hh
"
47
#include "
Em10SteppingVerbose.hh
"
48
#include "
Em10TrackingAction.hh
"
49
50
#ifdef G4VIS_USE
51
#include "
G4VisExecutive.hh
"
52
#endif
53
54
#ifdef G4UI_USE
55
#include "
G4UIExecutive.hh
"
56
#endif
57
58
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59
60
int
main
(
int
argc,
char
** argv)
61
{
62
63
//choose the Random engine
64
65
CLHEP::HepRandom::setTheEngine
(
new
CLHEP::RanecuEngine
);
66
67
//my Verbose output class
68
69
G4VSteppingVerbose::SetInstance
(
new
Em10SteppingVerbose
);
70
71
// Construct the default run manager
72
73
G4RunManager
* runManager =
new
G4RunManager
;
74
75
// set mandatory initialization classes
76
77
Em10DetectorConstruction
* detector;
78
detector =
new
Em10DetectorConstruction
;
79
80
// ALICEDetectorConstruction* detector;
81
// detector = new ALICEDetectorConstruction;
82
83
runManager->
SetUserInitialization
(detector);
84
runManager->
SetUserInitialization
(
new
Em10PhysicsList
(detector));
85
86
// set user action classes
87
runManager->
SetUserAction
(
new
Em10PrimaryGeneratorAction
(detector));
88
89
Em10RunAction
* runAction =
new
Em10RunAction
;
90
91
runManager->
SetUserAction
(runAction);
92
93
Em10EventAction
* eventAction =
new
Em10EventAction
(runAction);
94
95
runManager->
SetUserAction
(eventAction);
96
97
Em10SteppingAction
* steppingAction =
new
Em10SteppingAction
(detector,
98
eventAction,
99
runAction);
100
runManager->
SetUserAction
(steppingAction);
101
102
103
runManager->
SetUserAction
(
new
Em10TrackingAction
);
104
105
106
G4UImanager
* UI =
G4UImanager::GetUIpointer
();
107
108
if
(argc!=1)
// batch mode
109
{
110
G4String
command =
"/control/execute "
;
111
G4String
fileName = argv[1];
112
UI->
ApplyCommand
(command+fileName);
113
}
114
115
else
//define visualization and UI terminal for interactive mode
116
{
117
#ifdef G4VIS_USE
118
G4VisManager
* visManager =
new
G4VisExecutive
;
119
visManager->
Initialize
();
120
#endif
121
122
#ifdef G4UI_USE
123
G4UIExecutive
* ui =
new
G4UIExecutive
(argc,argv);
124
ui->
SessionStart
();
125
delete
ui;
126
#endif
127
128
#ifdef G4VIS_USE
129
delete
visManager;
130
#endif
131
}
132
133
// job termination
134
//
135
delete
runManager;
136
137
return
0;
138
}
139
140
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Generated on Sat May 25 2013 14:32:20 for Geant4 by
1.8.4