All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TGeant3TGeo.h
Go to the documentation of this file.
1 #ifndef ROOT_TGeant3TGeo
2 #define ROOT_TGeant3TGeo
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 
7 ////////////////////////////////////////////////
8 // C++ interface to Geant3 basic routines //
9 ////////////////////////////////////////////////
10 
11 
13 
14 class TGeoMaterial;
15 
16 //______________________________________________________________
17 //
18 // Geant3 prototypes for commons
19 //
20 //______________________________________________________________
21 //
22 
23 //----------GCVOL1
24 // COMMON/GCVOL1/NLEVL1,NAMES1(15),NUMBR1(15),LVOLU1(15)
25 typedef struct {
26  Int_t nlevl1;
27  Int_t names1[15];
28  Int_t numbr1[15];
29  Int_t lvolu1[15];
30 } Gcvol1_t;
31 
32 
33 class TGeant3TGeo : public TGeant3 {
34 
35 public:
36  TGeant3TGeo();
37  TGeant3TGeo(const char *title, Int_t nwgeant=0);
38  virtual void LoadAddress();
39  virtual ~TGeant3TGeo();
40  virtual Bool_t IsRootGeometrySupported() const {return kTRUE;}
41 
42 
43 ///////////////////////////////////////////////////////////////////////
44 // //
45 // //
46 // Here are the service routines from the geometry //
47 // which could be implemented also in other geometries //
48 // //
49 // //
50 ///////////////////////////////////////////////////////////////////////
51 
52  void GeomIter();
53  Int_t NextVolUp(Text_t *name, Int_t &copy);
54  Int_t CurrentVolID(Int_t &copy) const;
55  Int_t CurrentVolOffID(Int_t off, Int_t &copy) const;
56  const char* CurrentVolName() const;
57  const char *CurrentVolOffName(Int_t off) const;
58  const char *CurrentVolPath();
59  Int_t VolId(const Text_t *name) const;
60  const char* VolName(Int_t id) const;
61  Int_t NofVolumes() const;
62  Int_t NofVolDaughters(const char* volName) const;
63  const char* VolDaughterName(const char* volName, Int_t i) const;
64  Int_t VolDaughterCopyNo(const char* volName, Int_t i) const;
65  Int_t VolId2Mate(Int_t id) const;
66  const char *GetPath();
67  const char *GetNodeName();
68 
69  virtual void Material(Int_t& kmat, const char* name, Double_t a, Double_t z,
70  Double_t dens, Double_t radl, Double_t absl,
71  Float_t* buf=0, Int_t nwbuf=0);
72  virtual void Material(Int_t& kmat, const char* name, Double_t a, Double_t z,
73  Double_t dens, Double_t radl, Double_t absl,
74  Double_t* buf, Int_t nwbuf);
75 
76  virtual void Mixture(Int_t& kmat, const char* name, Float_t* a,Float_t* z,
77  Double_t dens, Int_t nlmat, Float_t* wmat);
78  virtual void Mixture(Int_t& kmat, const char* name, Double_t* a,Double_t* z,
79  Double_t dens, Int_t nlmat, Double_t* wmat);
80 
81  virtual void Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
82  Int_t ifield, Double_t fieldm, Double_t tmaxfd,
83  Double_t stemax, Double_t deemax, Double_t epsil,
84  Double_t stmin, Float_t* ubuf=0, Int_t nbuf=0);
85  virtual void Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
86  Int_t ifield, Double_t fieldm, Double_t tmaxfd,
87  Double_t stemax, Double_t deemax, Double_t epsil,
88  Double_t stmin, Double_t* ubuf, Int_t nbuf);
89 
90  virtual void Matrix(Int_t& krot, Double_t thex, Double_t phix, Double_t they,
91  Double_t phiy, Double_t thez, Double_t phiz);
92 
93  virtual void SetRootGeometry();
94 
95 
96 /////////////////////////////////////////////////////////////////////////////////////////////
97 // //
98 // //
99 // Here are the interface functions with GEANT3.21 //
100 // //
101 // //
102 /////////////////////////////////////////////////////////////////////////////////////////////
103 
104  // access functions to commons
105 
106  virtual Gcvol1_t* Gcvol1() const {return fGcvol1;}
107 
108  // functions from GBASE
109  virtual void Ggclos();
110  virtual void Gprint(const char *name);
111 
112  // functions from GCONS
113  virtual void Gsmate(Int_t imat, const char *name, Float_t a, Float_t z,
114  Float_t dens, Float_t radl, Float_t absl);
115  virtual void Gsmixt(Int_t imat, const char *name, Float_t *a, Float_t *z,
116  Float_t dens, Int_t nlmat, Float_t *wmat);
117  virtual void Gstmed(Int_t numed, const char *name, Int_t nmat, Int_t isvol,
118  Int_t ifield, Float_t fieldm, Float_t tmaxfd,
119  Float_t stemax, Float_t deemax, Float_t epsil,
120  Float_t stmin);
121 
122  // functions from GTRAK
123  virtual void Gtreve();
124  virtual void GtreveRoot();
125 
126  // functions from GGEOM
127  virtual void Gdtom(Float_t *xd, Float_t *xm, Int_t iflag);
128  virtual void Gdtom(Double_t *xd, Double_t *xm, Int_t iflag);
129  virtual void Gmedia(Float_t *x, Int_t &numed);
130  virtual void Gmtod(Float_t *xm, Float_t *xd, Int_t iflag);
131  virtual void Gmtod(Double_t *xm, Double_t *xd, Int_t iflag);
132  virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis);
133  virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed);
134  virtual void Gsdvs(const char *name, const char *mother, Float_t step, Int_t iaxis, Int_t numed);
135  virtual void Gsdvs2(const char *name, const char *mother, Float_t step, Int_t iaxis, Float_t c0, Int_t numed);
136  virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx);
137  virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis,
138  Double_t c0, Int_t numed, Int_t ndvmx);
139  virtual void Gsord(const char *name, Int_t iax);
140  virtual void Gspos(const char *name, Int_t nr, const char *mother,
141  Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly="ONLY");
142  virtual void Gsposp(const char *name, Int_t nr, const char *mother,
143  Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly, Float_t *upar, Int_t np);
144  virtual void Gsposp(const char *name, Int_t nr, const char *mother,
145  Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly, Double_t *upar, Int_t np);
146  virtual void Gsrotm(Int_t nmat, Float_t theta1, Float_t phi1, Float_t theta2, Float_t phi2,
147  Float_t theta3, Float_t phi3);
148  virtual void Gprotm(Int_t nmat=0);
149  virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
150  Float_t *upar, Int_t np);
151  virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
152  Double_t *upar, Int_t np);
153  virtual void Gsatt(const char *name, const char *att, Int_t val);
154  virtual Int_t Glvolu(Int_t nlev, Int_t *lnam,Int_t *lnum);
155 
156  // functions for access to geometry
157  //
158  // Return the Transformation matrix between the volume specified by
159  // the path volumePath and the top or master volume.
160  virtual Bool_t GetTransformation(const TString& volumePath,
161  TGeoHMatrix& matrix);
162 
163  // Return the name of the shape and its parameters for the volume
164  // specified by the volume name.
165  virtual Bool_t GetShape(const TString& volumePath,
166  TString& shapeType, TArrayD& par);
167 
168  // Returns the material parameters for the volume specified by
169  // the volume name.
170  virtual Bool_t GetMaterial(const TString& volumeName,
171  TString& name, Int_t& imat,
172  Double_t& a, Double_t& z, Double_t& density,
173  Double_t& radl, Double_t& inter, TArrayD& par);
174 
175  // Returns the medium parameters for the volume specified by the
176  // volume name.
177  virtual Bool_t GetMedium(const TString& volumeName,
178  TString& name, Int_t& imed,
179  Int_t& nmat, Int_t& isvol, Int_t& ifield,
180  Double_t& fieldm, Double_t& tmaxfd, Double_t& stemax,
181  Double_t& deemax, Double_t& epsil, Double_t& stmin,
182  TArrayD& par);
183 
184  // Returns the current medium (implemented in TGeant3)
185  virtual Int_t GetMedium() const;
186 
187 
188  // functions from GDRAW
189  virtual void Gdshow(Int_t view);
190  virtual void Gdopt(const char *name,const char *value);
191  virtual void Gdraw(const char *name,Double_t theta=30, Double_t phi=30, Double_t psi=0,Double_t u0=10,Double_t v0=10,Double_t ul=0.01,Double_t vl=0.01);
192  virtual void Gdrawc(const char *name,Int_t axis=1, Float_t cut=0,Float_t u0=10,Float_t v0=10,Float_t ul=0.01,Float_t vl=0.01);
193  virtual void Gdrawx(const char *name,Float_t cutthe, Float_t cutphi, Float_t cutval,
194  Float_t theta=30, Float_t phi=30,Float_t u0=10,Float_t v0=10,Float_t ul=0.01,Float_t vl=0.01);
195  virtual void Gdspec(const char *name);
196  virtual void DrawOneSpec(const char *name);
197  virtual void Gdtree(const char *name,Int_t levmax=15,Int_t ispec=0);
198  virtual void GdtreeParent(const char *name,Int_t levmax=15,Int_t ispec=0);
199 
200  // Control Methods
201 
202  virtual void FinishGeometry();
203 
204  //
205  virtual void SetColors();
206 
207 protected:
208  TGeoMCGeometry* fMCGeo; // Implementation of TVirtualMCGeometry for TGeo
209  Bool_t fImportRootGeometry; // Option to import geometry from TGeo
210  // (materials and medias are filled in FinishGeometry()
211  Gcvol1_t *fGcvol1; //! GCVOLU common structure
212 
213 private:
214 
216  TGeant3TGeo & operator=(const TGeant3TGeo&) {return *this;}
217 
218  Int_t ImportMaterial(const TGeoMaterial* material);
219 
220  ClassDef(TGeant3TGeo,1) //C++ interface to Geant basic routines with the TGeo interface
221 };
222 
223 #endif //ROOT_TGeant3TGeo
Gcvol1_t * fGcvol1
Definition: TGeant3TGeo.h:211
double y
Bool_t fImportRootGeometry
Definition: TGeant3TGeo.h:209
double z
TGeant3TGeo & operator=(const TGeant3TGeo &)
Definition: TGeant3TGeo.h:216
virtual Gcvol1_t * Gcvol1() const
Definition: TGeant3TGeo.h:106
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
virtual Bool_t IsRootGeometrySupported() const
Definition: TGeant3TGeo.h:40
T copy(T const &v)
TGeoMCGeometry * fMCGeo
Definition: TGeant3TGeo.h:208
list x
Definition: train.py:276
TGeant3TGeo(const TGeant3TGeo &)
GCVOLU common structure.
Definition: TGeant3TGeo.h:215
Int_t nlevl1
Definition: TGeant3TGeo.h:26