source: trunk/examples/extended/electromagnetic/TestEm10/TestEm10.cc@ 1244

Last change on this file since 1244 was 1230, checked in by garnier, 16 years ago

update to geant4.9.3

File size: 4.4 KB
RevLine 
[807]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//
27// $Id: TestEm10.cc,v 1.9 2007/07/27 17:52:04 vnivanch Exp $
[1230]28// GEANT4 tag $Name: geant4-09-03-cand-01 $
[807]29//
30//
31// --------------------------------------------------------------
32// GEANT 4 - TestEm10
33//
34// --------------------------------------------------------------
35// Comments
36//
37//
38// --------------------------------------------------------------
39
40#include "G4RunManager.hh"
41#include "G4UImanager.hh"
42#include "G4UIterminal.hh"
43#include "Randomize.hh"
44
45#ifdef G4VIS_USE
46#include "G4VisExecutive.hh"
47#endif
48
49#include "Em10DetectorConstruction.hh"
50// #include "ALICEDetectorConstruction.hh"
51#include "Em10PhysicsList.hh"
52#include "Em10PrimaryGeneratorAction.hh"
53#include "Em10RunAction.hh"
54#include "Em10EventAction.hh"
55#include "Em10SteppingAction.hh"
56#include "Em10SteppingVerbose.hh"
57#include "Em10TrackingAction.hh"
58
59int main(int argc,char** argv)
60{
61
62 //choose the Random engine
63
64 CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
65
66 //my Verbose output class
67
68 G4VSteppingVerbose::SetInstance(new Em10SteppingVerbose);
69
70 // Construct the default run manager
71
72 G4RunManager * runManager = new G4RunManager;
73
74 // set mandatory initialization classes
75
76 Em10DetectorConstruction* detector;
77 detector = new Em10DetectorConstruction;
78
79 // ALICEDetectorConstruction* detector;
80 // detector = new ALICEDetectorConstruction;
81
82 runManager->SetUserInitialization(detector);
83 runManager->SetUserInitialization(new Em10PhysicsList(detector));
84
85#ifdef G4VIS_USE
86 G4VisManager* visManager = 0;
87#endif
88
89 // set user action classes
90 runManager->SetUserAction(new Em10PrimaryGeneratorAction(detector));
91
92 Em10RunAction* runAction = new Em10RunAction;
93
94 runManager->SetUserAction(runAction);
95
96 Em10EventAction* eventAction = new Em10EventAction(runAction);
97
98 runManager->SetUserAction(eventAction);
99
100 Em10SteppingAction* steppingAction = new Em10SteppingAction(detector,
101 eventAction,
102 runAction);
103 runManager->SetUserAction(steppingAction);
104
105
106 runManager->SetUserAction( new Em10TrackingAction );
107
108
109 G4UImanager* UI = G4UImanager::GetUIpointer();
110
111 if (argc==1) // Define UI terminal for interactive mode
112 {
113#ifdef G4VIS_USE
114 visManager = new G4VisExecutive;
115 visManager->Initialize();
116#endif
117
118 G4UIsession * session = new G4UIterminal;
119 UI->ApplyCommand("/control/execute init.mac");
120 session->SessionStart();
121 delete session;
122 }
123 else // Batch mode
124 {
125 G4String command = "/control/execute ";
126 G4String fileName = argv[1];
127 UI->ApplyCommand(command+fileName);
128 }
129
130 // job termination
131#ifdef G4VIS_USE
132 delete visManager;
133#endif
134 delete runManager;
135
136 return 0;
137}
138
Note: See TracBrowser for help on using the repository browser.