Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -29,86 +29,82 @@
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4Types.hh"
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
#include "G4MTRunManager.hh"
|
||||
#else
|
||||
#include "G4RunManager.hh"
|
||||
#endif
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4String.hh"
|
||||
#include "LXeActionInitialization.hh"
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
|
||||
#include "FTFP_BERT.hh"
|
||||
#include "G4OpticalPhysics.hh"
|
||||
#include "G4EmStandardPhysics_option4.hh"
|
||||
|
||||
#include "LXeDetectorConstruction.hh"
|
||||
#include "LXeActionInitialization.hh"
|
||||
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "G4OpticalParameters.hh"
|
||||
#include "G4OpticalPhysics.hh"
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4String.hh"
|
||||
#include "G4Types.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
//detect interactive mode (if no arguments) and define UI session
|
||||
// detect interactive mode (if no arguments) and define UI session
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if (argc == 1) { ui = new G4UIExecutive(argc,argv); }
|
||||
if(argc == 1)
|
||||
{
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
auto runManager = G4RunManagerFactory::CreateRunManager();
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MTRunManager * runManager = new G4MTRunManager;
|
||||
G4int nThreads = std::min(G4Threading::G4GetNumberOfCores(), 4);
|
||||
runManager->SetNumberOfThreads(nThreads);
|
||||
G4cout << "===== LXe is started with "
|
||||
<< runManager->GetNumberOfThreads() << " threads =====" << G4endl;
|
||||
#else
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
#endif
|
||||
LXeDetectorConstruction* det = new LXeDetectorConstruction();
|
||||
runManager->SetUserInitialization(det);
|
||||
|
||||
G4VModularPhysicsList* physicsList = new FTFP_BERT;
|
||||
physicsList->ReplacePhysics(new G4EmStandardPhysics_option4());
|
||||
|
||||
G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
|
||||
opticalPhysics->SetWLSTimeProfile("delta");
|
||||
auto opticalParams = G4OpticalParameters::Instance();
|
||||
|
||||
opticalPhysics->SetScintillationYieldFactor(1.0);
|
||||
opticalPhysics->SetScintillationExcitationRatio(0.0);
|
||||
opticalParams->SetWLSTimeProfile("delta");
|
||||
|
||||
opticalPhysics->SetMaxNumPhotonsPerStep(100);
|
||||
opticalPhysics->SetMaxBetaChangePerStep(10.0);
|
||||
opticalParams->SetScintYieldFactor(1.0);
|
||||
opticalParams->SetScintExcitationRatio(0.0);
|
||||
opticalParams->SetScintTrackSecondariesFirst(true);
|
||||
opticalParams->SetScintEnhancedTimeConstants(true);
|
||||
|
||||
opticalPhysics->SetTrackSecondariesFirst(kCerenkov, true);
|
||||
opticalPhysics->SetTrackSecondariesFirst(kScintillation, true);
|
||||
opticalParams->SetCerenkovMaxPhotonsPerStep(100);
|
||||
opticalParams->SetCerenkovMaxBetaChange(10.0);
|
||||
opticalParams->SetCerenkovTrackSecondariesFirst(true);
|
||||
|
||||
physicsList->RegisterPhysics(opticalPhysics);
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
|
||||
runManager->SetUserInitialization(new LXeActionInitialization(det));
|
||||
|
||||
//initialize visualization
|
||||
// initialize visualization
|
||||
G4VisManager* visManager = new G4VisExecutive;
|
||||
visManager->Initialize();
|
||||
|
||||
//get the pointer to the User Interface manager
|
||||
// get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if (ui) {
|
||||
//interactive mode
|
||||
if(ui)
|
||||
{
|
||||
// interactive mode
|
||||
UImanager->ApplyCommand("/control/execute vis.mac");
|
||||
if (ui->IsGUI()) {
|
||||
if(ui->IsGUI())
|
||||
{
|
||||
UImanager->ApplyCommand("/control/execute gui.mac");
|
||||
}
|
||||
ui->SessionStart();
|
||||
delete ui;
|
||||
} else {
|
||||
//batch mode
|
||||
G4String command = "/control/execute ";
|
||||
}
|
||||
else
|
||||
{
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
UImanager->ApplyCommand(command + fileName);
|
||||
}
|
||||
|
||||
// job termination
|
||||
|
||||
Reference in New Issue
Block a user