source: trunk/source/geometry/solids/test/SurfaceChecker/SurfaceChecker.cc@ 1350

Last change on this file since 1350 was 1347, checked in by garnier, 15 years ago

geant4 tag 9.4

File size: 4.1 KB
Line 
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: SurfaceChecker.cc,v 1.3 2006/10/20 14:43:18 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-04-ref-00 $
29//
30//
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33#include "Randomize.hh"
34
35#include "SCDetectorConstruction.hh"
36#include "SCPhysicsList.hh"
37#include "SCPrimaryGeneratorAction.hh"
38#include "SCRunAction.hh"
39#include "SCEventAction.hh"
40#include "SCSteppingAction.hh"
41#include "SCSteppingVerbose.hh"
42
43#include "G4RunManager.hh"
44#include "G4UImanager.hh"
45#include "G4UIterminal.hh"
46#include "G4UItcsh.hh"
47
48#ifdef G4VIS_USE
49#include "SCVisManager.hh"
50#endif
51
52//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54int main(int argc,char** argv) {
55
56 // choose the Random engine
57 CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
58
59 //my Verbose output class
60 G4VSteppingVerbose::SetInstance(new SCSteppingVerbose);
61
62 // Run manager
63 G4RunManager * runManager = new G4RunManager;
64
65 // UserInitialization classes (mandatory)
66 SCDetectorConstruction* SCdetector = new SCDetectorConstruction;
67 runManager->SetUserInitialization(SCdetector);
68 runManager->SetUserInitialization(new SCPhysicsList);
69
70#ifdef G4VIS_USE
71 // Visualization, if you choose to have it!
72 G4VisManager* visManager = new SCVisManager;
73 visManager->Initialize();
74#endif
75
76 // UserAction classes
77 runManager->SetUserAction(new SCPrimaryGeneratorAction(SCdetector));
78 runManager->SetUserAction(new SCRunAction);
79 runManager->SetUserAction(new SCEventAction);
80 runManager->SetUserAction(new SCSteppingAction);
81
82 //Initialize G4 kernel
83 runManager->Initialize();
84
85 //get the pointer to the User Interface manager
86 G4UImanager * UI = G4UImanager::GetUIpointer();
87
88 if(argc==1)
89 // Define (G)UI terminal for interactive mode
90 {
91 // G4UIterminal is a (dumb) terminal.
92 G4UIsession * session = 0;
93#ifdef G4UI_USE_TCSH
94 session = new G4UIterminal(new G4UItcsh);
95#else
96 session = new G4UIterminal();
97#endif
98
99 UI->ApplyCommand("/control/execute vis.mac");
100 session->SessionStart();
101 delete session;
102 }
103 else
104 // Batch mode
105 {
106 G4String command = "/control/execute ";
107 G4String fileName = argv[1];
108 UI->ApplyCommand(command+fileName);
109 }
110
111#ifdef G4VIS_USE
112 delete visManager;
113#endif
114 delete runManager;
115
116 return 0;
117}
118
119//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120
Note: See TracBrowser for help on using the repository browser.