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

Main program of the persistency/P03 example. More...

Include dependency graph for textGeom.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the persistency/P03 example.

Definition in file textGeom.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 59 of file textGeom.cc.

60 {
61  // Run manager
62  //
63 #ifdef G4MULTITHREADED
64  G4MTRunManager* runManager = new G4MTRunManager;
65  runManager->SetNumberOfThreads(1);
66 #else
67  G4RunManager* runManager = new G4RunManager;
68 #endif
69 
70  // User Initialization classes (mandatory)
71  //
73 
74  //
75  std::vector<G4String>* MyConstr = new std::vector<G4String>;
76  MyConstr->push_back("G4EmStandardPhysics");
77  G4VModularPhysicsList* phys = new G4GenericPhysicsList(MyConstr);
78  runManager->SetUserInitialization(phys);
79 
80  // User Action classes
81  //
82  //MT runManager->SetUserAction(new ExTGPrimaryGeneratorAction);
83 
85 
86  // Run action that dumps GEANT4 in-memory geometry to text file
87  //MT runManager->SetUserAction(new ExTGRunAction);
88 
89  // Initialize G4 kernel
90  //
91  // runManager->Initialize();
92 
93  // Get the pointer to the User Interface manager
94  //
95  G4UImanager * UImanager = G4UImanager::GetUIpointer();
96 
97 #ifdef G4VIS_USE
98  G4VisManager* visManager = new G4VisExecutive;
99  visManager->Initialize();
100 #endif
101 
102  if (argc!=1) // batch mode
103  {
104  G4String command = "/control/execute ";
105  G4String fileName = argv[1];
106  UImanager->ApplyCommand(command+fileName);
107  }
108  else // interactive mode : define visualization and UI terminal
109  {
110 #ifdef G4UI_USE
111  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
112 #ifdef G4VIS_USE
113  UImanager->ApplyCommand("/control/execute run.mac");
114 #endif
115  ui->SessionStart();
116  delete ui;
117 #endif
118  }
119 
120  // Free the store: user actions, physics_list and detector_description are
121  // owned and deleted by the run manager, so they should not
122  // be deleted in the main() program !
123 
124 #ifdef G4VIS_USE
125  delete visManager;
126 #endif
127  delete runManager;
128 
129  return 0;
130 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Detector construction class using text geometry file.
void SetNumberOfThreads(G4int n)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
TG4GenericPhysicsList< G4VModularPhysicsList > G4GenericPhysicsList
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447

Here is the call graph for this function: