File indexing completed on 2025-01-30 09:19:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include "eRositaActionInitialization.hh"
0028 #include "eRositaDetectorConstruction.hh"
0029 #include "eRositaEventAction.hh"
0030 #include "eRositaPhysicsList.hh"
0031 #include "eRositaPrimaryGeneratorAction.hh"
0032 #include "eRositaRunAction.hh"
0033 #include "eRositaSteppingAction.hh"
0034 #include "eRositaSteppingVerbose.hh"
0035
0036 #include "G4RunManagerFactory.hh"
0037 #include "G4UIExecutive.hh"
0038 #include "G4UImanager.hh"
0039 #include "G4VisExecutive.hh"
0040
0041 auto main(int argumentCount, char** argumentVector) -> int
0042 {
0043
0044
0045 auto *verbosity = new eRositaSteppingVerbose();
0046 G4VSteppingVerbose::SetInstance(verbosity);
0047
0048
0049
0050 auto *runManager = G4RunManagerFactory::CreateRunManager();
0051
0052 constexpr auto NUMBER_OF_THREADS{4};
0053 runManager->SetNumberOfThreads(NUMBER_OF_THREADS);
0054
0055 G4cout << "***********************" << G4endl;
0056 G4cout << "** Seed: " << G4Random::getTheSeed() << " **" << G4endl;
0057 G4cout << "***********************" << G4endl;
0058
0059 runManager->SetUserInitialization(new eRositaDetectorConstruction);
0060 runManager->SetUserInitialization(new eRositaPhysicsList);
0061 runManager->SetUserInitialization(new eRositaActionInitialization());
0062
0063
0064
0065 runManager->Initialize();
0066
0067
0068
0069 auto *userInterfaceManager = G4UImanager::GetUIpointer();
0070
0071 if (argumentCount != 1) {
0072 G4String command = "/control/execute ";
0073 G4String fileName = argumentVector[1];
0074 userInterfaceManager->ApplyCommand(command + fileName);
0075 } else {
0076 auto *visualizationManager = new G4VisExecutive;
0077 visualizationManager->Initialize();
0078
0079 auto *userInterface = new G4UIExecutive(argumentCount, argumentVector);
0080 userInterfaceManager->ApplyCommand("/control/execute vis.mac");
0081 userInterface->SessionStart();
0082
0083 delete userInterface;
0084 delete visualizationManager;
0085 }
0086
0087
0088
0089
0090
0091
0092 delete runManager;
0093 delete verbosity;
0094
0095 return 0;
0096 }