VMC Version 2.0
Loading...
Searching...
No Matches
TGeoMCGeometry.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------
2// Copyright (C) 2019 CERN and copyright holders of VMC Project.
3// This software is distributed under the terms of the GNU General Public
4// License v3 (GPL Version 3), copied verbatim in the file "LICENSE".
5//
6// See https://github.com/vmc-project/vmc for full licensing information.
7// -----------------------------------------------------------------------
8
9// Authors: Alice collaboration 25/06/2002
10
11/*************************************************************************
12 * Copyright (C) 2006, Rene Brun and Fons Rademakers. *
13 * Copyright (C) 2002, ALICE Experiment at CERN. *
14 * All rights reserved. *
15 * *
16 * For the licensing terms see $ROOTSYS/LICENSE. *
17 * For the list of contributors see $ROOTSYS/README/CREDITS. *
18 *************************************************************************/
19
20#ifndef ROOT_TGeoMCGeometry
21#define ROOT_TGeoMCGeometry
22
23//
24// Class TGeoMCGeometry
25// --------------------
26// Implementation of the TVirtualMCGeometry interface
27// for building TGeo geometry.
28//
29
30#include "Rtypes.h"
31#include "TVirtualMCGeometry.h"
32
33class TGeoManager;
34class TGeoHMatrix;
35class TArrayD;
36class TString;
37
39
40public:
41 TGeoMCGeometry(const char *name, const char *title, Bool_t g3CompatibleVolumeNames = false);
43 virtual ~TGeoMCGeometry();
44
45 // detector composition
46 virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl,
47 Double_t absl, Float_t *buf, Int_t nwbuf);
48 virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl,
49 Double_t absl, Double_t *buf, Int_t nwbuf);
50 virtual void Mixture(Int_t &kmat, const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nlmat,
51 Float_t *wmat);
52 virtual void Mixture(Int_t &kmat, const char *name, Double_t *a, Double_t *z, Double_t dens, Int_t nlmat,
53 Double_t *wmat);
54 virtual void Medium(Int_t &kmed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm,
55 Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin, Float_t *ubuf,
56 Int_t nbuf);
57 virtual void Medium(Int_t &kmed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm,
58 Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin,
59 Double_t *ubuf, Int_t nbuf);
60 virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ,
61 Double_t phiZ);
62
63 // functions from GGEOM
64 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t np);
65 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Double_t *upar, Int_t np);
66 virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis);
67 virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed);
68 virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx);
69 virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis, Double_t c0, Int_t numed,
70 Int_t ndvmx);
71 virtual void Gsord(const char *name, Int_t iax);
72 virtual void Gspos(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
73 const char *konly);
74 virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
75 const char *konly, Float_t *upar, Int_t np);
76 virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
77 const char *konly, Double_t *upar, Int_t np);
78 virtual void Gsbool(const char * /*onlyVolName*/, const char * /*manyVolName*/) {}
79
80 // functions for access to geometry
81 //
82 // Return the Transformation matrix between the volume specified by
83 // the path volumePath and the top or master volume.
84 virtual Bool_t GetTransformation(const TString &volumePath, TGeoHMatrix &matrix);
85
86 // Return the name of the shape and its parameters for the volume
87 // specified by the volume name.
88 virtual Bool_t GetShape(const TString &volumePath, TString &shapeType, TArrayD &par);
89
90 // Returns the material parameters for the volume specified by
91 // the volume name.
92 virtual Bool_t GetMaterial(const TString &volumeName, TString &name, Int_t &imat, Double_t &a, Double_t &z,
93 Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par);
94
95 // Returns the medium parameters for the volume specified by the
96 // volume name.
97 virtual Bool_t GetMedium(const TString &volumeName, TString &name, Int_t &imed, Int_t &nmat, Int_t &isvol,
98 Int_t &ifield, Double_t &fieldm, Double_t &tmaxfd, Double_t &stemax, Double_t &deemax,
99 Double_t &epsil, Double_t &stmin, TArrayD &par);
100 // functions for drawing
101 // virtual void DrawOneSpec(const char* name);
102 // virtual void Gsatt(const char* name, const char* att, Int_t val);
103 // virtual void Gdraw(const char*,Double_t theta, Double_t phi,
104 // Double_t psi, Double_t u0, Double_t v0,
105 // Double_t ul, Double_t vl);
106
107 // Euclid
108 // virtual void WriteEuclid(const char*, const char*, Int_t, Int_t);
109
110 // get methods
111 virtual Int_t VolId(const char *volName) const;
112 virtual const char *VolName(Int_t id) const;
113 virtual Int_t MediumId(const char *mediumName) const;
114 virtual Int_t NofVolumes() const;
115 virtual Int_t NofVolDaughters(const char *volName) const;
116 virtual const char *VolDaughterName(const char *volName, Int_t i) const;
117 virtual Int_t VolDaughterCopyNo(const char *volName, Int_t i) const;
118 virtual Int_t VolId2Mate(Int_t id) const;
119
120private:
123
124 TGeoManager *GetTGeoManager() const;
125
126 Double_t *CreateDoubleArray(Float_t *array, Int_t size) const;
127 void Vname(const char *name, char *vname) const;
128
131
133
134 ClassDef(TGeoMCGeometry, 2) // VMC TGeo Geometry builder
135};
136
137#endif
Implementation of the TVirtualMCGeometry interface for building TGeo geometry.
virtual Int_t VolId(const char *volName) const
Return the unique numeric identifier for volume name.
virtual Int_t VolId2Mate(Int_t id) const
Return material number for a given volume id.
virtual void Gsbool(const char *, const char *)
Helper function for resolving MANY.
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 GetShape(const TString &volumePath, TString &shapeType, TArrayD &par)
Returns the shape and its parameters for the volume specified by volumeName.
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 Int_t NofVolumes() const
Return total number of volumes in the geometry.
TGeoMCGeometry & operator=(const TGeoMCGeometry &)
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...
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.
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 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 void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis)
Create a new volume by dividing an existing one.
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.
TGeoMCGeometry(const TGeoMCGeometry &)
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.
static TGeoMCGeometry * fgInstance
Singleton instance.
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 NofVolDaughters(const char *volName) const
Return number of daughters of the volume specified by volName According to A.
void Vname(const char *name, char *vname) const
Convert name to upper case.
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.
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...
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.
Bool_t fG3CompatibleVolumeNames
Option to convert volumes names to be compatible with G3.
TGeoManager * GetTGeoManager() const
Return TGeoManager global pointer.
virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t np)
Create a new volume.
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 const char * VolName(Int_t id) const
Return the volume name given the volume identifier.
virtual Int_t MediumId(const char *mediumName) const
Return the unique numeric identifier for medium name.
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.
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.
virtual ~TGeoMCGeometry()
Destructor.
TGeoMCGeometry()
Default constructor.
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.
Interface to Monte Carlo geometry construction.