]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4GeometryManager.h
default verbose level change to 1
[u/mrichter/AliRoot.git] / TGeant4 / TG4GeometryManager.h
1 // $Id$
2 // Category: geometry
3 //
4 // Author: V. Berejnoi, I. Hrivnacova
5 //
6 // Class TG4GeometryManager
7 // ------------------------
8 // Geant4 implementation of the MonteCarlo interface methods                    
9 // for building Geant4 geometry and access to it.
10
11 #ifndef TG4_GEOMETRY_MANAGER_H
12 #define TG4_GEOMETRY_MANAGER_H
13
14 #include "TG4NameMap.h"
15 #include "TG4IntMap.h"
16 #include "TG4Globals.h"
17
18 #include <globals.hh>
19
20 #include <Rtypes.h>
21
22
23 class TG4GeometryOutputManager;
24 class TG4GeometryServices;
25 class TG4G3CutVector;
26 class TG4G3ControlVector;
27
28 class G4VPhysicalVolume;
29
30 class TG4GeometryManager
31 {
32   public:
33     TG4GeometryManager();
34     // --> protected
35     // TG4GeometryManager(const TG4GeometryManager& right);
36     virtual ~TG4GeometryManager();
37
38     // static access method
39     static TG4GeometryManager* Instance();
40
41     //
42     // methods (from the base class)
43     
44     // detector composition
45     void  Material(Int_t& kmat, const char* name, Float_t a, 
46                      Float_t z, Float_t dens, Float_t radl, Float_t absl,
47                      Float_t* buf, Int_t nwbuf);
48     void  Mixture(Int_t& kmat, const char *name, Float_t *a, 
49                      Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat);
50     void  Medium(Int_t& kmed, const char *name, Int_t nmat, 
51                      Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, 
52                      Float_t stemax, Float_t deemax, Float_t epsil, 
53                      Float_t stmin, Float_t* ubuf, Int_t nbuf);
54     void  Matrix(Int_t& krot, Double_t thetaX, Double_t phiX, 
55                      Double_t thetaY, Double_t phiY, Double_t thetaZ, 
56                      Double_t phiZ);
57     void  Matrix(Int_t& krot, Float_t thetaX, Float_t phiX, 
58                      Float_t thetaY, Float_t phiY, Float_t thetaZ, 
59                      Float_t phiZ);
60
61     // functions from GBASE 
62     void  Ggclos(); 
63
64     // functions from GCONS 
65     void  Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,  
66                          Float_t &dens, Float_t &radl, Float_t &absl,
67                          Float_t* ubuf, Int_t& nbuf); 
68     void  Gstpar(Int_t itmed, const char *param, Float_t parval); 
69     void  SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
70                          Float_t *absco, Float_t *effic, Float_t *rindex); 
71
72     // functions from GGEOM 
73     Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,  
74                          Double_t *upar, Int_t np); 
75     Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,  
76                          Float_t *upar, Int_t np); 
77     void  Gsdvn(const char *name, const char *mother, Int_t ndiv, 
78                         Int_t iaxis);
79     void  Gsdvn2(const char *name, const char *mother, Int_t ndiv, 
80                          Int_t iaxis, Double_t c0i, Int_t numed); 
81     void  Gsdvn2(const char *name, const char *mother, Int_t ndiv, 
82                          Int_t iaxis, Float_t c0i, Int_t numed); 
83     void  Gsdvt(const char *name, const char *mother, Double_t step,
84                          Int_t iaxis, Int_t numed, Int_t ndvmx); 
85     void  Gsdvt(const char *name, const char *mother, Float_t step,
86                          Int_t iaxis, Int_t numed, Int_t ndvmx); 
87     void  Gsdvt2(const char *name, const char *mother, Double_t step, 
88                          Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx); 
89     void  Gsdvt2(const char *name, const char *mother, Float_t step, 
90                          Int_t iaxis, Float_t c0, Int_t numed, Int_t ndvmx); 
91
92     void  Gsord(const char *name, Int_t iax); 
93     void  Gspos(const char *name, Int_t nr, const char *mother,  
94                         Double_t x, Double_t y, Double_t z, Int_t irot, 
95                         const char *konly); 
96     void  Gspos(const char *name, Int_t nr, const char *mother,  
97                         Float_t x, Float_t y, Float_t z, Int_t irot, 
98                         const char *konly); 
99     void  Gsposp(const char *name, Int_t nr, const char *mother,  
100                          Double_t x, Double_t y, Double_t z, Int_t irot,
101                          const char *konly, Double_t *upar, Int_t np); 
102     void  Gsposp(const char *name, Int_t nr, const char *mother,  
103                          Float_t x, Float_t y, Float_t z, Int_t irot,
104                          const char *konly, Float_t *upar, Int_t np); 
105         
106     // Euclid                  
107     void WriteEuclid(const char* fileName, const char* topVolName, 
108                          Int_t number, Int_t nlevel); //new
109                                
110     // end of methods
111     // 
112
113     //
114     // methods for Geant4 only 
115  
116     G4VPhysicalVolume* CreateG4Geometry();
117     void SetUserLimits(const TG4G3CutVector& cuts,
118                        const TG4G3ControlVector& controls) const;
119     void ReadG3Geometry(G4String filePath);
120     void UseG3TrackingMediaLimits();
121     void ClearG3Tables();       
122     void ClearG3TablesFinal();
123     void OpenOutFile(G4String filePath);
124     void CloseOutFile();
125     
126     // set methods
127     void SetWriteGeometry(G4bool writeGeometry);
128     void SetMapSecond(const G4String& name);
129      
130   protected:
131     TG4GeometryManager(const TG4GeometryManager& right);
132
133     // operators
134     TG4GeometryManager& operator=(const TG4GeometryManager& right);
135
136   private:
137     // methods
138     void FillMediumMap();
139         
140     // static data members
141     static TG4GeometryManager*  fgInstance;     //this instance
142
143     // data members
144     TG4GeometryOutputManager*   fOutputManager;   //output manager 
145     TG4GeometryServices*        fGeometryServices;//geometry services
146     TG4IntMap        fMediumMap;       //map of volumes names to medias IDs
147     TG4NameMap       fNameMap;         //map of volumes names to modules names
148     TG4StringVector  fMaterialNameVector; // vector of material names sorted in the
149                                           // the order of materials in G3Mat
150     TG4StringVector  fMediumNameVector;   // vector of material names sorted in the
151                                           // the order of medias in G3Med
152     G4int            fMediumCounter;   //global medium counter
153     G4int            fMaterialCounter; //global material counter
154     G4int            fMatrixCounter;   //global matrix counter
155     G4bool           fUseG3TMLimits;   //if true: G3 limits are passed to G4 
156                                        //(in development)
157     G4bool           fWriteGeometry;   //if true: geometry parameters are written
158                                        //in a file (ASCII)  
159 };
160
161 // inline methods
162 inline TG4GeometryManager* TG4GeometryManager::Instance()
163 { return fgInstance; }
164
165 #endif //TG4_GEOMETRY_MANAGER_H
166