]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4VRunConfiguration.cxx
Added AliL3Stopwatch.
[u/mrichter/AliRoot.git] / TGeant4 / TG4VRunConfiguration.cxx
1 // $Id$
2 // Category: run
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class TG4VRunConfiguration
7 // --------------------------
8 // See the class description in the header file.
9
10 #include "TG4VRunConfiguration.h"
11 #include "TG4VSDConstruction.h"
12 #include "TG4ModularPhysicsList.h"
13 #include "TG4TrackingAction.h"
14 #include "TG4SteppingAction.h"
15 #include "TG4Globals.h"
16
17 #include <G4VUserDetectorConstruction.hh>
18 #include <G4VUserPrimaryGeneratorAction.hh>
19 #include <G4UserRunAction.hh>
20 #include <G4UserEventAction.hh>
21 #include <G4UserStackingAction.hh>
22 #include <G4RunManager.hh>
23
24 //_____________________________________________________________________________
25 TG4VRunConfiguration::TG4VRunConfiguration()
26   : fDetectorConstruction(0),
27     fSDConstruction(0),
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
39 //_____________________________________________________________________________
40 TG4VRunConfiguration::TG4VRunConfiguration(const TG4VRunConfiguration& right)
41 {
42 //
43   TG4Globals::Exception("TG4VRunConfiguration is protected from copying.");
44 }
45
46 //_____________________________________________________________________________
47 TG4VRunConfiguration::~TG4VRunConfiguration(){
48 //
49 }
50
51 // operators
52
53 //_____________________________________________________________________________
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           
65 // public methods
66
67 //_____________________________________________________________________________
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 }
88
89 //_____________________________________________________________________________
90 TG4ModularPhysicsList* TG4VRunConfiguration::GetPhysicsList() const
91 {
92 // Returns the modular physics list.
93 // ---
94   
95   return fPhysicsList;
96 }
97
98 //_____________________________________________________________________________
99 TG4VSDConstruction* TG4VRunConfiguration::GetSDConstruction() const
100 {
101 // Returns the sensitive detectors construction.
102 // ---
103   
104   return fSDConstruction;
105 }
106