source: trunk/source/geometry/management/test/TestAssemblyVolume/testAssemblyVolume.cc @ 1319

Last change on this file since 1319 was 1316, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 3.7 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: testAssemblyVolume.cc,v 1.6 2006/06/29 18:34:13 gunter Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
29//
30//
31// --------------------------------------------------------------
32//      GEANT4 - testAssemblyVolume
33//
34// --------------------------------------------------------------
35// Comments
36//
37//
38// --------------------------------------------------------------
39
40#include "TstVADetectorConstruction.hh"
41#include "TstVARunAction.hh"
42#include "TstVAEventAction.hh"
43#include "TstVAPrimaryGeneratorAction.hh"
44#include "TstVASteppingAction.hh"
45#include "TstVAPhysicsList.hh"
46
47#include "G4UImanager.hh"
48#include "G4UIterminal.hh"
49
50#include "G4RunManager.hh"
51
52#ifdef G4VIS_USE
53#include "G4VisExecutive.hh"
54#endif
55
56#include "G4ios.hh"
57
58int main(int argc,char** argv) {
59
60  // Set the default random engine to RanecuEngine
61  CLHEP::RanecuEngine defaultEngine;
62  CLHEP::HepRandom::setTheEngine(&defaultEngine);
63
64  // Run manager
65  G4RunManager * runManager = new G4RunManager;
66
67  // UserInitialization classes
68  runManager->SetUserInitialization(new TstVADetectorConstruction);
69  runManager->SetUserInitialization(new TstVAPhysicsList);
70
71  #ifdef G4VIS_USE
72    // Visualization, if you choose to have it!
73    G4VisManager* visManager = new G4VisExecutive;
74    visManager->Initialize();
75  #endif
76
77  // UserAction classes
78  runManager->SetUserAction(new TstVARunAction);
79  runManager->SetUserAction(new TstVAPrimaryGeneratorAction);
80  runManager->SetUserAction(new TstVASteppingAction);
81  runManager->SetUserAction(new TstVAEventAction);
82
83  // User interactions
84  // Define (G)UI for interactive mode
85 
86  // User interactions
87    G4UImanager * UI = G4UImanager::GetUIpointer();
88 
89  if(argc==1)
90  { 
91    // G4UIterminal is a (dumb) terminal.
92    G4UIsession * session = new G4UIterminal;
93    UI->ApplyCommand("/control/execute prerun.g4mac"); 
94    session->SessionStart();
95    delete session;
96  }
97  else
98  // Batch mode
99  { 
100    G4String command = "/control/execute ";
101    G4String fileName = argv[1];
102    UI->ApplyCommand(command+fileName);
103  }
104 
105  #ifdef G4VIS_USE
106    delete visManager;
107  #endif
108  delete runManager;
109  return 0;
110}
111
Note: See TracBrowser for help on using the repository browser.