]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliRunConfiguration.cxx
Moved from AliTransbit to AliL3Transbit.
[u/mrichter/AliRoot.git] / AliGeant4 / AliRunConfiguration.cxx
1 // $Id$
2 // Category: run
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class AliRunConfiguration
7 // -------------------------
8 // See the class description in the header file.
9
10 #include "AliRunConfiguration.h"
11 #include "AliRunMessenger.h"
12 #include "AliDetConstruction.h"
13 #include "AliSDConstruction.h"
14 #include "AliPrimaryGeneratorAction.h"
15 #include "AliRunAction.h"
16 #include "AliEventAction.h"
17 #include "AliTrackingAction.h"
18 #include "AliSteppingAction.h"
19 #include "AliStackingAction.h"
20 #include "AliFiles.h"
21
22 #include "TG4ModularPhysicsList.h"
23
24 //_____________________________________________________________________________
25 AliRunConfiguration::AliRunConfiguration()
26   : TG4VRunConfiguration()
27 {
28 //
29   CreateUserConfiguration();
30
31   fRunMessenger = new AliRunMessenger();
32   fFiles = new AliFiles(); 
33 }
34
35 //_____________________________________________________________________________
36 AliRunConfiguration::AliRunConfiguration(const AliRunConfiguration& right)
37   : TG4VRunConfiguration(right)
38 {
39   // TG4VRunConfiguration is protected from copying
40 }
41
42 //_____________________________________________________________________________
43 AliRunConfiguration::~AliRunConfiguration() {
44 //
45   delete fRunMessenger;
46   delete fFiles;
47
48   // all user action data members are deleted 
49   // in G4RunManager::~G4RunManager()
50 }
51
52 // operators
53
54 //_____________________________________________________________________________
55 AliRunConfiguration& 
56 AliRunConfiguration::operator=(const AliRunConfiguration& right)
57 {
58   // check assignement to self
59   if (this == &right) return *this;
60   
61   // base class assignement
62   // TG4VRunConfiguration is protected from assigning
63   TG4VRunConfiguration::operator=(right);
64
65   return *this;  
66 }    
67           
68 // protected methods
69
70 //_____________________________________________________________________________
71 void AliRunConfiguration::CreateUserConfiguration()
72 {
73 // Creates the mandatory Geant4 classes and 
74 // the other user action classes. 
75 // ---
76
77   // create mandatory Geant4 classes
78   fDetectorConstruction = new AliDetConstruction();
79   fSDConstruction = new AliSDConstruction();
80   fPhysicsList = new TG4ModularPhysicsList();
81   fPrimaryGenerator = new AliPrimaryGeneratorAction();
82
83   // create the other user action classes
84   fRunAction = new AliRunAction();
85   fEventAction = new AliEventAction();
86   fTrackingAction = new AliTrackingAction();
87   fSteppingAction = new AliSteppingAction();
88   fStackingAction = new AliStackingAction();
89 }
90
91 // public methods
92
93 //_____________________________________________________________________________
94 void AliRunConfiguration::SetConfigName(const char* name)
95 {
96 // Sets the configuration macro name 
97 // ---
98   fFiles->SetMacroName(name);
99 }  
100
101 //_____________________________________________________________________________
102 void AliRunConfiguration::SetG3CallsName(const char* name)
103 {
104 // Sets the configuration macro name 
105 // ---
106   fFiles->SetG3CallsName(name);
107 }  
108