source: trunk/examples/extended/electromagnetic/TestEm10/TestEm10.cc

Last change on this file was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 4.4 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: TestEm10.cc,v 1.10 2010/05/21 18:48:25 maire Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30//
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34#include "G4RunManager.hh"
35#include "G4UImanager.hh"
36#include "Randomize.hh"
37
38#include "Em10DetectorConstruction.hh"
39// #include "ALICEDetectorConstruction.hh"
40#include "Em10PhysicsList.hh"
41#include "Em10PrimaryGeneratorAction.hh"
42#include "Em10RunAction.hh"
43#include "Em10EventAction.hh"
44#include "Em10SteppingAction.hh"
45#include "Em10SteppingVerbose.hh"
46#include "Em10TrackingAction.hh"
47
48#ifdef G4VIS_USE
49#include "G4VisExecutive.hh"
50#endif
51
52#ifdef G4UI_USE
53#include "G4UIExecutive.hh"
54#endif
55
56//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
58int main(int argc,char** argv) 
59{
60
61  //choose the Random engine
62
63  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
64 
65  //my Verbose output class
66
67  G4VSteppingVerbose::SetInstance(new Em10SteppingVerbose);
68   
69  // Construct the default run manager
70
71  G4RunManager * runManager = new G4RunManager;
72
73  // set mandatory initialization classes
74
75  Em10DetectorConstruction* detector;
76  detector = new Em10DetectorConstruction;
77
78  // ALICEDetectorConstruction* detector;
79  // detector = new ALICEDetectorConstruction;
80
81  runManager->SetUserInitialization(detector);
82  runManager->SetUserInitialization(new Em10PhysicsList(detector));
83 
84  // set user action classes
85  runManager->SetUserAction(new Em10PrimaryGeneratorAction(detector));
86
87  Em10RunAction* runAction = new Em10RunAction;
88
89  runManager->SetUserAction(runAction);
90
91  Em10EventAction* eventAction = new Em10EventAction(runAction);
92
93  runManager->SetUserAction(eventAction);
94
95  Em10SteppingAction* steppingAction = new Em10SteppingAction(detector,
96                                                            eventAction, 
97                                                            runAction);
98  runManager->SetUserAction(steppingAction);
99
100
101  runManager->SetUserAction( new Em10TrackingAction );
102
103
104  G4UImanager* UI = G4UImanager::GetUIpointer(); 
105
106  if (argc!=1)   // batch mode 
107    {
108     G4String command = "/control/execute ";
109     G4String fileName = argv[1];
110     UI->ApplyCommand(command+fileName);
111    }
112   
113  else           //define visualization and UI terminal for interactive mode
114    { 
115#ifdef G4VIS_USE
116   G4VisManager* visManager = new G4VisExecutive;
117   visManager->Initialize();
118#endif   
119     
120#ifdef G4UI_USE
121      G4UIExecutive * ui = new G4UIExecutive(argc,argv);     
122      ui->SessionStart();
123      delete ui;
124#endif
125     
126#ifdef G4VIS_USE
127     delete visManager;
128#endif     
129    } 
130 
131  // job termination
132  //
133  delete runManager;
134
135  return 0;
136}
137
138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.