]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: run | |
3 | // | |
90adf9ff | 4 | // Author: I. Hrivnacova |
5 | // | |
6 | // Class TG4VRunConfiguration | |
7 | // -------------------------- | |
2817d3e2 | 8 | // See the class description in the header file. |
9 | ||
10 | #include "TG4VRunConfiguration.h" | |
90dbc0ba | 11 | #include "TG4VSDConstruction.h" |
90adf9ff | 12 | #include "TG4ModularPhysicsList.h" |
c2c99141 | 13 | #include "TG4TrackingAction.h" |
14 | #include "TG4SteppingAction.h" | |
2817d3e2 | 15 | #include "TG4Globals.h" |
16 | ||
17 | #include <G4VUserDetectorConstruction.hh> | |
2817d3e2 | 18 | #include <G4VUserPrimaryGeneratorAction.hh> |
19 | #include <G4UserRunAction.hh> | |
20 | #include <G4UserEventAction.hh> | |
2817d3e2 | 21 | #include <G4UserStackingAction.hh> |
22 | #include <G4RunManager.hh> | |
23 | ||
90dbc0ba | 24 | //_____________________________________________________________________________ |
2817d3e2 | 25 | TG4VRunConfiguration::TG4VRunConfiguration() |
26 | : fDetectorConstruction(0), | |
90dbc0ba | 27 | fSDConstruction(0), |
2817d3e2 | 28 | fPhysicsList(0), |
29 | fPrimaryGenerator(0), | |
30 | fRunAction(0), | |
31 | fEventAction(0), | |
32 | fTrackingAction(0), | |
33 | fSteppingAction(0), | |
34 | fStackingAction(0) | |
35 | { | |
36 | // | |
37 | } | |
38 | ||
90dbc0ba | 39 | //_____________________________________________________________________________ |
2817d3e2 | 40 | TG4VRunConfiguration::TG4VRunConfiguration(const TG4VRunConfiguration& right) |
41 | { | |
42 | // | |
43 | TG4Globals::Exception("TG4VRunConfiguration is protected from copying."); | |
44 | } | |
45 | ||
90dbc0ba | 46 | //_____________________________________________________________________________ |
2817d3e2 | 47 | TG4VRunConfiguration::~TG4VRunConfiguration(){ |
48 | // | |
49 | } | |
50 | ||
51 | // operators | |
52 | ||
90dbc0ba | 53 | //_____________________________________________________________________________ |
2817d3e2 | 54 | TG4VRunConfiguration& TG4VRunConfiguration::operator=( |
55 | const TG4VRunConfiguration& right) | |
56 | { | |
57 | // check assignement to self | |
58 | if (this == &right) return *this; | |
59 | ||
60 | TG4Globals::Exception("TG4VRunConfiguration is protected from assigning."); | |
61 | ||
62 | return *this; | |
63 | } | |
64 | ||
20bf4ef5 | 65 | // public methods |
2817d3e2 | 66 | |
90dbc0ba | 67 | //_____________________________________________________________________________ |
2817d3e2 | 68 | void TG4VRunConfiguration::ConfigureRunManager(G4RunManager* runManager) |
69 | { | |
70 | // Sets the user action classes to G4RunManager. | |
71 | // --- | |
72 | ||
73 | //if (!fDetectorConstruction || !fPhysicsList || !fPrimaryGenerator) | |
74 | //TG4Globals::Exception("Mandatory user classes are missing."); | |
75 | ||
76 | // set mandatory classes | |
77 | runManager->SetUserInitialization(fDetectorConstruction); | |
78 | runManager->SetUserInitialization(fPhysicsList); | |
79 | runManager->SetUserAction(fPrimaryGenerator); | |
80 | ||
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); | |
87 | } | |
20bf4ef5 | 88 | |
90dbc0ba | 89 | //_____________________________________________________________________________ |
90adf9ff | 90 | TG4ModularPhysicsList* TG4VRunConfiguration::GetPhysicsList() const |
20bf4ef5 | 91 | { |
92 | // Returns the modular physics list. | |
93 | // --- | |
94 | ||
95 | return fPhysicsList; | |
96 | } | |
97 | ||
90dbc0ba | 98 | //_____________________________________________________________________________ |
99 | TG4VSDConstruction* TG4VRunConfiguration::GetSDConstruction() const | |
100 | { | |
101 | // Returns the sensitive detectors construction. | |
102 | // --- | |
103 | ||
104 | return fSDConstruction; | |
105 | } | |
106 |