Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
remsim.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 //
27 // $Id$
28 
29 #include "G4RunManager.hh"
30 #include "G4UImanager.hh"
32 #include "RemSimPhysicsList.hh"
34 #include "RemSimEventAction.hh"
35 #include "RemSimRunAction.hh"
36 #include "RemSimSteppingAction.hh"
37 #include "G4ScoringManager.hh"
38 #ifdef G4VIS_USE
39 #include "G4VisExecutive.hh"
40 #endif
41 #ifdef G4UI_USE
42 #include "G4UIExecutive.hh"
43 #endif
44 #include "QGSP_BIC_HP.hh"
45 
46 int main(int argc,char** argv)
47 {
48  // Construct the default run manager
49  G4RunManager* runManager = new G4RunManager;
50 
51  // Access to the Scoring Manager pointer
53 
54  // HepRandom :: setTheSeed(0);
55  // Set mandatory initialization classes
56 
57  // Geometry
59  runManager -> SetUserInitialization(detector);
60 
61  // Physics
63  //runManager -> SetUserInitialization(new QGSP_BIC_HP());
64 
65  // Set mandatory user action class
66 
67  // Primary particles
69  runManager -> SetUserAction(primary);
70 
71  // Set optional user action class
72  RemSimEventAction* event = new RemSimEventAction();
73  runManager -> SetUserAction(event);
74 
75  RemSimRunAction* run = new RemSimRunAction();
76  runManager -> SetUserAction(run);
77 
78  runManager -> SetUserAction(new RemSimSteppingAction(primary));
79 
80 #ifdef G4VIS_USE
81  // Visualisation
82  G4VisManager* visManager = new G4VisExecutive;
83  visManager -> Initialize();
84 #endif
85 
86  // get the pointer to the UI manager and set verbosities
88 
89  if(argc == 1)
90  // Define (G)UI terminal for interactive mode
91  {
92 #ifdef G4UI_USE
93  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
94 #ifdef G4VIS_USE
95  UImanager->ApplyCommand("/control/execute interactive.mac");
96 #endif
97  ui->SessionStart();
98  delete ui;
99 #endif
100  }
101  else
102  // Batch mode
103  {
104  G4String command = "/control/execute ";
105  G4String fileName = argv[1];
106  UImanager -> ApplyCommand(command+fileName);
107  }
108 
109 
110 #ifdef G4VIS_USE
111  delete visManager;
112 #endif
113 
114  // job termination
115  delete runManager;
116 
117  return 0;
118 }
119