|
|
|||
File indexing completed on 2026-09-22 08:09:02
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 /// \file Hadr08.cc 0027 /// \brief Main program of the hadronic/Hadr08 example 0028 0029 #include "ActionInitialization.hh" 0030 #include "DetectorConstruction.hh" 0031 #include "FTFP_BERT.hh" 0032 #include "FTFP_INCLXX.hh" 0033 0034 #include "G4GenericBiasingPhysics.hh" 0035 #include "G4RunManagerFactory.hh" 0036 #include "G4Types.hh" 0037 #include "G4UIExecutive.hh" 0038 #include "G4UImanager.hh" 0039 0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0041 0042 int main(int argc, char** argv) 0043 { 0044 G4UIExecutive* ui = nullptr; 0045 if (argc == 1) { 0046 ui = new G4UIExecutive(argc, argv); 0047 } 0048 0049 auto* runManager = G4RunManagerFactory::CreateRunManager(); 0050 runManager->SetNumberOfThreads(4); 0051 0052 G4VUserDetectorConstruction* detector = new DetectorConstruction; 0053 runManager->SetUserInitialization(detector); 0054 0055 FTFP_BERT* physicsList = new FTFP_BERT; 0056 // FTFP_INCLXX* physicsList = new FTFP_INCLXX; 0057 0058 G4GenericBiasingPhysics* biasingPhysics = new G4GenericBiasingPhysics; 0059 biasingPhysics->Bias("proton"); 0060 biasingPhysics->Bias("neutron"); 0061 biasingPhysics->Bias("pi+"); 0062 biasingPhysics->Bias("pi-"); 0063 physicsList->RegisterPhysics(biasingPhysics); 0064 0065 runManager->SetUserInitialization(physicsList); 0066 runManager->SetUserInitialization(new ActionInitialization); 0067 0068 if (ui) { 0069 ui->SessionStart(); 0070 delete ui; 0071 } 0072 else { 0073 G4String command = "/control/execute "; 0074 G4String fileName = argv[1]; 0075 G4UImanager* UImanager = G4UImanager::GetUIpointer(); 0076 UImanager->ApplyCommand(command + fileName); 0077 } 0078 0079 delete runManager; 0080 0081 return 0; 0082 } 0083 0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|