Logo ROOT   6.10/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 "Rtypes.h"
24 #include "TVirtualMCGeometry.h"
25 
26 class TGeoManager;
27 class TGeoHMatrix;
28 class TArrayD;
29 class TString;
30 
32 
33 public:
34  TGeoMCGeometry(const char* name, const char* title,
35  Bool_t g3CompatibleVolumeNames = false);
37  virtual ~TGeoMCGeometry();
38 
39  // detector composition
40  virtual void Material(Int_t& kmat, const char* name, Double_t a,
41  Double_t z, Double_t dens, Double_t radl, Double_t absl,
42  Float_t* buf, Int_t nwbuf);
43  virtual void Material(Int_t& kmat, const char* name, Double_t a,
44  Double_t z, Double_t dens, Double_t radl, Double_t absl,
45  Double_t* buf, Int_t nwbuf);
46  virtual void Mixture(Int_t& kmat, const char *name, Float_t *a,
47  Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat);
48  virtual void Mixture(Int_t& kmat, const char *name, Double_t *a,
49  Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat);
50  virtual void Medium(Int_t& kmed, const char *name, Int_t nmat,
51  Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
52  Double_t stemax, Double_t deemax, Double_t epsil,
53  Double_t stmin, Float_t* ubuf, Int_t nbuf);
54  virtual void Medium(Int_t& kmed, const char *name, Int_t nmat,
55  Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd,
56  Double_t stemax, Double_t deemax, Double_t epsil,
57  Double_t stmin, Double_t* ubuf, Int_t nbuf);
58  virtual void Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
59  Double_t thetaY, Double_t phiY, Double_t thetaZ,
60  Double_t phiZ);
61 
62  // functions from GGEOM
63  virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
64  Float_t *upar, Int_t np);
65  virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed,
66  Double_t *upar, Int_t np);
67  virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv,
68  Int_t iaxis);
69  virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv,
70  Int_t iaxis, Double_t c0i, Int_t numed);
71  virtual void Gsdvt(const char *name, const char *mother, Double_t step,
72  Int_t iaxis, Int_t numed, Int_t ndvmx);
73  virtual void Gsdvt2(const char *name, const char *mother, Double_t step,
74  Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx);
75  virtual void Gsord(const char *name, Int_t iax);
76  virtual void Gspos(const char *name, Int_t nr, const char *mother,
77  Double_t x, Double_t y, Double_t z, Int_t irot,
78  const char *konly);
79  virtual void Gsposp(const char *name, Int_t nr, const char *mother,
80  Double_t x, Double_t y, Double_t z, Int_t irot,
81  const char *konly, Float_t *upar, Int_t np);
82  virtual void Gsposp(const char *name, Int_t nr, const char *mother,
83  Double_t x, Double_t y, Double_t z, Int_t irot,
84  const char *konly, Double_t *upar, Int_t np);
85  virtual void Gsbool(const char* /*onlyVolName*/, const char* /*manyVolName*/) {}
86 
87 
88  // functions for access to geometry
89  //
90  // Return the Transformation matrix between the volume specified by
91  // the path volumePath and the top or master volume.
92  virtual Bool_t GetTransformation(const TString& volumePath,
93  TGeoHMatrix& matrix);
94 
95  // Return the name of the shape and its parameters for the volume
96  // specified by the volume name.
97  virtual Bool_t GetShape(const TString& volumePath,
98  TString& shapeType, TArrayD& par);
99 
100  // Returns the material parameters for the volume specified by
101  // the volume name.
102  virtual Bool_t GetMaterial(const TString& volumeName,
103  TString& name, Int_t& imat,
104  Double_t& a, Double_t& z, Double_t& density,
105  Double_t& radl, Double_t& inter, TArrayD& par);
106 
107  // Returns the medium parameters for the volume specified by the
108  // volume name.
109  virtual Bool_t GetMedium(const TString& volumeName,
110  TString& name, Int_t& imed,
111  Int_t& nmat, Int_t& isvol, Int_t& ifield,
112  Double_t& fieldm, Double_t& tmaxfd, Double_t& stemax,
113  Double_t& deemax, Double_t& epsil, Double_t& stmin,
114  TArrayD& par);
115  // functions for drawing
116  //virtual void DrawOneSpec(const char* name);
117  //virtual void Gsatt(const char* name, const char* att, Int_t val);
118  //virtual void Gdraw(const char*,Double_t theta, Double_t phi,
119  // Double_t psi, Double_t u0, Double_t v0,
120  // Double_t ul, Double_t vl);
121 
122  // Euclid
123  //virtual void WriteEuclid(const char*, const char*, Int_t, Int_t);
124 
125  // get methods
126  virtual Int_t VolId(const char* volName) const;
127  virtual const char* VolName(Int_t id) const;
128  virtual Int_t MediumId(const char* mediumName) const;
129  virtual Int_t NofVolumes() const;
130  virtual Int_t NofVolDaughters(const char* volName) const;
131  virtual const char* VolDaughterName(const char* volName, Int_t i) const;
132  virtual Int_t VolDaughterCopyNo(const char* volName, Int_t i) const;
133  virtual Int_t VolId2Mate(Int_t id) const;
134 
135 private:
136  TGeoMCGeometry(const TGeoMCGeometry& /*rhs*/);
137  TGeoMCGeometry& operator=(const TGeoMCGeometry& /*rhs*/);
138 
139  TGeoManager* GetTGeoManager() const;
140 
141  Double_t* CreateDoubleArray(Float_t* array, Int_t size) const;
142  void Vname(const char *name, char *vname) const;
143 
144  /// Option to convert volumes names to be compatible with G3
146 
147  static TGeoMCGeometry* fgInstance; ///< Singleton instance
148 
149  ClassDef(TGeoMCGeometry,2) // VMC TGeo Geometry builder
150 };
151 
152 #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.
The manager class for any TGeo geometry.
Definition: TGeoManager.h:37
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
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)
Define a medium.
void Vname(const char *name, char *vname) const
Convert name to upper case.
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:129
Matrix class used for computing global transformations Should NOT be used for node definition...
Definition: TGeoMatrix.h:408
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Interface to Monte Carlo geometry construction.
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 void Gsbool(const char *, const char *)
Helper function for resolving MANY.
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 VolId2Mate(Int_t id) const
Return material number for a given volume id.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:297
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)
Define a material.
Implementation of the TVirtualMCGeometry interface for building TGeo geometry.
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)
Create a new volume.
virtual void Gsord(const char *name, Int_t iax)
Flag volume name whose contents will have to be ordered along axis iax, by setting the search flag to...
virtual Int_t MediumId(const char *mediumName) const
Return the unique numeric identifier for medium name.
virtual Int_t NofVolDaughters(const char *volName) const
Return number of daughters of the volume specified by volName According to A.
Double_t * CreateDoubleArray(Float_t *array, Int_t size) const
Convert Float_t* array to Double_t*, !! The new array has to be deleted by user.
virtual Int_t NofVolumes() const
Return total number of volumes in the geometry.
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)
Return the transformation matrix between the volume specified by the path volumePath and the Top or m...
TGeoManager * GetTGeoManager() const
Return TGeoManager global pointer.
virtual const char * VolName(Int_t id) const
Return the volume name given the volume identifier.
double Double_t
Definition: RtypesCore.h:55
virtual Int_t VolId(const char *volName) const
Return the unique numeric identifier for volume name.
Double_t y[n]
Definition: legend1.C:17
static TGeoMCGeometry * fgInstance
Singleton instance.
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
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)
Define a mixture or a compound with a number kmat composed by the basic nlmat materials defined by ar...
TGeoMCGeometry & operator=(const TGeoMCGeometry &)
Bool_t fG3CompatibleVolumeNames
Option to convert volumes names to be compatible with G3.
virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ, Double_t phiZ)
Define a rotation matrix.
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...