LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Hadr08.cc File Reference

Main program of the hadronic/Hadr08 example. More...

#include "G4Types.hh"
#include "DetectorConstruction.hh"
#include "FTFP_BERT.hh"
#include "FTFP_INCLXX.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "ActionInitialization.hh"
#include "G4UIExecutive.hh"
#include "G4GenericBiasingPhysics.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the hadronic/Hadr08 example.

Definition in file Hadr08.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 50 of file Hadr08.cc.

50  {
51 
52  G4UIExecutive* ui = nullptr;
53  if ( argc == 1 ) {
54  ui = new G4UIExecutive(argc, argv);
55  }
56 
57  #ifdef G4MULTITHREADED
58  G4MTRunManager * runManager = new G4MTRunManager;
59  runManager->SetNumberOfThreads(4);
60  G4cout<<"+-------------------------------------------------------+"<<G4endl;
61  G4cout<<"| Constructing MT run manager |"<<G4endl;
62  G4cout<<"+-------------------------------------------------------+"<<G4endl;
63  #else
64  G4RunManager * runManager = new G4RunManager;
65  G4cout<<"+-------------------------------------------------------+"<<G4endl;
66  G4cout<<"| Constructing sequential run manager |"<<G4endl;
67  G4cout<<"+-------------------------------------------------------+"<<G4endl;
68  #endif
69 
70  G4VUserDetectorConstruction* detector = new DetectorConstruction;
71  runManager->SetUserInitialization( detector );
72 
73  FTFP_BERT* physicsList = new FTFP_BERT;
74  //FTFP_INCLXX* physicsList = new FTFP_INCLXX;
75 
76  G4GenericBiasingPhysics* biasingPhysics = new G4GenericBiasingPhysics;
77  biasingPhysics->Bias( "proton" );
78  biasingPhysics->Bias( "neutron" );
79  biasingPhysics->Bias( "pi+" );
80  biasingPhysics->Bias( "pi-" );
81  physicsList->RegisterPhysics( biasingPhysics );
82 
83  runManager->SetUserInitialization( physicsList );
84  runManager->SetUserInitialization( new ActionInitialization );
85 
86  runManager->Initialize();
87 
88  if ( ui ) {
89  ui->SessionStart();
90  delete ui;
91  } else {
92  G4String command = "/control/execute ";
93  G4String fileName = argv[1];
94  G4UImanager * UImanager = G4UImanager::GetUIpointer();
95  UImanager->ApplyCommand(command+fileName);
96  }
97 
98  delete runManager;
99 
100  return 0;
101 }