4 // Author: I. Hrivnacova
6 // Class TG4VRunConfiguration
7 // --------------------------
8 // See the class description in the header file.
10 #include "TG4VRunConfiguration.h"
11 #include "TG4VSDConstruction.h"
12 #include "TG4ModularPhysicsList.h"
13 #include "TG4TrackingAction.h"
14 #include "TG4SteppingAction.h"
15 #include "TG4Globals.h"
17 #include <G4VUserDetectorConstruction.hh>
18 #include <G4VUserPrimaryGeneratorAction.hh>
19 #include <G4UserRunAction.hh>
20 #include <G4UserEventAction.hh>
21 #include <G4UserStackingAction.hh>
22 #include <G4RunManager.hh>
24 //_____________________________________________________________________________
25 TG4VRunConfiguration::TG4VRunConfiguration()
26 : fDetectorConstruction(0),
39 //_____________________________________________________________________________
40 TG4VRunConfiguration::TG4VRunConfiguration(const TG4VRunConfiguration& right)
43 TG4Globals::Exception("TG4VRunConfiguration is protected from copying.");
46 //_____________________________________________________________________________
47 TG4VRunConfiguration::~TG4VRunConfiguration(){
53 //_____________________________________________________________________________
54 TG4VRunConfiguration& TG4VRunConfiguration::operator=(
55 const TG4VRunConfiguration& right)
57 // check assignement to self
58 if (this == &right) return *this;
60 TG4Globals::Exception("TG4VRunConfiguration is protected from assigning.");
67 //_____________________________________________________________________________
68 void TG4VRunConfiguration::ConfigureRunManager(G4RunManager* runManager)
70 // Sets the user action classes to G4RunManager.
73 //if (!fDetectorConstruction || !fPhysicsList || !fPrimaryGenerator)
74 //TG4Globals::Exception("Mandatory user classes are missing.");
76 // set mandatory classes
77 runManager->SetUserInitialization(fDetectorConstruction);
78 runManager->SetUserInitialization(fPhysicsList);
79 runManager->SetUserAction(fPrimaryGenerator);
81 // user other action classes
82 if (fRunAction) runManager->SetUserAction(fRunAction);
83 if (fEventAction) runManager->SetUserAction(fEventAction);
84 if (fTrackingAction) runManager->SetUserAction(fTrackingAction);
85 if (fSteppingAction) runManager->SetUserAction(fSteppingAction);
86 if (fStackingAction) runManager->SetUserAction(fStackingAction);
89 //_____________________________________________________________________________
90 TG4ModularPhysicsList* TG4VRunConfiguration::GetPhysicsList() const
92 // Returns the modular physics list.
98 //_____________________________________________________________________________
99 TG4VSDConstruction* TG4VRunConfiguration::GetSDConstruction() const
101 // Returns the sensitive detectors construction.
104 return fSDConstruction;