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