source: trunk/examples/extended/optical/LXe/LXe.cc @ 1229

Last change on this file since 1229 was 807, checked in by garnier, 16 years ago

update

File size: 3.6 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#include "G4RunManager.hh"
27#include "G4UImanager.hh"
28#include "G4String.hh"
29#include "G4UItcsh.hh"
30#include "G4UIterminal.hh"
31
32#include "LXeDetectorConstruction.hh"
33#include "LXePhysicsList.hh"
34#include "LXePrimaryGeneratorAction.hh"
35#include "LXeEventAction.hh"
36#include "LXeStackingAction.hh"
37#include "LXeSteppingAction.hh"
38#include "LXeTrackingAction.hh"
39#include "LXeRunAction.hh"
40#include "LXeSteppingVerbose.hh"
41
42#include "RecorderBase.hh"
43
44#ifdef G4VIS_USE
45#include "G4VisExecutive.hh"
46#endif
47
48//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
49int main(int argc, char** argv)
50{
51  G4VSteppingVerbose::SetInstance(new LXeSteppingVerbose);
52
53  G4RunManager* runManager = new G4RunManager;
54
55  runManager->SetUserInitialization(new LXeDetectorConstruction);
56  runManager->SetUserInitialization(new LXePhysicsList);
57
58#ifdef G4VIS_USE
59  G4VisManager* visManager = new G4VisExecutive;
60  visManager->Initialize();
61#endif
62
63  RecorderBase* recorder = NULL;//No recording is done in this example
64
65  runManager->SetUserAction(new LXePrimaryGeneratorAction);
66  runManager->SetUserAction(new LXeStackingAction);
67 
68  runManager->SetUserAction(new LXeRunAction(recorder));
69  runManager->SetUserAction(new LXeEventAction(recorder));
70  runManager->SetUserAction(new LXeTrackingAction(recorder));
71  runManager->SetUserAction(new LXeSteppingAction(recorder));
72
73  runManager->Initialize();
74 
75  // get the pointer to the UI manager and set verbosities
76  G4UImanager* UI = G4UImanager::GetUIpointer();
77 
78  if(argc==1){
79    G4UIsession* session=0;
80#ifdef G4UI_USE_TCSH
81    session = new G4UIterminal(new G4UItcsh);
82#else
83    session = new G4UIterminal();
84#endif
85
86    //execute vis.mac
87    UI->ApplyCommand("/control/execute vis.mac");
88
89    session->SessionStart();
90    delete session;
91
92  }
93  else{
94    G4String command = "/control/execute ";
95    G4String filename = argv[1];
96    UI->ApplyCommand(command+filename);
97  }
98
99  if(recorder)delete recorder;
100
101#ifdef G4VIS_USE
102  delete visManager;
103#endif
104
105  // job termination
106  delete runManager;
107  return 0;
108}
109
110
Note: See TracBrowser for help on using the repository browser.