Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exampleRE06.cc File Reference

Main program of the RE06 example. More...

Include dependency graph for exampleRE06.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the RE06 example.

Definition in file exampleRE06.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 61 of file exampleRE06.cc.

62 {
63  // Construct the stepping verbose class
66 
67  // Construct the run manager
68  //
69 #ifdef G4MULTITHREADED
70  G4MTRunManager * runManager = new G4MTRunManager;
71  runManager->SetNumberOfThreads(4);
73 #else
74  G4RunManager* runManager = new G4RunManager;
75 #endif
76 
77  // Set mandatory initialization classes
78  //
79  G4String parallelWorldName = "ParallelScoringWorld";
81  detector->RegisterParallelWorld(new RE06ParallelWorld(parallelWorldName));
82  runManager->SetUserInitialization(detector);
83  //
84  G4VModularPhysicsList* physics = new FTFP_BERT;
85  physics->RegisterPhysics(new G4ParallelWorldPhysics(parallelWorldName));
86  runManager->SetUserInitialization(physics);
87 
88  // Set user action classes
89  //
91 
92 #ifdef G4VIS_USE
93  // Visualization manager
94  //
95  G4VisManager* visManager = new G4VisExecutive;
96  visManager->Initialize();
97 #endif
98 
99  // Initialize G4 kernel
100  //
101  runManager->Initialize();
102 
103  // Get the pointer to the User Interface manager
104  //
105  G4UImanager* UImanager = G4UImanager::GetUIpointer();
106 
107  if (argc==1) // Define UI session for interactive mode
108  {
109 #ifdef G4UI_USE
110  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
111 #ifdef G4VIS_USE
112  UImanager->ApplyCommand("/control/execute vis.mac");
113 #endif
114  ui->SessionStart();
115  delete ui;
116 #endif
117  }
118  else // Batch mode
119  {
120  G4String command = "/control/execute ";
121  G4String fileName = argv[1];
122  UImanager->ApplyCommand(command+fileName);
123  }
124 
125  // Job termination
126  // Free the store:
127  // user actions, physics_list and detector_description are
128  // owned and deleted by the run manager, so they should not
129  // be deleted in the main() program !
130 
131 #ifdef G4VIS_USE
132  delete visManager;
133 #endif
134  delete runManager;
135 
136  return 0;
137 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
void RegisterPhysics(G4VPhysicsConstructor *)
void SetNumberOfThreads(G4int n)
void RegisterParallelWorld(G4VUserParallelWorld *)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
virtual void SetUserInitialization(G4VUserPhysicsList *userPL)
void Initialize()
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
static void SetInstance(G4VSteppingVerbose *Instance)
virtual void Initialize()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function: