#include "TG4VRunConfiguration.h"
#include "TG4Globals.h"
#include "TG4GeometryManager.h"
+#include "TG4SDManager.h"
#include "TG4PhysicsManager.h"
#include "TG4G3PhysicsManager.h"
TG4RunManager* TG4RunManager::fgInstance = 0;
+//_____________________________________________________________________________
TG4RunManager::TG4RunManager(TG4VRunConfiguration* runConfiguration,
int argc, char** argv)
: fRunConfiguration(runConfiguration),
if (fgInstance) {
TG4Globals::Exception(
"TG4RunManager: attempt to create two instances of singleton.");
- };
+ }
if (!fRunConfiguration) {
TG4Globals::Exception(
"TG4RunManager: attempt to create instance without runConfiguration.");
- };
+ }
fgInstance = this;
fMessenger = new TG4RunMessenger(this);
}
+//_____________________________________________________________________________
TG4RunManager::TG4RunManager(TG4VRunConfiguration* runConfiguration)
: fRunConfiguration(runConfiguration),
fGeantUISession(0),
if (fgInstance) {
TG4Globals::Exception(
"TG4RunManager: attempt to create two instances of singleton.");
- };
+ }
if (!fRunConfiguration) {
TG4Globals::Exception(
"TG4RunManager: attempt to create instance without runConfiguration.");
- };
+ }
fgInstance = this;
fMessenger = new TG4RunMessenger(this);
}
+//_____________________________________________________________________________
TG4RunManager::TG4RunManager() {
//
}
+//_____________________________________________________________________________
TG4RunManager::TG4RunManager(const TG4RunManager& right) {
//
TG4Globals::Exception(
"Attempt to copy TG4RunManager singleton.");
}
+//_____________________________________________________________________________
TG4RunManager::~TG4RunManager() {
//
delete fRunConfiguration;
// operators
+//_____________________________________________________________________________
TG4RunManager& TG4RunManager::operator=(const TG4RunManager& right)
{
// check assignement to self
// private methods
+//_____________________________________________________________________________
void TG4RunManager::CreateGeantUI()
{
// Creates interactive Geant4.
}
}
+//_____________________________________________________________________________
void TG4RunManager::CreateRootUI()
{
// Creates interactive Root.
// public methods
+//_____________________________________________________________________________
void TG4RunManager::Initialize()
{
// Initializes G4.
// create physics constructor
// (this operation has to precede the "Init" phase)
- TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance();
- physicsManager->CreatePhysicsConstructors();
+ TG4PhysicsManager::Instance()->CreatePhysicsConstructors();
// initialize Geant4
fRunManager->Initialize();
+ // initialize SD manager
+ TG4SDManager::Instance()->Initialize();
+
// activate/inactivate physics processes
// (this operation is not allowed in "Init" phase)
- physicsManager->SetProcessActivation();
+ TG4PhysicsManager::Instance()->SetProcessActivation();
}
+//_____________________________________________________________________________
void TG4RunManager::ProcessEvent()
{
// Not yet implemented.
TG4Globals::Warning("TG4RunManager::ProcessEvent(): is not yet implemented.");
}
+//_____________________________________________________________________________
void TG4RunManager::ProcessRun(G4int nofEvents)
{
// Processes Geant4 run.
fRunManager->BeamOn(nofEvents);
}
+//_____________________________________________________________________________
void TG4RunManager::StartGeantUI()
{
// Starts interactive/batch Geant4.
}
}
+//_____________________________________________________________________________
void TG4RunManager::StartRootUI()
{
// Starts interactive Root.
}
}
+//_____________________________________________________________________________
void TG4RunManager::ProcessGeantMacro(G4String macroName)
{
// Processes Geant4 macro.
ProcessGeantCommand(command);
}
+//_____________________________________________________________________________
void TG4RunManager::ProcessRootMacro(G4String macroName)
{
// Processes Root macro.
gInterpreter->ProcessLine(macroFunction);
}
+//_____________________________________________________________________________
void TG4RunManager::ProcessGeantCommand(G4String command)
{
// Processes Geant4 command.
pUI->ApplyCommand(command);
}
+//_____________________________________________________________________________
void TG4RunManager::ProcessRootCommand(G4String command)
{
// Processes Root command.
gInterpreter->ProcessLine(command);
}
+//_____________________________________________________________________________
void TG4RunManager::UseG3Defaults()
{
// Controls G3 defaults usage.
TG4G3PhysicsManager::Instance()->SetG3DefaultControls();
}
+//_____________________________________________________________________________
Int_t TG4RunManager::CurrentEvent() const
{
// Returns the number of the current event.