method Initialize() updated to introduction of new TG4SDManager class; added comment...
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Aug 2001 11:26:16 +0000 (11:26 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Aug 2001 11:26:16 +0000 (11:26 +0000)
TGeant4/TG4RunManager.cxx

index f9b07b7..877b106 100644 (file)
@@ -8,6 +8,7 @@
 #include "TG4VRunConfiguration.h"
 #include "TG4Globals.h"
 #include "TG4GeometryManager.h"
+#include "TG4SDManager.h"
 #include "TG4PhysicsManager.h"
 #include "TG4G3PhysicsManager.h"
 
@@ -29,6 +30,7 @@
 
 TG4RunManager* TG4RunManager::fgInstance = 0;
 
+//_____________________________________________________________________________
 TG4RunManager::TG4RunManager(TG4VRunConfiguration* runConfiguration, 
                              int argc, char** argv)              
   : fRunConfiguration(runConfiguration),
@@ -43,12 +45,12 @@ TG4RunManager::TG4RunManager(TG4VRunConfiguration* 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;
   
@@ -70,6 +72,7 @@ TG4RunManager::TG4RunManager(TG4VRunConfiguration* runConfiguration,
   fMessenger = new TG4RunMessenger(this);
 }
 
+//_____________________________________________________________________________
 TG4RunManager::TG4RunManager(TG4VRunConfiguration* runConfiguration)
   : fRunConfiguration(runConfiguration),
     fGeantUISession(0),
@@ -83,12 +86,12 @@ TG4RunManager::TG4RunManager(TG4VRunConfiguration* 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;
   
@@ -117,16 +120,19 @@ TG4RunManager::TG4RunManager(TG4VRunConfiguration* runConfiguration)
   fMessenger = new TG4RunMessenger(this);
 }
 
+//_____________________________________________________________________________
 TG4RunManager::TG4RunManager() {
 //
 }
 
+//_____________________________________________________________________________
 TG4RunManager::TG4RunManager(const TG4RunManager& right) {
 // 
   TG4Globals::Exception(
     "Attempt to copy TG4RunManager singleton.");
 }
 
+//_____________________________________________________________________________
 TG4RunManager::~TG4RunManager() {
 //  
   delete fRunConfiguration;
@@ -138,6 +144,7 @@ TG4RunManager::~TG4RunManager() {
 
 // operators
 
+//_____________________________________________________________________________
 TG4RunManager& TG4RunManager::operator=(const TG4RunManager& right)
 {
   // check assignement to self
@@ -151,6 +158,7 @@ TG4RunManager& TG4RunManager::operator=(const TG4RunManager& right)
 
 // private methods
 
+//_____________________________________________________________________________
 void TG4RunManager::CreateGeantUI()
 {
 // Creates interactive Geant4.
@@ -196,6 +204,7 @@ void TG4RunManager::CreateGeantUI()
   }
 }
 
+//_____________________________________________________________________________
 void TG4RunManager::CreateRootUI()
 {
 // Creates interactive Root.
@@ -213,6 +222,7 @@ void TG4RunManager::CreateRootUI()
 
 // public methods
 
+//_____________________________________________________________________________
 void TG4RunManager::Initialize()
 {
 // Initializes G4.
@@ -220,17 +230,20 @@ void TG4RunManager::Initialize()
 
   // 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.
@@ -239,6 +252,7 @@ void TG4RunManager::ProcessEvent()
   TG4Globals::Warning("TG4RunManager::ProcessEvent(): is not yet implemented.");
 }
     
+//_____________________________________________________________________________
 void TG4RunManager::ProcessRun(G4int nofEvents)
 {
 // Processes Geant4 run.
@@ -247,6 +261,7 @@ void TG4RunManager::ProcessRun(G4int nofEvents)
   fRunManager->BeamOn(nofEvents); 
 }
     
+//_____________________________________________________________________________
 void TG4RunManager::StartGeantUI()
 { 
 // Starts interactive/batch Geant4.
@@ -266,6 +281,7 @@ void TG4RunManager::StartGeantUI()
   }
 }
 
+//_____________________________________________________________________________
 void TG4RunManager::StartRootUI()
 {
 // Starts interactive Root.
@@ -279,6 +295,7 @@ void TG4RunManager::StartRootUI()
   }
 }
  
+//_____________________________________________________________________________
 void TG4RunManager::ProcessGeantMacro(G4String macroName)
 {
 // Processes Geant4 macro.
@@ -288,6 +305,7 @@ void TG4RunManager::ProcessGeantMacro(G4String macroName)
   ProcessGeantCommand(command);
 }
  
+//_____________________________________________________________________________
 void TG4RunManager::ProcessRootMacro(G4String macroName)
 {
 // Processes Root macro.
@@ -304,6 +322,7 @@ void TG4RunManager::ProcessRootMacro(G4String macroName)
   gInterpreter->ProcessLine(macroFunction);
 }
  
+//_____________________________________________________________________________
 void TG4RunManager::ProcessGeantCommand(G4String command)
 {
 // Processes Geant4 command.
@@ -313,6 +332,7 @@ void TG4RunManager::ProcessGeantCommand(G4String command)
   pUI->ApplyCommand(command);
 }
 
+//_____________________________________________________________________________
 void TG4RunManager::ProcessRootCommand(G4String command)
 {
 // Processes Root command.
@@ -321,6 +341,7 @@ void TG4RunManager::ProcessRootCommand(G4String command)
   gInterpreter->ProcessLine(command);
 }
 
+//_____________________________________________________________________________
 void TG4RunManager::UseG3Defaults() 
 {
 // Controls G3 defaults usage.
@@ -331,6 +352,7 @@ void TG4RunManager::UseG3Defaults()
   TG4G3PhysicsManager::Instance()->SetG3DefaultControls();
 }
 
+//_____________________________________________________________________________
 Int_t TG4RunManager::CurrentEvent() const
 {
 // Returns the number of the current event.