31#include "G4RunManager.hh"
32#include "G4UIExecutive.hh"
33#include "G4UIcommand.hh"
34#include "G4UImanager.hh"
35#include "G4VisExecutive.hh"
43#include "Randomize.hh"
51 G4cerr <<
" Usage: " << G4endl;
52 G4cerr <<
" Garfield++ [-m macro ] [-u UIsession]" << G4endl;
58int main(
int argc,
char** argv) {
68 for (G4int i = 1; i < argc; i = i + 2) {
69 if (G4String(argv[i]) ==
"-m")
71 else if (G4String(argv[i]) ==
"-u")
72 session = argv[i + 1];
80 G4UIExecutive* ui = 0;
82 ui =
new G4UIExecutive(argc, argv);
86 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
87 G4Random::setTheSeed(1);
92 G4RunManager* runManager =
new G4RunManager;
96 runManager->SetUserInitialization(detConstruction);
103 runManager->SetUserAction(eventAction);
104 runManager->SetUserAction(
108 G4VisManager* visManager =
new G4VisExecutive;
111 visManager->Initialize();
114 G4UImanager* UImanager = G4UImanager::GetUIpointer();
119 G4String command =
"/control/execute ";
120 UImanager->ApplyCommand(command + macro);
123 UImanager->ApplyCommand(
"/control/execute init_vis.mac");
125 UImanager->ApplyCommand(
"/control/execute gui.mac");
Definition of the GarfieldDetectorConstruction class.
Definition of the GarfieldEventAction class.
Definition of the GarfieldPhysicsList class.
Definition of the GarfieldPhysics class.
Definition of the GarfieldPrimaryGeneratorAction class.
Definition of the GarfieldRunAction class.
Definition of the GarfieldSteppingAction class.
void Seed(const unsigned int s) override
Initialise the random number generator.
int main(int argc, char **argv)
RandomEngineRoot randomEngine
Random number generator.