LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
microelectronics.cc File Reference
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIExecutive.hh"
#include "G4VisExecutive.hh"
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.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 microelectronics.cc.

References session.

51 {
52  G4UIExecutive* session = NULL;
53  if (argc==1) // Define UI session for interactive mode.
54  {
55  session = new G4UIExecutive(argc, argv);
56  }
57 
58  // Choose the Random engine
59 
60  G4Random::setTheEngine(new CLHEP::RanecuEngine);
61 
62  // Construct the default run manager
63 
64 #ifdef G4MULTITHREADED
65  G4MTRunManager* runManager = new G4MTRunManager;
66  // runManager->SetNumberOfThreads(2); // Is equal to 2 by default
67 #else
68  G4RunManager* runManager = new G4RunManager;
69 #endif
70 
71  // Set mandatory user initialization classes
73  runManager->SetUserInitialization(detector);
74 
75  runManager->SetUserInitialization(new PhysicsList);
76 
77  // User action initialization
78  runManager->SetUserInitialization(new ActionInitialization(detector));
79 
80  // Initialize G4 kernel
81  runManager->Initialize();
82 
83  G4VisManager* visManager = new G4VisExecutive;
84  visManager->Initialize();
85 
86  // Get the pointer to the User Interface manager
87  G4UImanager* UImanager = G4UImanager::GetUIpointer();
88 
89  if (argc==1) // Define UI session for interactive mode.
90  {
91  UImanager->ApplyCommand("/control/execute microelectronics.mac");
92  session->SessionStart();
93  delete session;
94  }
95  else // Batch mode
96  {
97  G4String command = "/control/execute ";
98  G4String fileName = argv[1];
99  UImanager->ApplyCommand(command+fileName);
100  }
101 
102  delete visManager;
103 
104  delete runManager;
105 
106  return 0;
107 }
static G4UIterminal * session