Loading...
Searching...
No Matches
Functions
LXe.cc File Reference

Main program of the optical/LXe example. More...

#include "LXeActionInitialization.hh"
#include "LXeDetectorConstruction.hh"
#include "FTFP_BERT.hh"
#include "G4EmStandardPhysics_option4.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"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the optical/LXe example.

Definition in file LXe.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 48 of file LXe.cc.

49{
50 // detect interactive mode (if no arguments) and define UI session
51 G4UIExecutive* ui = nullptr;
52 if(argc == 1)
53 {
54 ui = new G4UIExecutive(argc, argv);
55 }
56
57 auto runManager = G4RunManagerFactory::CreateRunManager();
58
59 auto det = new LXeDetectorConstruction();
60 runManager->SetUserInitialization(det);
61
62 G4VModularPhysicsList* physicsList = new FTFP_BERT;
63 physicsList->ReplacePhysics(new G4EmStandardPhysics_option4());
64
65 auto opticalPhysics = new G4OpticalPhysics();
66 auto opticalParams = G4OpticalParameters::Instance();
67
68 opticalParams->SetWLSTimeProfile("delta");
69
70 opticalParams->SetScintTrackSecondariesFirst(true);
71
72 opticalParams->SetCerenkovMaxPhotonsPerStep(100);
73 opticalParams->SetCerenkovMaxBetaChange(10.0);
74 opticalParams->SetCerenkovTrackSecondariesFirst(true);
75
76 physicsList->RegisterPhysics(opticalPhysics);
77 runManager->SetUserInitialization(physicsList);
78
79 runManager->SetUserInitialization(new LXeActionInitialization(det));
80
81 // initialize visualization
82 G4VisManager* visManager = new G4VisExecutive;
83 visManager->Initialize();
84
85 // get the pointer to the User Interface manager
86 G4UImanager* UImanager = G4UImanager::GetUIpointer();
87
88 if(ui)
89 {
90 // interactive mode
91 UImanager->ApplyCommand("/control/execute vis.mac");
92 if(ui->IsGUI())
93 {
94 UImanager->ApplyCommand("/control/execute gui.mac");
95 }
96 ui->SessionStart();
97 delete ui;
98 }
99 else
100 {
101 // batch mode
102 G4String command = "/control/execute ";
103 G4String fileName = argv[1];
104 UImanager->ApplyCommand(command + fileName);
105 }
106
107 // job termination
108 delete visManager;
109 delete runManager;
110 return 0;
111}

Applications | User Support | Publications | Collaboration