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