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

Last change on this file since 1282 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

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