ROOT  6.06/09
Reference Guide
TGeoMCGeometry.h
Go to the documentation of this file.
1 // @(#)root/vmc:$Id$
2 // Authors: Al;ice collaboration 25/06/2002
3 
4 /*************************************************************************
5  * Copyright (C) 2006, Rene Brun and Fons Rademakers. *
6  * Copyright (C) 2002, ALICE Experiment at CERN. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 #ifndef ROOT_TGeoMCGeometry
14 #define ROOT_TGeoMCGeometry
15 
16 //
17 // Class TGeoMCGeometry
18 // --------------------
19 // Implementation of the TVirtualMCGeometry interface
20 // for building TGeo geometry.
21 //
22 
23 #include "TVirtualMCGeometry.h"
24 
25 class TGeoManager;
26 class TGeoHMatrix;
27 class TArrayD;
28 class TString;
29 
31 
32 public:
33  TGeoMCGeometry(const char* name, const char* title,
34  Bool_t g3CompatibleVolumeNames = false);
36  virtual ~TGeoMCGeometry();
37 
38  // detector composition
39  virtual void Material(Int_t& kmat, const char* name, Double_t a,
40  Double_t z, Double_t dens, Double_t radl, Double_t absl,
41  Float_t* buf, Int_t nwbuf);
42  virtual void Material(Int_t& kmat, const char* name, Double_t a,
43  Double_t z, Double_t dens, Double_t radl, Double_t absl,
44  Double_t* buf, Int_t nwbuf);
45  virtual void Mixture(Int_t& kmat, const char *name, Float_t *a,
46  Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat);
47  virtual void Mixture(Int_t& kmat, const char *name, Double_t *a,
48  Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat);
49  virtual void Medium(Int_t& kmed, const char *name, Int_t nmat,
50  Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
51  Double_t stemax, Double_t deemax, Double_t epsil,
52  Double_t stmin, Float_t* ubuf, Int_t nbuf);
53  virtual void Medium(Int_t& kmed, const char *name, Int_t nmat,
54  Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
55  Double_t stemax, Double_t deemax, Double_t epsil,
56  Double_t stmin, Double_t* ubuf, Int_t nbuf);
57  virtual void Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
58  Double_t thetaY, Double_t phiY, Double_t thetaZ,
59  Double_t phiZ);
60 
61  // functions from GGEOM
62  virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
63  Float_t *upar, Int_t np);
64  virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
65  Double_t *upar, Int_t np);
66  virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv,
67  Int_t iaxis);
68  virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv,
69  Int_t iaxis, Double_t c0i, Int_t numed);
70  virtual void Gsdvt(const char *name, const char *mother, Double_t step,
71  Int_t iaxis, Int_t numed, Int_t ndvmx);
72  virtual void Gsdvt2(const char *name, const char *mother, Double_t step,
73  Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx);
74  virtual void Gsord(const char *name, Int_t iax);
75  virtual void Gspos(const char *name, Int_t nr, const char *mother,
76  Double_t x, Double_t y, Double_t z, Int_t irot,
77  const char *konly);
78  virtual void Gsposp(const char *name, Int_t nr, const char *mother,
79  Double_t x, Double_t y, Double_t z, Int_t irot,
80  const char *konly, Float_t *upar, Int_t np);
81  virtual void Gsposp(const char *name, Int_t nr, const char *mother,
82  Double_t x, Double_t y, Double_t z, Int_t irot,
83  const char *konly, Double_t *upar, Int_t np);
84  virtual void Gsbool(const char* /*onlyVolName*/, const char* /*manyVolName*/) {}
85 
86 
87  // functions for access to geometry
88  //
89  // Return the Transformation matrix between the volume specified by
90  // the path volumePath and the top or master volume.
91  virtual Bool_t GetTransformation(const TString& volumePath,
92  TGeoHMatrix& matrix);
93 
94  // Return the name of the shape and its parameters for the volume
95  // specified by the volume name.
96  virtual Bool_t GetShape(const TString& volumePath,
97  TString& shapeType, TArrayD& par);
98 
99  // Returns the material parameters for the volume specified by
100  // the volume name.
101  virtual Bool_t GetMaterial(const TString& volumeName,
102  TString& name, Int_t& imat,
103  Double_t& a, Double_t& z, Double_t& density,
104  Double_t& radl, Double_t& inter, TArrayD& par);
105 
106  // Returns the medium parameters for the volume specified by the
107  // volume name.
108  virtual Bool_t GetMedium(const TString& volumeName,
109  TString& name, Int_t& imed,
110  Int_t& nmat, Int_t& isvol, Int_t& ifield,
111  Double_t& fieldm, Double_t& tmaxfd, Double_t& stemax,
112  Double_t& deemax, Double_t& epsil, Double_t& stmin,
113  TArrayD& par);
114  // functions for drawing
115  //virtual void DrawOneSpec(const char* name);
116  //virtual void Gsatt(const char* name, const char* att, Int_t val);
117  //virtual void Gdraw(const char*,Double_t theta, Double_t phi,
118  // Double_t psi, Double_t u0, Double_t v0,
119  // Double_t ul, Double_t vl);
120 
121  // Euclid
122  //virtual void WriteEuclid(const char*, const char*, Int_t, Int_t);
123 
124  // get methods
125  virtual Int_t VolId(const char* volName) const;
126  virtual const char* VolName(Int_t id) const;
127  virtual Int_t MediumId(const char* mediumName) const;
128  virtual Int_t NofVolumes() const;
129  virtual Int_t NofVolDaughters(const char* volName) const;
130  virtual const char* VolDaughterName(const char* volName, Int_t i) const;
131  virtual Int_t VolDaughterCopyNo(const char* volName, Int_t i) const;
132  virtual Int_t VolId2Mate(Int_t id) const;
133 
134 private:
135  TGeoMCGeometry(const TGeoMCGeometry& /*rhs*/);
136  TGeoMCGeometry& operator=(const TGeoMCGeometry& /*rhs*/);
137 
138  TGeoManager* GetTGeoManager() const;
139 
140  Double_t* CreateDoubleArray(Float_t* array, Int_t size) const;
141  void Vname(const char *name, char *vname) const;
142 
143  Bool_t fG3CompatibleVolumeNames; // option to convert volumes names to
144  // be compatible with G3
145 
146  static TGeoMCGeometry* fgInstance; // singleton instance
147 
148  ClassDef(TGeoMCGeometry,2) // VMC TGeo Geometry builder
149 };
150 
151 #endif
virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed)
Create a new volume by dividing an existing one.
double par[1]
Definition: unuranDistr.cxx:38
virtual ~TGeoMCGeometry()
Destructor.
virtual Int_t MediumId(const char *mediumName) const
Return the unique numeric identifier for medium name.
virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx)
Create a new volume by dividing an existing one.
virtual Bool_t GetShape(const TString &volumePath, TString &shapeType, TArrayD &par)
Returns the shape and its parameters for the volume specified by volumeName.
float Float_t
Definition: RtypesCore.h:53
void Vname(const char *name, char *vname) const
convert name to upper case.
virtual void Medium(Int_t &kmed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin, Float_t *ubuf, Int_t nbuf)
kmed tracking medium number assigned name tracking medium name nmat material number isvol sensitive v...
virtual void Gspos(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly)
Position a volume into an existing one.
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
virtual Bool_t GetMedium(const TString &volumeName, TString &name, Int_t &imed, Int_t &nmat, Int_t &isvol, Int_t &ifield, Double_t &fieldm, Double_t &tmaxfd, Double_t &stemax, Double_t &deemax, Double_t &epsil, Double_t &stmin, TArrayD &par)
Returns the Medium and its parameters for the volume specified by volumeName.
virtual Bool_t GetMaterial(const TString &volumeName, TString &name, Int_t &imat, Double_t &a, Double_t &z, Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par)
Returns the Material and its parameters for the volume specified by volumeName.
virtual Int_t NofVolDaughters(const char *volName) const
Return number of daughters of the volume specified by volName According to A.
virtual void Gsbool(const char *, const char *)
virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis)
Create a new volume by dividing an existing one.
virtual Int_t NofVolumes() const
Return total number of volumes in the geometry.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl, Double_t absl, Float_t *buf, Int_t nwbuf)
Defines a Material.
virtual Int_t VolId2Mate(Int_t id) const
Return material number for a given volume id.
virtual const char * VolName(Int_t id) const
Return the volume name given the volume identifier.
virtual Int_t VolDaughterCopyNo(const char *volName, Int_t i) const
Return the copyNo of i-th daughters of the volume specified by volName According to A...
virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t np)
NAME Volume name SHAPE Volume type NUMED Tracking medium number NPAR Number of shape parameters UPAR ...
TGeoManager * GetTGeoManager() const
Return TGeoManager global pointer.
virtual void Gsord(const char *name, Int_t iax)
Flags volume CHNAME whose contents will have to be ordered along axis IAX, by setting the search flag...
virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly, Float_t *upar, Int_t np)
Place a copy of generic volume NAME with user number NR inside MOTHER, with its parameters UPAR(1...
virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx)
Create a new volume by dividing an existing one.
virtual Bool_t GetTransformation(const TString &volumePath, TGeoHMatrix &matrix)
Returns the Transformation matrix between the volume specified by the path volumePath and the Top or ...
double Double_t
Definition: RtypesCore.h:55
Double_t y[n]
Definition: legend1.C:17
Double_t * CreateDoubleArray(Float_t *array, Int_t size) const
Converts Float_t* array to Double_t*, !! The new array has to be deleted by user. ...
static TGeoMCGeometry * fgInstance
Array of doubles (64 bits per element).
Definition: TArrayD.h:29
#define name(a, b)
Definition: linkTestLib0.cpp:5
TGeoMCGeometry()
Default constructor.
virtual void Mixture(Int_t &kmat, const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat)
Defines mixture OR COMPOUND IMAT as composed by THE BASIC NLMAT materials defined by arrays A...
TGeoMCGeometry & operator=(const TGeoMCGeometry &)
virtual const char * VolDaughterName(const char *volName, Int_t i) const
Return the name of i-th daughters of the volume specified by volName According to A...
Bool_t fG3CompatibleVolumeNames
virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ, Double_t phiZ)
krot rotation matrix number assigned theta1 polar angle for axis i phi1 azimuthal angle for axis i th...
virtual Int_t VolId(const char *volName) const
Return the unique numeric identifier for volume name.