]>
Commit | Line | Data |
---|---|---|
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 "TG4Verbose.h" | |
17 | #include "TG4RunMessenger.h" | |
18 | ||
19 | #include <globals.hh> | |
20 | ||
21 | #include <Rtypes.h> | |
22 | ||
23 | class AliMC; | |
24 | ||
25 | class TG4VRunConfiguration; | |
26 | ||
27 | class G4RunManager; | |
28 | class G4UIsession; | |
29 | ||
30 | class TApplication; | |
31 | ||
32 | class TG4RunManager : public TG4Verbose | |
33 | { | |
34 | public: | |
35 | TG4RunManager(TG4VRunConfiguration* configuration, int argc, char** argv); | |
36 | TG4RunManager(TG4VRunConfiguration* configuration); | |
37 | // --> protected | |
38 | // TG4RunManager(); | |
39 | // TG4RunManager(const TG4RunManager& right); | |
40 | virtual ~TG4RunManager(); | |
41 | ||
42 | // static access method | |
43 | static TG4RunManager* Instance(); | |
44 | ||
45 | // methods | |
46 | void Initialize(); | |
47 | void LateInitialize(); | |
48 | void ProcessEvent(); | |
49 | void ProcessRun(G4int nofEvents); | |
50 | ||
51 | // get methods | |
52 | Int_t CurrentEvent() const; | |
53 | ||
54 | // | |
55 | // methods for Geant4 only | |
56 | // | |
57 | void StartGeantUI(); | |
58 | void StartRootUI(); | |
59 | void ProcessGeantMacro(G4String macroName); | |
60 | void ProcessRootMacro(G4String macroName); | |
61 | void ProcessGeantCommand(G4String command); | |
62 | void ProcessRootCommand(G4String command); | |
63 | void UseG3Defaults(); | |
64 | ||
65 | ||
66 | protected: | |
67 | TG4RunManager(); | |
68 | TG4RunManager(const TG4RunManager& right); | |
69 | ||
70 | // operators | |
71 | TG4RunManager& operator=(const TG4RunManager& right); | |
72 | ||
73 | // data members | |
74 | ||
75 | private: | |
76 | // methods | |
77 | void CreateGeantUI(); | |
78 | void CreateRootUI(); | |
79 | Text_t* G4StringToTextT(G4String string) const; | |
80 | ||
81 | // static data members | |
82 | static TG4RunManager* fgInstance; //this instance | |
83 | ||
84 | // data members | |
85 | G4RunManager* fRunManager; //G4RunManager | |
86 | TG4RunMessenger fMessenger; //messenger | |
87 | TG4VRunConfiguration* fRunConfiguration; //TG4VRunConfiguration | |
88 | G4UIsession* fGeantUISession; //G4 UI | |
89 | TApplication* fRootUISession; //Root UI | |
90 | G4bool fRootUIOwner; //ownership of Root UI | |
91 | G4int fARGC; //argc | |
92 | char** fARGV; //argv | |
93 | }; | |
94 | ||
95 | // inline methods | |
96 | inline TG4RunManager* TG4RunManager::Instance() | |
97 | { return fgInstance; } | |
98 | ||
99 | #endif //TG4_RUN_MANAGER_H | |
100 |