LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
eRosita.cc File Reference
#include "eRositaDetectorConstruction.hh"
#include "eRositaPhysicsList.hh"
#include "eRositaPrimaryGeneratorAction.hh"
#include "eRositaRunAction.hh"
#include "eRositaEventAction.hh"
#include "eRositaSteppingAction.hh"
#include "eRositaSteppingVerbose.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 51 of file eRosita.cc.

52 {
53  // User Verbose output class
54  //
55  G4VSteppingVerbose* verbosity = new eRositaSteppingVerbose;
56  G4VSteppingVerbose::SetInstance(verbosity);
57 
58  // Run manager
59  //
60  G4RunManager* runManager = new G4RunManager;
61 
62  // User Initialization classes (mandatory)
63  //
64  eRositaDetectorConstruction* detector = new eRositaDetectorConstruction;
65  runManager->SetUserInitialization(detector);
66  //
67  G4VUserPhysicsList* physics = new eRositaPhysicsList;
68  runManager->SetUserInitialization(physics);
69 
70  // User Action classes
71  //
72  G4VUserPrimaryGeneratorAction* genAction = new eRositaPrimaryGeneratorAction(detector);
73  runManager->SetUserAction(genAction);
74  //
75  G4UserRunAction* runAction = new eRositaRunAction;
76  runManager->SetUserAction(runAction);
77  //
78  G4UserEventAction* eventAction = new eRositaEventAction;
79  runManager->SetUserAction(eventAction);
80  //
81  G4UserSteppingAction* steppingAction = new eRositaSteppingAction;
82  runManager->SetUserAction(steppingAction);
83 
84  // Initialize G4 kernel
85  //
86  runManager->Initialize();
87 
88  // Get the pointer to the User Interface manager
89  //
90  G4UImanager * UImanager = G4UImanager::GetUIpointer();
91 
92  if (argc!=1) // batch mode
93  {
94  G4String command = "/control/execute ";
95  G4String fileName = argv[1];
96  UImanager->ApplyCommand(command+fileName);
97  }
98 
99  else // interactive mode : define visualization and UI terminal
100  {
101 #ifdef G4VIS_USE
102  G4VisManager* visManager = new G4VisExecutive;
103  visManager->Initialize();
104 #endif
105 
106 #ifdef G4UI_USE
107  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
108  UImanager->ApplyCommand("/control/execute vis.mac");
109  ui->SessionStart();
110  delete ui;
111 #endif
112 
113 #ifdef G4VIS_USE
114  delete visManager;
115 #endif
116  }
117 
118  // Free the store: user actions, physics_list and detector_description are
119  // owned and deleted by the run manager, so they should not
120  // be deleted in the main() program !
121 
122  delete runManager;
123  delete verbosity;
124 
125  return 0;
126 }