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