LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
phantom.cc File Reference
#include <stdexcept>
#include "globals.hh"
#include "G4UImanager.hh"
#include "G4UIsession.hh"
#include "G4TransportationManager.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
#include "G4HumanPhantomConstruction.hh"
#include "G4HumanPhantomPhysicsList.hh"
#include "G4HumanPhantomActionInitialization.hh"
#include "G4RunManager.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 50 of file phantom.cc.

51 {
52 #ifdef G4MULTITHREADED
53  G4MTRunManager* runManager = new G4MTRunManager;
54  runManager->SetNumberOfThreads(4); // Is equal to 2 by default
55 #else
56  G4RunManager* runManager = new G4RunManager;
57 #endif
58 
59  // Set mandatory initialization classes
60  G4HumanPhantomConstruction* userPhantom = new G4HumanPhantomConstruction();
61  runManager->SetUserInitialization(userPhantom);
62 
63  runManager->SetUserInitialization(new G4HumanPhantomPhysicsList);
64 
65  G4VisManager* visManager = new G4VisExecutive;
66  visManager->Initialize();
67 
68  G4HumanPhantomActionInitialization* actions = new G4HumanPhantomActionInitialization();
69  runManager->SetUserInitialization(actions);
70 
71  G4UImanager* UImanager = G4UImanager::GetUIpointer();
72 
73  if (argc==1) // Define UI session for interactive mode.
74  {
75 
76  G4cout << " UI session starts ..." << G4endl;
77  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
78  UImanager->ApplyCommand("/control/execute default.mac");
79  ui->SessionStart();
80  delete ui;
81 
82  }
83  else // Batch mode
84  {
85  G4String command = "/control/execute ";
86  G4String fileName = argv[1];
87  UImanager -> ApplyCommand(command+fileName);
88  }
89 
90  delete visManager;
91 
92 delete runManager;
93 
94 return 0;
95 }