W pliku
My.cc (zmiany
kolorem czerwonym)
........................................................................................
#include "MyDetectorConstruction.hh"
#include "MyPhysicsList.hh"
#include "MyPrimaryGeneratorAction.hh"
#include "G4RunManager.hh"
#include "G4String.hh"
#include "G4UImanager.hh"
int main(int argc,char** argv) {
// Run manager
G4RunManager * runManager = new G4RunManager;
// Mandatory initialization classes
runManager->SetUserInitialization(new
MyDetectorConstruction);
runManager->SetUserInitialization(new MyPhysicsList);
// User action classes
runManager->SetUserAction(new MyPrimaryGeneratorAction());
// Initialize G4 kernel
runManager->Initialize();
// Start a run
// Get the pointer to the User Interface
manager
G4UImanager* UI = G4UImanager::GetUIpointer();
// G4int
numberOfEvents=2;
//
runManager->BeamOn(numberOfEvents);
// Execute macro argv[1] from c++ code
G4String macro = argv[1];
UI->ApplyCommand("/control/execute "+macro);
// Job termination
delete runManager;
return 0;
}