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

Main program of the medical/dna/spower 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/spower example.

Definition in file spower.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 50 of file spower.cc.

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