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

50 {
51 
52  // -- Construct the run manager : MT or sequential one
53 #ifdef G4MULTITHREADED
54  G4MTRunManager * runManager = new G4MTRunManager;
55  G4cout << " ********** Run Manager constructed in MT mode ************ " << G4endl;
56  // -- Choose 4 threads:
57  runManager->SetNumberOfThreads(4);
58 #else
59  G4RunManager * runManager = new G4RunManager;
60  G4cout << " ********** Run Manager constructed in sequential mode ************ " << G4endl;
61 #endif
62 
63 
64  // -- Set mandatory initialization classes
66  runManager->SetUserInitialization(detector);
67  G4VModularPhysicsList* physicsList = new FTFP_BERT;
68  // -- Setup biasing for neutron only. As will not bias any
69  // -- physics process, require the G4GenericBiasingPhysics()
70  // -- to modify the physics list just for "non-physics" biasing:
71  G4GenericBiasingPhysics* biasingPhysics = new G4GenericBiasingPhysics();
72  biasingPhysics->NonPhysicsBias("neutron");
73  physicsList->RegisterPhysics(biasingPhysics);
74  runManager->SetUserInitialization(physicsList);
75 
76  // -- Set user action initialization class
78  runManager->SetUserInitialization(actions);
79 
80 #ifdef G4VIS_USE
81  // Visualization manager
82  //
83  G4VisManager* visManager = new G4VisExecutive;
84  visManager->Initialize();
85 #endif
86 
87  // Initialize G4 kernel
88  //
89  runManager->Initialize();
90 
91  // Get the pointer to the User Interface manager
92  //
93  G4UImanager* UImanager = G4UImanager::GetUIpointer();
94 
95  if (argc==1) // Define UI session for interactive mode
96  {
97 #ifdef G4UI_USE
98  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
99 #ifdef G4VIS_USE
100  UImanager->ApplyCommand("/control/execute vis.mac");
101 #endif
102  ui->SessionStart();
103  delete ui;
104 #endif
105  }
106  else // Batch mode
107  {
108  G4String command = "/control/execute ";
109  G4String fileName = argv[1];
110  UImanager->ApplyCommand(command+fileName);
111  }
112 
113 #ifdef G4VIS_USE
114  delete visManager;
115 #endif
116  delete runManager;
117 
118  return 0;
119 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
void RegisterPhysics(G4VPhysicsConstructor *)
void SetNumberOfThreads(G4int n)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4GLOB_DLL std::ostream G4cout
void Initialize()
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
virtual void Initialize()
#define G4endl
Definition: G4ios.hh:61
void NonPhysicsBias(const G4String &particleName)
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function: