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

Implementation of the dnaphysics example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIExecutive.hh"
#include "ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
Include dependency graph for dnaphysics.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Implementation of the dnaphysics example.

Definition in file dnaphysics.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 56 of file dnaphysics.cc.

57 {
58  // Detect interactive mode (if no arguments) and define UI session
59  //
60  G4UIExecutive* ui = 0;
61  if ( argc == 1 ) {
62  ui = new G4UIExecutive(argc, argv);
63  }
64 
65  // Choose the Random engine
66 
67  G4Random::setTheEngine(new CLHEP::RanecuEngine);
68 
69  // Construct the default run manager
70 
71 #ifdef G4MULTITHREADED
72  G4MTRunManager* runManager = new G4MTRunManager;
73  if(argc==3) runManager->SetNumberOfThreads(atoi(argv[2]));
74  else runManager->SetNumberOfThreads(2);
75 #else
76  G4RunManager* runManager = new G4RunManager;
77 #endif
78 
79  // Set mandatory user initialization classes
81  runManager->SetUserInitialization(new PhysicsList);
82 
83  // User action initialization
84 
86 
87 #ifdef G4VIS_USE
88  G4VisManager* visManager = new G4VisExecutive;
89  visManager->Initialize();
90 #endif
91 
92  // Get the pointer to the User Interface manager
94 
95  // Process macro or start UI session
96  //
97  if ( ! ui ) {
98  // batch mode
99  G4String command = "/control/execute ";
100  G4String fileName = argv[1];
101  UImanager->ApplyCommand(command+fileName);
102  }
103  else {
104  // interactive mode
105  UImanager->ApplyCommand("/control/execute vis.mac");
106  ui->SessionStart();
107  delete ui;
108  }
109 
110 #ifdef G4VIS_USE
111  delete visManager;
112 #endif
113 
114  delete runManager;
115 
116  return 0;
117 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
void SetNumberOfThreads(G4int n)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
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: