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

Main program of the medical/dna/mfp example. More...

#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "ActionInitialization.hh"
#include "SteppingVerbose.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the medical/dna/mfp example.

Definition in file mfp.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 49 of file mfp.cc.

49  {
50 
51  // delete output file
52  remove ("mfp.txt");
53 
54  // detect interactive mode (if no arguments) and define UI session
55  G4UIExecutive* ui = 0;
56  if ( argc == 1 ) {
57  ui = new G4UIExecutive(argc, argv);
58  }
59 
60  // construct the default run manager
61 #ifdef G4MULTITHREADED
62  G4MTRunManager* runManager = new G4MTRunManager;
63 #else
64  G4VSteppingVerbose::SetInstance(new SteppingVerbose);
65  G4RunManager* runManager = new G4RunManager;
66 #endif
67 
68  // set mandatory initialization classes
70  runManager->SetUserInitialization(det);
71 
72  PhysicsList* phys = new PhysicsList;
73  runManager->SetUserInitialization(phys);
74 
75  runManager->SetUserInitialization(new ActionInitialization());
76 
77  // initialize visualization
78  G4VisManager* visManager = new G4VisExecutive;
79  // G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
80  // G4VisManager* visManager = new G4VisExecutive("Quiet");
81  visManager->Initialize();
82 
83  // get the pointer to the User Interface manager
84  G4UImanager* UImanager = G4UImanager::GetUIpointer();
85 
86  // process macro or start UI session
87  if ( ! ui ) {
88  // batch mode
89  G4String command = "/control/execute ";
90  G4String fileName = argv[1];
91  UImanager->ApplyCommand(command+fileName);
92  }
93  else {
94  // interactive mode
95  ui->SessionStart();
96  delete ui;
97  }
98 
99  // job termination
100  delete runManager;
101 
102  return 0;
103 }
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
Definition: PhysicsList.h:83