]>
Commit | Line | Data |
---|---|---|
2817d3e2 | 1 | // $Id$ |
2 | // Category: geometry | |
3 | // | |
e5967ab3 | 4 | // Author: V. Berejnoi, I. Hrivnacova |
5 | // | |
6 | // Class TG4GeometryManager | |
7 | // ------------------------ | |
2817d3e2 | 8 | // Geant4 implementation of the MonteCarlo interface methods |
9a226a21 | 9 | // for building Geant4 geometry and access to it. |
2817d3e2 | 10 | |
11 | #ifndef TG4_GEOMETRY_MANAGER_H | |
12 | #define TG4_GEOMETRY_MANAGER_H | |
13 | ||
14 | #include "TG4NameMap.h" | |
e5967ab3 | 15 | #include "TG4IntMap.h" |
2817d3e2 | 16 | #include "TG4Globals.h" |
2817d3e2 | 17 | |
18 | #include <globals.hh> | |
2817d3e2 | 19 | |
20 | #include <Rtypes.h> | |
21 | ||
2817d3e2 | 22 | |
2817d3e2 | 23 | class TG4GeometryOutputManager; |
154fc5a5 | 24 | class TG4GeometryServices; |
e5967ab3 | 25 | class TG4G3CutVector; |
26 | class TG4G3ControlVector; | |
2817d3e2 | 27 | |
2817d3e2 | 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); | |
2ce4a261 | 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); | |
2817d3e2 | 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 | ||
2817d3e2 | 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); | |
ad390979 | 69 | void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov, |
2817d3e2 | 70 | Float_t *absco, Float_t *effic, Float_t *rindex); |
71 | ||
72 | // functions from GGEOM | |
2ce4a261 | 73 | Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, |
74 | Double_t *upar, Int_t np); | |
2817d3e2 | 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); | |
2ce4a261 | 79 | void Gsdvn2(const char *name, const char *mother, Int_t ndiv, |
80 | Int_t iaxis, Double_t c0i, Int_t numed); | |
2817d3e2 | 81 | void Gsdvn2(const char *name, const char *mother, Int_t ndiv, |
82 | Int_t iaxis, Float_t c0i, Int_t numed); | |
2ce4a261 | 83 | void Gsdvt(const char *name, const char *mother, Double_t step, |
84 | Int_t iaxis, Int_t numed, Int_t ndvmx); | |
2817d3e2 | 85 | void Gsdvt(const char *name, const char *mother, Float_t step, |
86 | Int_t iaxis, Int_t numed, Int_t ndvmx); | |
2ce4a261 | 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); | |
2817d3e2 | 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); | |
2ce4a261 | 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); | |
2817d3e2 | 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); | |
2ce4a261 | 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); | |
2817d3e2 | 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); | |
400f9518 | 105 | void Gsbool(const char* onlyVolName, const char* manyVolName); |
2817d3e2 | 106 | |
107 | // Euclid | |
57f88f6f | 108 | void WriteEuclid(const char* fileName, const char* topVolName, |
109 | Int_t number, Int_t nlevel); //new | |
2817d3e2 | 110 | |
2817d3e2 | 111 | // end of methods |
112 | // | |
113 | ||
114 | // | |
115 | // methods for Geant4 only | |
116 | ||
117 | G4VPhysicalVolume* CreateG4Geometry(); | |
e5967ab3 | 118 | void SetUserLimits(const TG4G3CutVector& cuts, |
119 | const TG4G3ControlVector& controls) const; | |
2817d3e2 | 120 | void ReadG3Geometry(G4String filePath); |
121 | void UseG3TrackingMediaLimits(); | |
122 | void ClearG3Tables(); | |
123 | void ClearG3TablesFinal(); | |
124 | void OpenOutFile(G4String filePath); | |
73b4b945 | 125 | void CloseOutFile(); |
2817d3e2 | 126 | |
127 | // set methods | |
128 | void SetWriteGeometry(G4bool writeGeometry); | |
129 | void SetMapSecond(const G4String& name); | |
154fc5a5 | 130 | |
2817d3e2 | 131 | protected: |
132 | TG4GeometryManager(const TG4GeometryManager& right); | |
133 | ||
134 | // operators | |
135 | TG4GeometryManager& operator=(const TG4GeometryManager& right); | |
136 | ||
137 | private: | |
138 | // methods | |
e5967ab3 | 139 | void FillMediumMap(); |
2817d3e2 | 140 | |
141 | // static data members | |
142 | static TG4GeometryManager* fgInstance; //this instance | |
143 | ||
144 | // data members | |
154fc5a5 | 145 | TG4GeometryOutputManager* fOutputManager; //output manager |
146 | TG4GeometryServices* fGeometryServices;//geometry services | |
e5967ab3 | 147 | TG4IntMap fMediumMap; //map of volumes names to medias IDs |
148 | TG4NameMap fNameMap; //map of volumes names to modules names | |
149 | TG4StringVector fMaterialNameVector; // vector of material names sorted in the | |
150 | // the order of materials in G3Mat | |
151 | TG4StringVector fMediumNameVector; // vector of material names sorted in the | |
152 | // the order of medias in G3Med | |
153 | G4int fMediumCounter; //global medium counter | |
154 | G4int fMaterialCounter; //global material counter | |
155 | G4int fMatrixCounter; //global matrix counter | |
156 | G4bool fUseG3TMLimits; //if true: G3 limits are passed to G4 | |
157 | //(in development) | |
158 | G4bool fWriteGeometry; //if true: geometry parameters are written | |
159 | //in a file (ASCII) | |
2817d3e2 | 160 | }; |
161 | ||
162 | // inline methods | |
163 | inline TG4GeometryManager* TG4GeometryManager::Instance() | |
164 | { return fgInstance; } | |
165 | ||
2817d3e2 | 166 | #endif //TG4_GEOMETRY_MANAGER_H |
167 |