4 // Author: V. Berejnoi, I. Hrivnacova
6 // Class TG4GeometryManager
7 // ------------------------
8 // Geant4 implementation of the MonteCarlo interface methods
9 // for building Geant4 geometry and access to it.
11 #ifndef TG4_GEOMETRY_MANAGER_H
12 #define TG4_GEOMETRY_MANAGER_H
14 #include "TG4NameMap.h"
15 #include "TG4IntMap.h"
16 #include "TG4Globals.h"
23 class TG4GeometryOutputManager;
24 class TG4GeometryServices;
26 class TG4G3ControlVector;
28 class G4VPhysicalVolume;
30 class TG4GeometryManager
35 // TG4GeometryManager(const TG4GeometryManager& right);
36 virtual ~TG4GeometryManager();
38 // static access method
39 static TG4GeometryManager* Instance();
42 // methods (from the base class)
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,
57 void Matrix(Int_t& krot, Float_t thetaX, Float_t phiX,
58 Float_t thetaY, Float_t phiY, Float_t thetaZ,
61 // functions from GBASE
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);
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,
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);
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,
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,
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);
107 void WriteEuclid(const char* fileName, const char* topVolName,
108 Int_t number, Int_t nlevel); //new
114 // methods for Geant4 only
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);
127 void SetWriteGeometry(G4bool writeGeometry);
128 void SetMapSecond(const G4String& name);
131 TG4GeometryManager(const TG4GeometryManager& right);
134 TG4GeometryManager& operator=(const TG4GeometryManager& right);
138 void FillMediumMap();
140 // static data members
141 static TG4GeometryManager* fgInstance; //this instance
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
157 G4bool fWriteGeometry; //if true: geometry parameters are written
162 inline TG4GeometryManager* TG4GeometryManager::Instance()
163 { return fgInstance; }
165 #endif //TG4_GEOMETRY_MANAGER_H