]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4VRunConfiguration.cxx
Possibility to define the magnetic field in the reconstruction (Yu.Belikov)
[u/mrichter/AliRoot.git] / TGeant4 / TG4VRunConfiguration.cxx
1 // $Id$
2 // Category: run
3 //
4 // See the class description in the header file.
5
6 #include "TG4VRunConfiguration.h"
7 #include "TG4Globals.h"
8
9 #include <G4VUserDetectorConstruction.hh>
10 #include <G4VModularPhysicsList.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>
18
19 TG4VRunConfiguration::TG4VRunConfiguration()
20   : fDetectorConstruction(0),
21     fPhysicsList(0),
22     fPrimaryGenerator(0),
23     fRunAction(0),
24     fEventAction(0),
25     fTrackingAction(0),
26     fSteppingAction(0),
27     fStackingAction(0)
28 {
29 //
30 }
31
32 TG4VRunConfiguration::TG4VRunConfiguration(const TG4VRunConfiguration& right)
33 {
34 //
35   TG4Globals::Exception("TG4VRunConfiguration is protected from copying.");
36 }
37
38 TG4VRunConfiguration::~TG4VRunConfiguration(){
39 //
40 }
41
42 // operators
43
44 TG4VRunConfiguration& TG4VRunConfiguration::operator=(
45                                 const TG4VRunConfiguration& right)
46 {
47   // check assignement to self
48   if (this == &right) return *this;
49   
50   TG4Globals::Exception("TG4VRunConfiguration is protected from assigning.");
51
52   return *this;  
53 }    
54           
55 // public methods
56
57 void TG4VRunConfiguration::ConfigureRunManager(G4RunManager* runManager)
58 {
59 // Sets the user action classes to G4RunManager.
60 // --- 
61
62   //if (!fDetectorConstruction || !fPhysicsList || !fPrimaryGenerator)
63   //TG4Globals::Exception("Mandatory user classes are missing.");    
64   
65   // set mandatory classes
66   runManager->SetUserInitialization(fDetectorConstruction);
67   runManager->SetUserInitialization(fPhysicsList);
68   runManager->SetUserAction(fPrimaryGenerator);      
69
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);
76 }
77
78 G4VModularPhysicsList* TG4VRunConfiguration::GetPhysicsList() const
79 {
80 // Returns the modular physics list.
81 // ---
82   
83   return fPhysicsList;
84 }
85