]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4RunManager.h
added inheritance from TG4Verbose;
[u/mrichter/AliRoot.git] / TGeant4 / TG4RunManager.h
1 // $Id$
2 // Category: run
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class TG4RunManager
7 // -------------------
8 // Geant4 implementation of the MonteCarlo interface methods                    
9 // for access to Geant4 at run level.
10 // It provides also methods for switching between Geant4 and
11 // Root UIs.
12
13 #ifndef TG4_RUN_MANAGER_H
14 #define TG4_RUN_MANAGER_H
15
16 #include "TG4RunMessenger.h"
17
18 #include <globals.hh>
19
20 #include <Rtypes.h>
21
22 class AliMC;
23
24 class TG4VRunConfiguration;
25
26 class G4RunManager;
27 class G4UIsession;
28
29 class TApplication;
30
31 class TG4RunManager
32 {
33   public:
34     TG4RunManager(TG4VRunConfiguration* configuration, int argc, char** argv);
35     TG4RunManager(TG4VRunConfiguration* configuration);
36     // --> protected
37     // TG4RunManager();
38     // TG4RunManager(const TG4RunManager& right);
39     virtual ~TG4RunManager();
40
41     // static access method
42     static TG4RunManager* Instance();
43
44     // methods
45     void Initialize();
46     void LateInitialize();
47     void ProcessEvent();
48     void ProcessRun(G4int nofEvents);
49
50     // get methods
51     Int_t CurrentEvent() const;
52
53     //
54     // methods for Geant4 only 
55     //
56     void StartGeantUI();
57     void StartRootUI();
58     void ProcessGeantMacro(G4String macroName);
59     void ProcessRootMacro(G4String macroName);
60     void ProcessGeantCommand(G4String command);
61     void ProcessRootCommand(G4String command);
62     void UseG3Defaults();      
63
64
65   protected:
66     TG4RunManager();
67     TG4RunManager(const TG4RunManager& right);
68
69     // operators
70     TG4RunManager& operator=(const TG4RunManager& right);
71    
72     // data members    
73
74   private:
75     // methods
76     void CreateGeantUI();
77     void CreateRootUI();
78     Text_t* G4StringToTextT(G4String string) const;
79     
80     // static data members
81     static TG4RunManager*  fgInstance; //this instance
82     
83     // data members    
84     G4RunManager*          fRunManager;       //G4RunManager
85     TG4RunMessenger        fMessenger;        //messenger
86     TG4VRunConfiguration*  fRunConfiguration; //TG4VRunConfiguration
87     G4UIsession*           fGeantUISession;   //G4 UI 
88     TApplication*          fRootUISession;    //Root UI 
89     G4bool                 fRootUIOwner;      //ownership of Root UI
90     G4int                  fARGC;             //argc 
91     char**                 fARGV;             //argv
92 };
93
94 // inline methods
95 inline TG4RunManager* TG4RunManager::Instance() 
96 { return fgInstance; }
97
98 #endif //TG4_RUN_MANAGER_H
99