Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PurgMag.cc File Reference
Include dependency graph for PurgMag.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 61 of file PurgMag.cc.

61  {
62 
63  //choose the Random engine
64  G4Random::setTheEngine(new CLHEP::RanecuEngine);
65 
66  // Construct the default run manager
67 #ifdef G4MULTITHREADED
68  G4MTRunManager* runManager = new G4MTRunManager;
69  //runManager->SetNumberOfThreads(2);
70 #else
71  G4RunManager* runManager = new G4RunManager;
72 #endif
73 
74  // set mandatory initialization classes
76  runManager->SetUserInitialization(new PurgMagPhysicsList);
78 
79 
80 #ifdef G4VIS_USE
81  // visualization manager
82  G4VisManager* visManager = new G4VisExecutive;
83  visManager->Initialize();
84 #endif
85 
86  //Initialize G4 kernel
87  runManager->Initialize();
88 
89  // get the pointer to the User Interface manager
90  G4UImanager* UImanager = G4UImanager::GetUIpointer();
91 
92 
93  if (argc==1) // Define UI session for interactive mode.
94  {
95 #ifdef G4UI_USE
96  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
97 #ifdef G4VIS_USE
98  UImanager->ApplyCommand("/control/execute vis.mac");
99 #endif
100  ui->SessionStart();
101  delete ui;
102 #endif
103  }
104  else // Batch mode
105  {
106  G4String command = "/control/execute ";
107  G4String fileName = argv[1];
108  UImanager->ApplyCommand(command+fileName);
109  }
110 
111  // job termination
112 #ifdef G4VIS_USE
113  delete visManager;
114 #endif
115  delete runManager;
116 
117  return 0;
118 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
virtual void Initialize()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function: