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