LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.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 46 of file eRosita.cc.

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