File indexing completed on 2025-04-03 08:07:05
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
0028
0029
0030
0031
0032
0033
0034 #include "ActionInitialization.hh"
0035 #include "DetectorConstruction.hh"
0036 #include "PhysicsList.hh"
0037
0038 #include "G4ParticleHPManager.hh"
0039 #include "G4RunManagerFactory.hh"
0040 #include "G4SteppingVerbose.hh"
0041 #include "G4Types.hh"
0042 #include "G4UIExecutive.hh"
0043 #include "G4UImanager.hh"
0044 #include "G4VisExecutive.hh"
0045 #include "Randomize.hh"
0046
0047
0048
0049 int main(int argc, char** argv)
0050 {
0051
0052 G4UIExecutive* ui = nullptr;
0053 if (argc == 1) ui = new G4UIExecutive(argc, argv);
0054
0055
0056 G4int precision = 4;
0057 G4SteppingVerbose::UseBestUnit(precision);
0058
0059
0060 auto runManager = G4RunManagerFactory::CreateRunManager();
0061 if (argc == 3) {
0062 G4int nThreads = G4UIcommand::ConvertToInt(argv[2]);
0063 runManager->SetNumberOfThreads(nThreads);
0064 }
0065
0066
0067 DetectorConstruction* det = new DetectorConstruction;
0068 runManager->SetUserInitialization(det);
0069
0070 PhysicsList* phys = new PhysicsList;
0071 runManager->SetUserInitialization(phys);
0072 runManager->SetUserInitialization(new ActionInitialization(det));
0073
0074
0075 G4ParticleHPManager::GetInstance()->SetSkipMissingIsotopes(false);
0076 G4ParticleHPManager::GetInstance()->SetDoNotAdjustFinalState(true);
0077 G4ParticleHPManager::GetInstance()->SetUseOnlyPhotoEvaporation(true);
0078 G4ParticleHPManager::GetInstance()->SetNeglectDoppler(false);
0079 G4ParticleHPManager::GetInstance()->SetProduceFissionFragments(true);
0080 G4ParticleHPManager::GetInstance()->SetUseWendtFissionModel(false);
0081 G4ParticleHPManager::GetInstance()->SetUseNRESP71Model(false);
0082
0083
0084 G4VisManager* visManager = nullptr;
0085
0086
0087 G4UImanager* UImanager = G4UImanager::GetUIpointer();
0088
0089 if (ui) {
0090
0091 visManager = new G4VisExecutive;
0092 visManager->Initialize();
0093 ui->SessionStart();
0094 delete ui;
0095 }
0096 else {
0097
0098 G4String command = "/control/execute ";
0099 G4String fileName = argv[1];
0100 UImanager->ApplyCommand(command + fileName);
0101 }
0102
0103
0104 delete visManager;
0105 delete runManager;
0106 }
0107
0108