4 // See the class description in the header file.
6 #include "TG4VRunConfiguration.h"
7 #include "TG4Globals.h"
9 #include <G4VUserDetectorConstruction.hh>
10 #include <G4VUserPhysicsList.hh>
11 #include <G4VUserPrimaryGeneratorAction.hh>
12 #include <G4UserRunAction.hh>
13 #include <G4UserEventAction.hh>
14 #include <G4UserTrackingAction.hh>
15 #include <G4UserSteppingAction.hh>
16 #include <G4UserStackingAction.hh>
17 #include <G4RunManager.hh>
19 TG4VRunConfiguration::TG4VRunConfiguration()
20 : fDetectorConstruction(0),
32 TG4VRunConfiguration::TG4VRunConfiguration(const TG4VRunConfiguration& right)
35 TG4Globals::Exception("TG4VRunConfiguration is protected from copying.");
38 TG4VRunConfiguration::~TG4VRunConfiguration(){
44 TG4VRunConfiguration& TG4VRunConfiguration::operator=(
45 const TG4VRunConfiguration& right)
47 // check assignement to self
48 if (this == &right) return *this;
50 TG4Globals::Exception("TG4VRunConfiguration is protected from assigning.");
57 void TG4VRunConfiguration::ConfigureRunManager(G4RunManager* runManager)
59 // Sets the user action classes to G4RunManager.
62 //if (!fDetectorConstruction || !fPhysicsList || !fPrimaryGenerator)
63 //TG4Globals::Exception("Mandatory user classes are missing.");
65 // set mandatory classes
66 runManager->SetUserInitialization(fDetectorConstruction);
67 runManager->SetUserInitialization(fPhysicsList);
68 runManager->SetUserAction(fPrimaryGenerator);
70 // user other action classes
71 if (fRunAction) runManager->SetUserAction(fRunAction);
72 if (fEventAction) runManager->SetUserAction(fEventAction);
73 if (fTrackingAction) runManager->SetUserAction(fTrackingAction);
74 if (fSteppingAction) runManager->SetUserAction(fSteppingAction);
75 if (fStackingAction) runManager->SetUserAction(fStackingAction);