Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
microelectronics.cc File Reference
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIExecutive.hh"
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
Include dependency graph for microelectronics.cc:

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 52 of file microelectronics.cc.

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

Here is the call graph for this function: