Geant4  10.02.p03
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

◆ main()

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  runManager->SetNumberOfThreads(2);
74 #else
75  G4RunManager* runManager = new G4RunManager;
76 #endif
77 
78  // Set mandatory user initialization classes
80  runManager->SetUserInitialization(new PhysicsList);
81 
82  // User action initialization
83 
85 
86  // Initialize G4 kernel
87 
88  runManager->Initialize();
89 
90 #ifdef G4VIS_USE
91  G4VisManager* visManager = new G4VisExecutive;
92  visManager->Initialize();
93 #endif
94 
95  // Get the pointer to the User Interface manager
97 
98  // Process macro or start UI session
99  //
100  if ( ! ui ) {
101  // batch mode
102  G4String command = "/control/execute ";
103  G4String fileName = argv[1];
104  UImanager->ApplyCommand(command+fileName);
105  }
106  else {
107  // interactive mode
108  UImanager->ApplyCommand("/control/execute vis.mac");
109  ui->SessionStart();
110  delete ui;
111  }
112 
113 #ifdef G4VIS_USE
114  delete visManager;
115 #endif
116 
117  delete runManager;
118 
119  return 0;
120 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
void SetNumberOfThreads(G4int n)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void Initialize()
virtual void Initialize()
Detector construction class to define materials and geometry.
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
Here is the call graph for this function: