Logo ROOT  
Reference Guide
TGeoHype.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Mihaela Gheata 20/11/04
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12
13#include <iostream>
14
15#include "TGeoManager.h"
16#include "TGeoVolume.h"
17#include "TVirtualGeoPainter.h"
18#include "TGeoHype.h"
19#include "TBuffer3D.h"
20#include "TBuffer3DTypes.h"
21#include "TMath.h"
22
23/** \class TGeoHype
24\ingroup Shapes_classes
25
26A hyperboloid is represented as a solid limited by two planes
27perpendicular to the Z axis (top and bottom planes) and two hyperbolic
28surfaces of revolution about Z axis (inner and outer surfaces). The
29class describing hyperboloids is TGeoHype has 5 input parameters:
30
31~~~ {.cpp}
32TGeoHype(Double_t rin,Double_t stin,Double_t rout,
33Double_t stout,Double_t dz);
34~~~
35
36Begin_Macro
37{
38 TCanvas *c = new TCanvas("c", "c",0,0,600,600);
39 new TGeoManager("hype", "hyperboloid");
40 TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
41 TGeoMedium *med = new TGeoMedium("MED",1,mat);
42 TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
43 gGeoManager->SetTopVolume(top);
44 TGeoVolume *vol = gGeoManager->MakeHype("HYPE",med,10, 45 ,20,45,40);
45 TGeoHype *hype = (TGeoHype*)vol->GetShape();
46 top->AddNode(vol,1);
47 gGeoManager->CloseGeometry();
48 gGeoManager->SetNsegments(80);
49 top->Draw();
50 TView *view = gPad->GetView();
51 view->ShowAxis();
52}
53End_Macro
54
55The hyperbolic surface equation is taken in the form:
56
57~~~{.cpp}
58r2 - z2tan2() = r2min
59~~~
60
61- `r,z:` cylindrical coordinates for a point on the surface
62- `:` stereo angle between the hyperbola asymptotic lines and Z axis
63- `r2min:` minimum distance between hyperbola and Z axis (at `z=0`)
64
65The input parameters represent:
66
67- `rin, stin:` minimum radius and tangent of stereo angle for inner
68 surface
69- `rout, stout:` minimum radius and tangent of stereo angle for outer
70 surface
71- `dz:` half length in Z (bounding planes positions at `+/-dz`)
72
73The following conditions are mandatory in order to avoid intersections
74between the inner and outer hyperbolic surfaces in the range `+/-dz`:
75
76- `rin<rout`
77- `rout>0`
78- `rin2 + dz2*stin2 > rout2 + dz2*stout2`
79
80Particular cases:
81
82- `rin=0, stin0:` the inner surface is conical
83- `stin=0 / stout=0:` cylindrical surface(s)
84
85*/
86
88
89////////////////////////////////////////////////////////////////////////////////
90/// Default constructor
91
93{
95 fStIn = 0.;
96 fStOut = 0.;
97 fTin = 0.;
98 fTinsq = 0.;
99 fTout = 0.;
100 fToutsq = 0.;
101}
102
103
104////////////////////////////////////////////////////////////////////////////////
105/// Constructor specifying hyperboloid parameters.
106
108 :TGeoTube(rin, rout, dz)
109{
111 SetHypeDimensions(rin, stin, rout, stout, dz);
112 // dz<0 can be used to force dz of hyperboloid fit the container volume
114 ComputeBBox();
115}
116////////////////////////////////////////////////////////////////////////////////
117/// Constructor specifying parameters and name.
118
119TGeoHype::TGeoHype(const char *name,Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
120 :TGeoTube(name, rin, rout, dz)
121{
123 SetHypeDimensions(rin, stin, rout, stout, dz);
124 // dz<0 can be used to force dz of hyperboloid fit the container volume
126 ComputeBBox();
127}
128
129////////////////////////////////////////////////////////////////////////////////
130/// Default constructor specifying a list of parameters
131/// - param[0] = dz
132/// - param[1] = rin
133/// - param[2] = stin
134/// - param[3] = rout
135/// - param[4] = stout
136
138 :TGeoTube(param[1],param[3],param[0])
139{
141 SetDimensions(param);
142 // dz<0 can be used to force dz of hyperboloid fit the container volume
144 ComputeBBox();
145}
146
147////////////////////////////////////////////////////////////////////////////////
148/// destructor
149
151{
152}
153
154////////////////////////////////////////////////////////////////////////////////
155/// Computes capacity of the shape in [length^3]
156
158{
159 Double_t capacity = 2.*TMath::Pi()*fDz*(fRmax*fRmax-fRmin*fRmin) +
160 (2.*TMath::Pi()/3.)*fDz*fDz*fDz*(fToutsq-fTinsq);
161 return capacity;
162}
163
164////////////////////////////////////////////////////////////////////////////////
165/// Compute bounding box of the hyperboloid
166
168{
169 if (fRmin<0.) {
170 Warning("ComputeBBox", "Shape %s has invalid rmin=%g ! SET TO 0.", GetName(),fRmin);
171 fRmin = 0.;
172 }
175 Error("ComputeBBox", "Shape %s hyperbolic surfaces are malformed: rin=%g, stin=%g, rout=%g, stout=%g",
177 return;
178 }
179
181 fDZ = fDz;
182}
183
184////////////////////////////////////////////////////////////////////////////////
185/// Compute normal to closest surface from POINT.
186
187void TGeoHype::ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
188{
189 Double_t saf[3];
190 Double_t rsq = point[0]*point[0]+point[1]*point[1];
191 Double_t r = TMath::Sqrt(rsq);
192 Double_t rin = (HasInner())?(TMath::Sqrt(RadiusHypeSq(point[2],kTRUE))):0.;
193 Double_t rout = TMath::Sqrt(RadiusHypeSq(point[2],kFALSE));
194 saf[0] = TMath::Abs(fDz-TMath::Abs(point[2]));
195 saf[1] = (HasInner())?TMath::Abs(rin-r):TGeoShape::Big();
196 saf[2] = TMath::Abs(rout-r);
197 Int_t i = TMath::LocMin(3,saf);
198 if (i==0 || r<1.E-10) {
199 norm[0] = norm[1] = 0.;
200 norm[2] = TMath::Sign(1.,dir[2]);
201 return;
202 }
203 Double_t t = (i==1)?fTinsq:fToutsq;;
204 t *= -point[2]/r;
205 Double_t ct = TMath::Sqrt(1./(1.+t*t));
206 Double_t st = t * ct;
207 Double_t phi = TMath::ATan2(point[1], point[0]);
208 Double_t cphi = TMath::Cos(phi);
209 Double_t sphi = TMath::Sin(phi);
210
211 norm[0] = ct*cphi;
212 norm[1] = ct*sphi;
213 norm[2] = st;
214 if (norm[0]*dir[0]+norm[1]*dir[1]+norm[2]*dir[2]<0) {
215 norm[0] = -norm[0];
216 norm[1] = -norm[1];
217 norm[2] = -norm[2];
218 }
219}
220
221////////////////////////////////////////////////////////////////////////////////
222/// test if point is inside this tube
223
225{
226 if (TMath::Abs(point[2]) > fDz) return kFALSE;
227 Double_t r2 = point[0]*point[0]+point[1]*point[1];
228 Double_t routsq = RadiusHypeSq(point[2], kFALSE);
229 if (r2>routsq) return kFALSE;
230 if (!HasInner()) return kTRUE;
231 Double_t rinsq = RadiusHypeSq(point[2], kTRUE);
232 if (r2<rinsq) return kFALSE;
233 return kTRUE;
234}
235
236////////////////////////////////////////////////////////////////////////////////
237/// compute closest distance from point px,py to each corner
238
240{
241 Int_t numPoints = GetNmeshVertices();
242 return ShapeDistancetoPrimitive(numPoints, px, py);
243}
244
245////////////////////////////////////////////////////////////////////////////////
246/// Compute distance from inside point to surface of the hyperboloid.
247
248Double_t TGeoHype::DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact, Double_t step, Double_t *safe) const
249{
250 if (iact<3 && safe) {
251 *safe = Safety(point, kTRUE);
252 if (iact==0) return TGeoShape::Big();
253 if ((iact==1) && (*safe>step)) return TGeoShape::Big();
254 }
255 // compute distance to surface
256 // Do Z
258 if (dir[2]>0) {
259 sz = (fDz-point[2])/dir[2];
260 if (sz<=0.) return 0.;
261 } else {
262 if (dir[2]<0) {
263 sz = -(fDz+point[2])/dir[2];
264 if (sz<=0.) return 0.;
265 }
266 }
267
268
269 // Do R
270 Double_t srin = TGeoShape::Big();
271 Double_t srout = TGeoShape::Big();
272 Double_t sr;
273 // inner and outer surfaces
274 Double_t s[2];
275 Int_t npos;
276 npos = DistToHype(point, dir, s, kTRUE, kTRUE);
277 if (npos) srin = s[0];
278 npos = DistToHype(point, dir, s, kFALSE, kTRUE);
279 if (npos) srout = s[0];
280 sr = TMath::Min(srin, srout);
281 return TMath::Min(sz,sr);
282}
283
284
285////////////////////////////////////////////////////////////////////////////////
286/// compute distance from outside point to surface of the hyperboloid.
287
288Double_t TGeoHype::DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact, Double_t step, Double_t *safe) const
289{
290 if (iact<3 && safe) {
291 *safe = Safety(point, kFALSE);
292 if (iact==0) return TGeoShape::Big();
293 if ((iact==1) && (step<=*safe)) return TGeoShape::Big();
294 }
295// Check if the bounding box is crossed within the requested distance
296 Double_t sdist = TGeoBBox::DistFromOutside(point,dir, fDX, fDY, fDZ, fOrigin, step);
297 if (sdist>=step) return TGeoShape::Big();
298 // find distance to shape
299 // Do Z
300 Double_t xi, yi, zi;
301 if (TMath::Abs(point[2])>=fDz) {
302 // We might find Z plane crossing
303 if ((point[2]*dir[2]) < 0) {
304 // Compute distance to Z (always positive)
305 Double_t sz = (TMath::Abs(point[2])-fDz)/TMath::Abs(dir[2]);
306 // Extrapolate
307 xi = point[0]+sz*dir[0];
308 yi = point[1]+sz*dir[1];
309 Double_t r2 = xi*xi + yi*yi;
310 Double_t rmin2 = RadiusHypeSq(fDz, kTRUE);
311 if (r2 >= rmin2) {
313 if (r2 <= rmax2) return sz;
314 }
315 }
316 }
317 // We do not cross Z planes.
319 Double_t sout = TGeoShape::Big();
320 Double_t s[2];
321 Int_t npos;
322 npos = DistToHype(point, dir, s, kTRUE, kFALSE);
323 if (npos) {
324 zi = point[2] + s[0]*dir[2];
325 if (TMath::Abs(zi) <= fDz) sin = s[0];
326 else if (npos==2) {
327 zi = point[2] + s[1]*dir[2];
328 if (TMath::Abs(zi) <= fDz) sin = s[1];
329 }
330 }
331 npos = DistToHype(point, dir, s, kFALSE, kFALSE);
332 if (npos) {
333 zi = point[2] + s[0]*dir[2];
334 if (TMath::Abs(zi) <= fDz) sout = s[0];
335 else if (npos==2) {
336 zi = point[2] + s[1]*dir[2];
337 if (TMath::Abs(zi) <= fDz) sout = s[1];
338 }
339 }
340 return TMath::Min(sin, sout);
341}
342
343////////////////////////////////////////////////////////////////////////////////
344/// Compute distance from an arbitrary point to inner/outer surface of hyperboloid.
345/// Returns number of positive solutions. S[2] contains the solutions.
346
347Int_t TGeoHype::DistToHype(const Double_t *point, const Double_t *dir, Double_t *s, Bool_t inner, Bool_t in) const
348{
349 Double_t r0, t0, snext;
350 if (inner) {
351 if (!HasInner()) return 0;
352 r0 = fRmin;
353 t0 = fTinsq;
354 } else {
355 r0 = fRmax;
356 t0 = fToutsq;
357 }
358 Double_t a = dir[0]*dir[0] + dir[1]*dir[1] - t0*dir[2]*dir[2];
359 Double_t b = t0*point[2]*dir[2] - point[0]*dir[0] - point[1]*dir[1];
360 Double_t c = point[0]*point[0] + point[1]*point[1] - t0*point[2]*point[2] - r0*r0;
361
363 if (TMath::Abs(b) < TGeoShape::Tolerance()) return 0;
364 snext = 0.5*c/b;
365 if (snext < 0.) return 0;
366 s[0] = snext;
367 return 1;
368 }
369
370 Double_t delta = b*b - a*c;
371 Double_t ainv = 1./a;
372 Int_t npos = 0;
373 if (delta < 0.) return 0;
374 delta = TMath::Sqrt(delta);
375 Double_t sone = TMath::Sign(1.,ainv);
376 Int_t i = -1;
377 while (i<2) {
378 snext = (b + i*sone*delta)*ainv;
379 i += 2;
380 if (snext<0) continue;
381 if (snext<1.E-8) {
382 Double_t r = TMath::Sqrt(point[0]*point[0]+point[1]*point[1]);
383 Double_t t = (inner)?fTinsq:fToutsq;
384 t *= -point[2]/r;
385 Double_t phi = TMath::ATan2(point[1], point[0]);
386 Double_t ndotd = TMath::Cos(phi)*dir[0]+TMath::Sin(phi)*dir[1]+t*dir[2];
387 if (inner) ndotd *= -1;
388 if (in) ndotd *= -1;
389 if (ndotd<0) s[npos++] = snext;
390 } else s[npos++] = snext;
391 }
392 return npos;
393}
394
395////////////////////////////////////////////////////////////////////////////////
396/// Cannot divide hyperboloids.
397
398TGeoVolume *TGeoHype::Divide(TGeoVolume * /*voldiv*/, const char *divname, Int_t /*iaxis*/, Int_t /*ndiv*/,
399 Double_t /*start*/, Double_t /*step*/)
400{
401 Error("Divide", "Hyperboloids cannot be divided. Division volume %s not created", divname);
402 return 0;
403}
404
405////////////////////////////////////////////////////////////////////////////////
406/// Get range of shape for a given axis.
407
409{
410 xlo = 0;
411 xhi = 0;
412 Double_t dx = 0;
413 switch (iaxis) {
414 case 1: // R
415 xlo = fRmin;
417 dx = xhi-xlo;
418 return dx;
419 case 2: // Phi
420 xlo = 0;
421 xhi = 360;
422 dx = 360;
423 return dx;
424 case 3: // Z
425 xlo = -fDz;
426 xhi = fDz;
427 dx = xhi-xlo;
428 return dx;
429 }
430 return dx;
431}
432
433////////////////////////////////////////////////////////////////////////////////
434/// Fill vector param[4] with the bounding cylinder parameters. The order
435/// is the following : Rmin, Rmax, Phi1, Phi2, dZ
436
438{
439 param[0] = fRmin; // Rmin
440 param[0] *= param[0];
441 param[1] = TMath::Sqrt(RadiusHypeSq(fDz, kFALSE)); // Rmax
442 param[1] *= param[1];
443 param[2] = 0.; // Phi1
444 param[3] = 360.; // Phi2
445}
446
447////////////////////////////////////////////////////////////////////////////////
448/// in case shape has some negative parameters, these has to be computed
449/// in order to fit the mother
450
452{
453 if (!TestShapeBit(kGeoRunTimeShape)) return nullptr;
454 Double_t dz = fDz;
455 Double_t zmin,zmax;
456 if (fDz < 0) {
457 mother->GetAxisRange(3,zmin,zmax);
458 if (zmax<0) return nullptr;
459 dz = zmax;
460 } else {
461 Error("GetMakeRuntimeShape", "Shape %s does not have negative Z range", GetName());
462 return nullptr;
463 }
464 TGeoShape *hype = new TGeoHype(GetName(), dz, fRmax, fStOut, fRmin, fStIn);
465 return hype;
466}
467
468////////////////////////////////////////////////////////////////////////////////
469/// print shape parameters
470
472{
473 printf("*** Shape %s: TGeoHype ***\n", GetName());
474 printf(" Rin = %11.5f\n", fRmin);
475 printf(" sin = %11.5f\n", fStIn);
476 printf(" Rout = %11.5f\n", fRmax);
477 printf(" sout = %11.5f\n", fStOut);
478 printf(" dz = %11.5f\n", fDz);
479
480 printf(" Bounding box:\n");
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Creates a TBuffer3D describing *this* shape.
486/// Coordinates are in local reference frame.
487
489{
491 Bool_t hasRmin = HasInner();
492 Int_t nbPnts = (hasRmin)?(2*n*n):(n*n+2);
493 Int_t nbSegs = (hasRmin)?(4*n*n):(n*(2*n+1));
494 Int_t nbPols = (hasRmin)?(2*n*n):(n*(n+1));
495
497 nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols);
498 if (buff)
499 {
500 SetPoints(buff->fPnts);
501 SetSegsAndPols(*buff);
502 }
503
504 return buff;
505}
506
507////////////////////////////////////////////////////////////////////////////////
508/// Fill TBuffer3D structure for segments and polygons.
509
511{
513 Int_t i, j, n;
515 Bool_t hasRmin = HasInner();
516 Int_t irin = 0;
517 Int_t irout = (hasRmin)?(n*n):2;
518 // Fill segments
519 // Case hasRmin:
520 // Inner circles: [isin = 0], n (per circle) * n ( circles)
521 // iseg = isin+n*i+j , i = 0, n-1 , j = 0, n-1
522 // seg(i=1,n; j=1,n) = [irin+n*i+j] and [irin+n*i+(j+1)%n]
523 // Inner generators: [isgenin = isin+n*n], n (per circle) *(n-1) (slices)
524 // iseg = isgenin + i*n + j, i=0,n-2, j=0,n-1
525 // seg(i,j) = [irin+n*i+j] and [irin+n*(i+1)+j]
526 // Outer circles: [isout = isgenin+n*(n-1)], n (per circle) * n ( circles)
527 // iseg = isout + i*n + j , iz = 0, n-1 , j = 0, n-1
528 // seg(i=1,n; j=1,n) = [irout+n*i+j] and [irout+n*i+(j+1)%n]
529 // Outer generators: [isgenout = isout+n*n], n (per circle) *(n-1) (slices)
530 // iseg = isgenout + i*n + j, i=0,n-2, j=0,n-1
531 // seg(i,j) = [irout+n*i+j] and [irout+n*(i+1)+j]
532 // Lower cap : [islow = isgenout + n*(n-1)], n radial segments
533 // iseg = islow + j, j=0,n-1
534 // seg(j) = [irin + j] and [irout+j]
535 // Upper cap: [ishi = islow + n], nradial segments
536 // iseg = ishi + j, j=0,n-1
537 // seg[j] = [irin + n*(n-1) + j] and [irout+n*(n-1) + j]
538 //
539 // Case !hasRmin:
540 // Outer circles: [isout=0], same outer circles (n*n)
541 // Outer generators: isgenout = isout + n*n
542 // Lower cap: [islow = isgenout+n*(n-1)], n seg.
543 // iseg = islow + j, j=0,n-1
544 // seg[j] = [irin] and [irout+j]
545 // Upper cap: [ishi = islow +n]
546 // iseg = ishi + j, j=0,n-1
547 // seg[j] = [irin+1] and [irout+n*(n-1) + j]
548
549 Int_t isin = 0;
550 Int_t isgenin = (hasRmin)?(isin+n*n):0;
551 Int_t isout = (hasRmin)?(isgenin+n*(n-1)):0;
552 Int_t isgenout = isout+n*n;
553 Int_t islo = isgenout+n*(n-1);
554 Int_t ishi = islo + n;
555
556 Int_t npt = 0;
557 // Fill inner circle segments (n*n)
558 if (hasRmin) {
559 for (i=0; i<n; i++) {
560 for (j=0; j<n; j++) {
561 npt = 3*(isin+n*i+j);
562 buff.fSegs[npt] = c;
563 buff.fSegs[npt+1] = irin+n*i+j;
564 buff.fSegs[npt+2] = irin+n*i+((j+1)%n);
565 }
566 }
567 // Fill inner generators (n*(n-1))
568 for (i=0; i<n-1; i++) {
569 for (j=0; j<n; j++) {
570 npt = 3*(isgenin+n*i+j);
571 buff.fSegs[npt] = c;
572 buff.fSegs[npt+1] = irin+n*i+j;
573 buff.fSegs[npt+2] = irin+n*(i+1)+j;
574 }
575 }
576 }
577 // Fill outer circle segments (n*n)
578 for (i=0; i<n; i++) {
579 for (j=0; j<n; j++) {
580 npt = 3*(isout + n*i+j);
581 buff.fSegs[npt] = c;
582 buff.fSegs[npt+1] = irout+n*i+j;
583 buff.fSegs[npt+2] = irout+n*i+((j+1)%n);
584 }
585 }
586 // Fill outer generators (n*(n-1))
587 for (i=0; i<n-1; i++) {
588 for (j=0; j<n; j++) {
589 npt = 3*(isgenout+n*i+j);
590 buff.fSegs[npt] = c;
591 buff.fSegs[npt+1] = irout+n*i+j;
592 buff.fSegs[npt+2] = irout+n*(i+1)+j;
593 }
594 }
595 // Fill lower cap (n)
596 for (j=0; j<n; j++) {
597 npt = 3*(islo+j);
598 buff.fSegs[npt] = c;
599 buff.fSegs[npt+1] = irin;
600 if (hasRmin) buff.fSegs[npt+1] += j;
601 buff.fSegs[npt+2] = irout + j;
602 }
603 // Fill upper cap (n)
604 for (j=0; j<n; j++) {
605 npt = 3*(ishi+j);
606 buff.fSegs[npt] = c;
607 buff.fSegs[npt+1] = irin+1;
608 if (hasRmin) buff.fSegs[npt+1] += n*(n-1)+j-1;
609 buff.fSegs[npt+2] = irout + n*(n-1)+j;
610 }
611
612 // Fill polygons
613 // Inner polygons: [ipin = 0] (n-1) slices * n (edges)
614 // ipoly = ipin + n*i + j; i=0,n-2 j=0,n-1
615 // poly[i,j] = [isin+n*i+j] [isgenin+i*n+(j+1)%n] [isin+n*(i+1)+j] [isgenin+i*n+j]
616 // Outer polygons: [ipout = ipin+n*(n-1)] also (n-1)*n
617 // ipoly = ipout + n*i + j; i=0,n-2 j=0,n-1
618 // poly[i,j] = [isout+n*i+j] [isgenout+i*n+j] [isout+n*(i+1)+j] [isgenout+i*n+(j+1)%n]
619 // Lower cap: [iplow = ipout+n*(n-1): n polygons
620 // ipoly = iplow + j; j=0,n-1
621 // poly[i=0,j] = [isin+j] [islow+j] [isout+j] [islow+(j+1)%n]
622 // Upper cap: [ipup = iplow+n] : n polygons
623 // ipoly = ipup + j; j=0,n-1
624 // poly[i=n-1, j] = [isin+n*(n-1)+j] [ishi+(j+1)%n] [isout+n*(n-1)+j] [ishi+j]
625 //
626 // Case !hasRmin:
627 // ipin = 0 no inner polygons
628 // ipout = 0 same outer polygons
629 // Lower cap: iplow = ipout+n*(n-1): n polygons with 3 segments
630 // poly[i=0,j] = [isout+j] [islow+(j+1)%n] [islow+j]
631 // Upper cap: ipup = iplow+n;
632 // poly[i=n-1,j] = [isout+n*(n-1)+j] [ishi+j] [ishi+(j+1)%n]
633
634 Int_t ipin = 0;
635 Int_t ipout = (hasRmin)?(ipin+n*(n-1)):0;
636 Int_t iplo = ipout+n*(n-1);
637 Int_t ipup = iplo+n;
638 // Inner polygons n*(n-1)
639 if (hasRmin) {
640 for (i=0; i<n-1; i++) {
641 for (j=0; j<n; j++) {
642 npt = 6*(ipin+n*i+j);
643 buff.fPols[npt] = c;
644 buff.fPols[npt+1] = 4;
645 buff.fPols[npt+2] = isin+n*i+j;
646 buff.fPols[npt+3] = isgenin+i*n+((j+1)%n);
647 buff.fPols[npt+4] = isin+n*(i+1)+j;
648 buff.fPols[npt+5] = isgenin+i*n+j;
649 }
650 }
651 }
652 // Outer polygons n*(n-1)
653 for (i=0; i<n-1; i++) {
654 for (j=0; j<n; j++) {
655 npt = 6*(ipout+n*i+j);
656 buff.fPols[npt] = c;
657 buff.fPols[npt+1] = 4;
658 buff.fPols[npt+2] = isout+n*i+j;
659 buff.fPols[npt+3] = isgenout+i*n+j;
660 buff.fPols[npt+4] = isout+n*(i+1)+j;
661 buff.fPols[npt+5] = isgenout+i*n+((j+1)%n);
662 }
663 }
664 // End caps
665 if (hasRmin) {
666 for (j=0; j<n; j++) {
667 npt = 6*(iplo+j);
668 buff.fPols[npt] = c+1;
669 buff.fPols[npt+1] = 4;
670 buff.fPols[npt+2] = isin+j;
671 buff.fPols[npt+3] = islo+j;
672 buff.fPols[npt+4] = isout+j;
673 buff.fPols[npt+5] = islo+((j+1)%n);
674 }
675 for (j=0; j<n; j++) {
676 npt = 6*(ipup+j);
677 buff.fPols[npt] = c+2;
678 buff.fPols[npt+1] = 4;
679 buff.fPols[npt+2] = isin+n*(n-1)+j;
680 buff.fPols[npt+3] = ishi+((j+1)%n);
681 buff.fPols[npt+4] = isout+n*(n-1)+j;
682 buff.fPols[npt+5] = ishi+j;
683 }
684 } else {
685 for (j=0; j<n; j++) {
686 npt = 6*iplo+5*j;
687 buff.fPols[npt] = c+1;
688 buff.fPols[npt+1] = 3;
689 buff.fPols[npt+2] = isout+j;
690 buff.fPols[npt+3] = islo+((j+1)%n);
691 buff.fPols[npt+4] = islo+j;
692 }
693 for (j=0; j<n; j++) {
694 npt = 6*iplo+5*(n+j);
695 buff.fPols[npt] = c+2;
696 buff.fPols[npt+1] = 3;
697 buff.fPols[npt+2] = isout+n*(n-1)+j;
698 buff.fPols[npt+3] = ishi+j;
699 buff.fPols[npt+4] = ishi+((j+1)%n);
700 }
701 }
702}
703
704////////////////////////////////////////////////////////////////////////////////
705/// Compute r^2 = x^2 + y^2 at a given z coordinate, for either inner or outer hyperbolas.
706
708{
709 Double_t r0, tsq;
710 if (inner) {
711 r0 = fRmin;
712 tsq = fTinsq;
713 } else {
714 r0 = fRmax;
715 tsq = fToutsq;
716 }
717 return (r0*r0+tsq*z*z);
718}
719
720////////////////////////////////////////////////////////////////////////////////
721/// Compute z^2 at a given r^2, for either inner or outer hyperbolas.
722
724{
725 Double_t r0, tsq;
726 if (inner) {
727 r0 = fRmin;
728 tsq = fTinsq;
729 } else {
730 r0 = fRmax;
731 tsq = fToutsq;
732 }
733 if (TMath::Abs(tsq) < TGeoShape::Tolerance()) return TGeoShape::Big();
734 return ((r*r-r0*r0)/tsq);
735}
736
737////////////////////////////////////////////////////////////////////////////////
738/// computes the closest distance from given point to this shape, according
739/// to option. The matching point on the shape is stored in spoint.
740
742{
743 Double_t safe, safrmin, safrmax;
744 if (in) {
745 safe = fDz-TMath::Abs(point[2]);
746 safrmin = SafetyToHype(point, kTRUE, in);
747 if (safrmin < safe) safe = safrmin;
748 safrmax = SafetyToHype(point, kFALSE,in);
749 if (safrmax < safe) safe = safrmax;
750 } else {
751 safe = -fDz+TMath::Abs(point[2]);
752 safrmin = SafetyToHype(point, kTRUE, in);
753 if (safrmin > safe) safe = safrmin;
754 safrmax = SafetyToHype(point, kFALSE,in);
755 if (safrmax > safe) safe = safrmax;
756 }
757 return safe;
758}
759
760////////////////////////////////////////////////////////////////////////////////
761/// Compute an underestimate of the closest distance from a point to inner or
762/// outer infinite hyperbolas.
763
765{
766 Double_t r, rsq, rhsq, rh, dr, tsq, saf;
767 if (inner && !HasInner()) return (in)?TGeoShape::Big():-TGeoShape::Big();
768 rsq = point[0]*point[0]+point[1]*point[1];
769 r = TMath::Sqrt(rsq);
770 rhsq = RadiusHypeSq(point[2], inner);
771 rh = TMath::Sqrt(rhsq);
772 dr = r - rh;
773 if (inner) {
774 if (!in && dr>0) return -TGeoShape::Big();
775 if (TMath::Abs(fStIn) < TGeoShape::Tolerance()) return TMath::Abs(dr);
777 tsq = fTinsq;
778 } else {
779 if (!in && dr<0) return -TGeoShape::Big();
781 tsq = fToutsq;
782 }
783 if (TMath::Abs(dr)<TGeoShape::Tolerance()) return 0.;
784 // 1. dr<0 => approximate safety with distance to tangent to hyperbola in z = |point[2]|
785 Double_t m;
786 if (dr<0) {
787 m = rh/(tsq*TMath::Abs(point[2]));
788 saf = -m*dr/TMath::Sqrt(1.+m*m);
789 return saf;
790 }
791 // 2. dr>0 => approximate safety with distance from point to segment P1(r(z0),z0) and P2(r0, z(r0))
792 m = (TMath::Sqrt(ZHypeSq(r,inner)) - TMath::Abs(point[2]))/dr;
793 saf = m*dr/TMath::Sqrt(1.+m*m);
794 return saf;
795}
796
797////////////////////////////////////////////////////////////////////////////////
798/// Save a primitive as a C++ statement(s) on output stream "out".
799
800void TGeoHype::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
801{
803 out << " // Shape: " << GetName() << " type: " << ClassName() << std::endl;
804 out << " rin = " << fRmin << ";" << std::endl;
805 out << " stin = " << fStIn << ";" << std::endl;
806 out << " rout = " << fRmax << ";" << std::endl;
807 out << " stout = " << fStOut << ";" << std::endl;
808 out << " dz = " << fDz << ";" << std::endl;
809 out << " TGeoShape *" << GetPointerName() << " = new TGeoHype(\"" << GetName() << "\",rin,stin,rout,stout,dz);" << std::endl;
811}
812
813////////////////////////////////////////////////////////////////////////////////
814/// Set dimensions of the hyperboloid.
815
817{
818 fRmin = rin;
819 fRmax = rout;
820 fDz = dz;
821 fStIn = stin;
822 fStOut = stout;
824 fTinsq = fTin*fTin;
827 if ((fRmin==0) && (fStIn==0)) SetShapeBit(kGeoRSeg, kTRUE);
829}
830
831////////////////////////////////////////////////////////////////////////////////
832/// Set dimensions of the hyperboloid starting from an array.
833/// - param[0] = dz
834/// - param[1] = rin
835/// - param[2] = stin
836/// - param[3] = rout
837/// - param[4] = stout
838
840{
841 Double_t dz = param[0];
842 Double_t rin = param[1];
843 Double_t stin = param[2];
844 Double_t rout = param[3];
845 Double_t stout = param[4];
846 SetHypeDimensions(rin, stin, rout, stout, dz);
847}
848
849////////////////////////////////////////////////////////////////////////////////
850/// create tube mesh points
851
853{
854 Double_t z,dz,r;
855 Int_t i,j, n;
856 if (!points) return;
858 Double_t dphi = 360./n;
859 Double_t phi = 0;
860 dz = 2.*fDz/(n-1);
861
862 Int_t indx = 0;
863
864 if (HasInner()) {
865 // Inner surface points
866 for (i=0; i<n; i++) {
867 z = -fDz+i*dz;
869 for (j=0; j<n; j++) {
870 phi = j*dphi*TMath::DegToRad();
871 points[indx++] = r * TMath::Cos(phi);
872 points[indx++] = r * TMath::Sin(phi);
873 points[indx++] = z;
874 }
875 }
876 } else {
877 points[indx++] = 0.;
878 points[indx++] = 0.;
879 points[indx++] = -fDz;
880 points[indx++] = 0.;
881 points[indx++] = 0.;
882 points[indx++] = fDz;
883 }
884 // Outer surface points
885 for (i=0; i<n; i++) {
886 z = -fDz + i*dz;
888 for (j=0; j<n; j++) {
889 phi = j*dphi*TMath::DegToRad();
890 points[indx++] = r * TMath::Cos(phi);
891 points[indx++] = r * TMath::Sin(phi);
892 points[indx++] = z;
893 }
894 }
895}
896
897////////////////////////////////////////////////////////////////////////////////
898/// create tube mesh points
899
901{
902 Double_t z,dz,r;
903 Int_t i,j, n;
904 if (!points) return;
906 Double_t dphi = 360./n;
907 Double_t phi = 0;
908 dz = 2.*fDz/(n-1);
909
910 Int_t indx = 0;
911
912 if (HasInner()) {
913 // Inner surface points
914 for (i=0; i<n; i++) {
915 z = -fDz+i*dz;
917 for (j=0; j<n; j++) {
918 phi = j*dphi*TMath::DegToRad();
919 points[indx++] = r * TMath::Cos(phi);
920 points[indx++] = r * TMath::Sin(phi);
921 points[indx++] = z;
922 }
923 }
924 } else {
925 points[indx++] = 0.;
926 points[indx++] = 0.;
927 points[indx++] = -fDz;
928 points[indx++] = 0.;
929 points[indx++] = 0.;
930 points[indx++] = fDz;
931 }
932 // Outer surface points
933 for (i=0; i<n; i++) {
934 z = -fDz + i*dz;
936 for (j=0; j<n; j++) {
937 phi = j*dphi*TMath::DegToRad();
938 points[indx++] = r * TMath::Cos(phi);
939 points[indx++] = r * TMath::Sin(phi);
940 points[indx++] = z;
941 }
942 }
943}
944
945////////////////////////////////////////////////////////////////////////////////
946/// Returns numbers of vertices, segments and polygons composing the shape mesh.
947
948void TGeoHype::GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
949{
951 Bool_t hasRmin = HasInner();
952 nvert = (hasRmin)?(2*n*n):(n*n+2);
953 nsegs = (hasRmin)?(4*n*n):(n*(2*n+1));
954 npols = (hasRmin)?(2*n*n):(n*(n+1));
955}
956
957////////////////////////////////////////////////////////////////////////////////
958/// Return number of vertices of the mesh representation
959
961{
963 Int_t numPoints = (HasRmin())?(2*n*n):(n*n+2);
964 return numPoints;
965}
966
967////////////////////////////////////////////////////////////////////////////////
968/// fill size of this 3-D object
969
971{
972}
973
974////////////////////////////////////////////////////////////////////////////////
975/// Fills a static 3D buffer and returns a reference.
976
977const TBuffer3D & TGeoHype::GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
978{
979 static TBuffer3D buffer(TBuffer3DTypes::kGeneric);
980
981 TGeoBBox::FillBuffer3D(buffer, reqSections, localFrame);
982
983 if (reqSections & TBuffer3D::kRawSizes) {
985 Bool_t hasRmin = HasInner();
986 Int_t nbPnts = (hasRmin)?(2*n*n):(n*n+2);
987 Int_t nbSegs = (hasRmin)?(4*n*n):(n*(2*n+1));
988 Int_t nbPols = (hasRmin)?(2*n*n):(n*(n+1));
989 if (buffer.SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
991 }
992 }
993 if ((reqSections & TBuffer3D::kRaw) && buffer.SectionsValid(TBuffer3D::kRawSizes)) {
994 SetPoints(buffer.fPnts);
995 if (!buffer.fLocalFrame) {
996 TransformPoints(buffer.fPnts, buffer.NbPnts());
997 }
998
999 SetSegsAndPols(buffer);
1001 }
1002
1003 return buffer;
1004}
1005
1006////////////////////////////////////////////////////////////////////////////////
1007/// Check the inside status for each of the points in the array.
1008/// Input: Array of point coordinates + vector size
1009/// Output: Array of Booleans for the inside of each point
1010
1011void TGeoHype::Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
1012{
1013 for (Int_t i=0; i<vecsize; i++) inside[i] = Contains(&points[3*i]);
1014}
1015
1016////////////////////////////////////////////////////////////////////////////////
1017/// Compute the normal for an array o points so that norm.dot.dir is positive
1018/// Input: Arrays of point coordinates and directions + vector size
1019/// Output: Array of normal directions
1020
1021void TGeoHype::ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
1022{
1023 for (Int_t i=0; i<vecsize; i++) ComputeNormal(&points[3*i], &dirs[3*i], &norms[3*i]);
1024}
1025
1026////////////////////////////////////////////////////////////////////////////////
1027/// Compute distance from array of input points having directions specified by dirs. Store output in dists
1028
1029void TGeoHype::DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t* step) const
1030{
1031 for (Int_t i=0; i<vecsize; i++) dists[i] = DistFromInside(&points[3*i], &dirs[3*i], 3, step[i]);
1032}
1033
1034////////////////////////////////////////////////////////////////////////////////
1035/// Compute distance from array of input points having directions specified by dirs. Store output in dists
1036
1037void TGeoHype::DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t* step) const
1038{
1039 for (Int_t i=0; i<vecsize; i++) dists[i] = DistFromOutside(&points[3*i], &dirs[3*i], 3, step[i]);
1040}
1041
1042////////////////////////////////////////////////////////////////////////////////
1043/// Compute safe distance from each of the points in the input array.
1044/// Input: Array of point coordinates, array of statuses for these points, size of the arrays
1045/// Output: Safety values
1046
1047void TGeoHype::Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
1048{
1049 for (Int_t i=0; i<vecsize; i++) safe[i] = Safety(&points[3*i], inside[i]);
1050}
#define c(i)
Definition: RSha256.hxx:101
const Bool_t kFALSE
Definition: RtypesCore.h:101
float Float_t
Definition: RtypesCore.h:57
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassImp(name)
Definition: Rtypes.h:375
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
char name[80]
Definition: TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
#define isin(address, start, length)
Generic 3D primitive description class.
Definition: TBuffer3D.h:18
Int_t * fPols
Definition: TBuffer3D.h:114
UInt_t NbPnts() const
Definition: TBuffer3D.h:80
Bool_t SectionsValid(UInt_t mask) const
Definition: TBuffer3D.h:67
@ kRawSizes
Definition: TBuffer3D.h:53
void SetSectionsValid(UInt_t mask)
Definition: TBuffer3D.h:65
Int_t * fSegs
Definition: TBuffer3D.h:113
Bool_t fLocalFrame
Definition: TBuffer3D.h:90
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
Definition: TBuffer3D.cxx:359
Double_t * fPnts
Definition: TBuffer3D.h:112
Double_t fDX
Definition: TGeoBBox.h:21
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from outside point to surface of the box.
Definition: TGeoBBox.cxx:458
virtual void InspectShape() const
Prints shape parameters.
Definition: TGeoBBox.cxx:819
Double_t fOrigin[3]
Definition: TGeoBBox.h:24
Double_t fDY
Definition: TGeoBBox.h:22
Double_t fDZ
Definition: TGeoBBox.h:23
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fills the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
Definition: TGeoBBox.cxx:1059
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
Definition: TGeoHype.h:18
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Cannot divide hyperboloids.
Definition: TGeoHype.cxx:398
virtual void SetPoints(Double_t *points) const
create tube mesh points
Definition: TGeoHype.cxx:852
Double_t SafetyToHype(const Double_t *point, Bool_t inner, Bool_t in) const
Compute an underestimate of the closest distance from a point to inner or outer infinite hyperbolas.
Definition: TGeoHype.cxx:764
Double_t ZHypeSq(Double_t r, Bool_t inner) const
Compute z^2 at a given r^2, for either inner or outer hyperbolas.
Definition: TGeoHype.cxx:723
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const
in case shape has some negative parameters, these has to be computed in order to fit the mother
Definition: TGeoHype.cxx:451
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
Definition: TGeoHype.cxx:1047
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
Definition: TGeoHype.cxx:977
Double_t RadiusHypeSq(Double_t z, Bool_t inner) const
Compute r^2 = x^2 + y^2 at a given z coordinate, for either inner or outer hyperbolas.
Definition: TGeoHype.cxx:707
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
Definition: TGeoHype.cxx:948
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Definition: TGeoHype.cxx:157
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Definition: TGeoHype.cxx:1029
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
Definition: TGeoHype.cxx:437
Int_t DistToHype(const Double_t *point, const Double_t *dir, Double_t *s, Bool_t inner, Bool_t in) const
Compute distance from an arbitrary point to inner/outer surface of hyperboloid.
Definition: TGeoHype.cxx:347
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
Definition: TGeoHype.cxx:239
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape, according to option.
Definition: TGeoHype.cxx:741
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
Definition: TGeoHype.cxx:488
virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
Check the inside status for each of the points in the array.
Definition: TGeoHype.cxx:1011
virtual void SetDimensions(Double_t *param)
Set dimensions of the hyperboloid starting from an array.
Definition: TGeoHype.cxx:839
TGeoHype()
Default constructor.
Definition: TGeoHype.cxx:92
Double_t fStIn
Definition: TGeoHype.h:24
Double_t fToutsq
Definition: TGeoHype.h:32
virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
Definition: TGeoHype.cxx:1021
virtual void InspectShape() const
print shape parameters
Definition: TGeoHype.cxx:471
virtual ~TGeoHype()
destructor
Definition: TGeoHype.cxx:150
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoHype.cxx:800
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
Definition: TGeoHype.cxx:960
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this tube
Definition: TGeoHype.cxx:224
void SetHypeDimensions(Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Set dimensions of the hyperboloid.
Definition: TGeoHype.cxx:816
Double_t fStOut
Definition: TGeoHype.h:25
virtual void ComputeBBox()
Compute bounding box of the hyperboloid.
Definition: TGeoHype.cxx:167
Double_t fTinsq
Definition: TGeoHype.h:31
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
Definition: TGeoHype.cxx:187
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Definition: TGeoHype.cxx:1037
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
Definition: TGeoHype.cxx:408
Double_t fTout
Definition: TGeoHype.h:30
virtual void Sizeof3D() const
fill size of this 3-D object
Definition: TGeoHype.cxx:970
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from inside point to surface of the hyperboloid.
Definition: TGeoHype.cxx:248
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
compute distance from outside point to surface of the hyperboloid.
Definition: TGeoHype.cxx:288
Double_t fTin
Definition: TGeoHype.h:29
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
Definition: TGeoHype.cxx:510
Bool_t HasInner() const
Definition: TGeoHype.h:73
Int_t GetNsegments() const
Get number of segments approximating circles.
Geometrical transformation package.
Definition: TGeoMatrix.h:41
Base abstract class for all shapes.
Definition: TGeoShape.h:26
static Double_t Big()
Definition: TGeoShape.h:88
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
Int_t GetBasicColor() const
Get the basic color (0-7).
Definition: TGeoShape.cxx:673
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
Definition: TGeoShape.cxx:552
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
Definition: TGeoShape.cxx:524
const char * GetPointerName() const
Provide a pointer name containing uid.
Definition: TGeoShape.cxx:699
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
Definition: TGeoShape.cxx:259
virtual const char * GetName() const
Get the shape name.
Definition: TGeoShape.cxx:248
@ kGeoSavePrimitive
Definition: TGeoShape.h:65
@ kGeoRSeg
Definition: TGeoShape.h:35
@ kGeoInvalidShape
Definition: TGeoShape.h:42
@ kGeoHype
Definition: TGeoShape.h:64
@ kGeoRunTimeShape
Definition: TGeoShape.h:41
static Double_t Tolerance()
Definition: TGeoShape.h:91
Bool_t TestShapeBit(UInt_t f) const
Definition: TGeoShape.h:163
Cylindrical tube class.
Definition: TGeoTube.h:18
Double_t fRmin
Definition: TGeoTube.h:21
Double_t fDz
Definition: TGeoTube.h:23
Double_t fRmax
Definition: TGeoTube.h:22
Bool_t HasRmin() const
Definition: TGeoTube.h:72
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:49
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:130
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:879
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
RVec< PromoteType< T > > sin(const RVec< T > &v)
Definition: RVec.hxx:1758
const Int_t n
Definition: legend1.C:16
static constexpr double sr
static constexpr double s
Long64_t LocMin(Long64_t n, const T *a)
Returns index of array with the minimum element.
Definition: TMath.h:979
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Definition: TMathBase.h:175
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Definition: TMath.h:643
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Definition: TMath.h:79
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition: TMath.h:659
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition: TMathBase.h:198
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition: TMath.h:591
constexpr Double_t Pi()
Definition: TMath.h:37
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition: TMath.h:585
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Definition: TMath.h:597
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition: TMathBase.h:123
TMarker m
Definition: textangle.C:8
TArc a
Definition: textangle.C:12
#define snext(osub1, osub2)
Definition: triangle.c:1168