28const int RootGM::Polyhedra::fgkMaxNofZPlanes = 50;
29double* RootGM::Polyhedra::fgZBuffer = 0;
30double* RootGM::Polyhedra::fgRinBuffer = 0;
31double* RootGM::Polyhedra::fgRoutBuffer = 0;
35 int nofSides,
int nofZPlanes,
double* z,
double* rin,
double* rout)
36 :
VGM::ISolid(),
VGM::IPolyhedra(),
BaseVGM::VPolyhedra(), fPolyhedra(0)
49 double* param =
new double[4 + 3 * nofZPlanes];
55 param[3] = nofZPlanes;
57 for (
int i = 0; i < nofZPlanes; i++) {
64 fPolyhedra =
new TGeoPgon(param);
65 fPolyhedra->SetName(name.data());
95 :
VGM::ISolid(rhs),
VGM::IPolyhedra(rhs),
BaseVGM::VPolyhedra(rhs)
107void RootGM::Polyhedra::CreateBuffers()
109 if (!fgZBuffer) fgZBuffer =
new double[fgkMaxNofZPlanes];
110 if (!fgRinBuffer) fgRinBuffer =
new double[fgkMaxNofZPlanes];
111 if (!fgRoutBuffer) fgRoutBuffer =
new double[fgkMaxNofZPlanes];
138 int nofZPlanes = NofZPlanes();
139 if (nofZPlanes > fgkMaxNofZPlanes) {
140 nofZPlanes = fgkMaxNofZPlanes;
141 std::cerr <<
"+++ Warning +++" << std::endl;
142 std::cerr <<
" Number of Zplanes > size of buffer." << std::endl;
143 std::cerr <<
" only " << nofZPlanes <<
" values are returned."
147 for (
int i = 0; i < nofZPlanes; i++)
156 int nofZPlanes = NofZPlanes();
157 if (nofZPlanes > fgkMaxNofZPlanes) {
158 nofZPlanes = fgkMaxNofZPlanes;
159 std::cerr <<
"+++ Warning +++" << std::endl;
160 std::cerr <<
" Number of Zplanes > size of buffer." << std::endl;
161 std::cerr <<
" only " << nofZPlanes <<
" values are returned."
165 for (
int i = 0; i < nofZPlanes; i++)
174 int nofZPlanes = NofZPlanes();
175 if (nofZPlanes > fgkMaxNofZPlanes) {
176 nofZPlanes = fgkMaxNofZPlanes;
177 std::cerr <<
"+++ Warning +++" << std::endl;
178 std::cerr <<
" Number of Zplanes > size of buffer." << std::endl;
179 std::cerr <<
" only " << nofZPlanes <<
" values are returned."
183 for (
int i = 0; i < nofZPlanes; i++)
VGM implementation for Root polyhedra solid.
virtual double * InnerRadiusValues() const
Return the array of innner radius of the planes in mm.
virtual int NofZPlanes() const
Return number of planes perpendicular to the z axis.
virtual double * ZValues() const
Return the array of z positions of the planes in mm.
virtual double * OuterRadiusValues() const
Return the array of outer radius of the planes in mm.
virtual double StartPhi() const
Return starting phi angle of the segment in deg.
virtual int NofSides() const
Return number of sides of the cross section between the given phi limits.
virtual double DeltaPhi() const
Return opening phi angle of the segment in deg.
virtual std::string Name() const
Return the name of this solid.
void AddSolid(VGM::ISolid *, TGeoShape *)
static SolidMap * Instance()
static double Length()
Return Root length unit in VGM units.
static double Angle()
Return Root angle unit in VGM units.