File indexing completed on 2025-02-23 09:22:30
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 #include "G4RunManagerFactory.hh"
0034 #include "G4Timer.hh"
0035 #include "G4Types.hh"
0036 #include "G4UImanager.hh"
0037 #include "G4ios.hh"
0038
0039
0040 #include "ExGflash1DetectorConstruction.hh"
0041 #include "ExGflashActionInitialization.hh"
0042 #include "FTFP_BERT.hh"
0043
0044 #include "G4FastSimulationPhysics.hh"
0045 #include "G4UIExecutive.hh"
0046 #include "G4VisExecutive.hh"
0047
0048
0049
0050 int main(int argc, char** argv)
0051 {
0052
0053 G4UIExecutive* ui = nullptr;
0054 if (argc == 1) {
0055 ui = new G4UIExecutive(argc, argv);
0056 }
0057
0058
0059 G4Timer timer;
0060 timer.Start();
0061
0062 G4cout << "+-------------------------------------------------------+" << G4endl;
0063 G4cout << "| |" << G4endl;
0064 G4cout << "| This is an example of Shower |" << G4endl;
0065 G4cout << "| Parameterization with GFLASH |" << G4endl;
0066 G4cout << "+-------------------------------------------------------+" << G4endl;
0067
0068 auto* runManager = G4RunManagerFactory::CreateRunManager();
0069 runManager->SetNumberOfThreads(1);
0070
0071
0072 G4cout << "# GFlash Example: Detector Construction" << G4endl;
0073 runManager->SetUserInitialization(new ExGflash1DetectorConstruction);
0074
0075
0076
0077 G4VModularPhysicsList* physicsList = new FTFP_BERT();
0078
0079
0080 auto fastSimulationPhysics = new G4FastSimulationPhysics();
0081
0082
0083
0084
0085
0086 fastSimulationPhysics->ActivateFastSimulation("e-");
0087 fastSimulationPhysics->ActivateFastSimulation("e+");
0088
0089
0090
0091
0092
0093 physicsList->RegisterPhysics(fastSimulationPhysics);
0094 runManager->SetUserInitialization(physicsList);
0095
0096
0097 runManager->SetUserInitialization(new ExGflashActionInitialization);
0098
0099 G4VisManager* visManager = new G4VisExecutive;
0100 visManager->Initialize();
0101
0102 G4UImanager* UImanager = G4UImanager::GetUIpointer();
0103 UImanager->ApplyCommand("/run/verbose 0");
0104 runManager->Initialize();
0105 UImanager->ApplyCommand("/Step/Verbose 0");
0106
0107 if (ui)
0108 {
0109 UImanager->ApplyCommand("/control/execute vis.mac");
0110 ui->SessionStart();
0111 delete ui;
0112 }
0113 else
0114 {
0115 G4String s = *(argv + 1);
0116 UImanager->ApplyCommand("/control/execute " + s);
0117 }
0118
0119 delete visManager;
0120 delete runManager;
0121
0122 timer.Stop();
0123 G4cout << G4endl;
0124 G4cout << "******************************************";
0125 G4cout << G4endl;
0126 G4cout << "Total Real Elapsed Time is: " << timer.GetRealElapsed();
0127 G4cout << G4endl;
0128 G4cout << "Total System Elapsed Time: " << timer.GetSystemElapsed();
0129 G4cout << G4endl;
0130 G4cout << "Total GetUserElapsed Time: " << timer.GetUserElapsed();
0131 G4cout << G4endl;
0132 G4cout << "******************************************";
0133 G4cout << G4endl;
0134
0135 return 0;
0136 }
0137
0138