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