Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoParaboloid.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Mihaela Gheata 20/06/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/** \class TGeoParaboloid
13\ingroup Shapes_classes
14
15A paraboloid is defined by the revolution surface generated by a
16parabola and is bounded by two planes perpendicular to Z axis. The
17parabola equation is taken in the form: `z = a·r2 + b`, where:
18`r2 = x2 + y2`. Note the missing linear term (parabola symmetric with
19respect to Z axis).
20
21The coefficients a and b are computed from the input values which are
22the radii of the circular sections cut by the planes at `+/-dz`:
23
24 - `-dz = a*r2low + b`
25 - ` dz = a*r2high + b`
26
27~~~{.cpp}
28TGeoParaboloid(Double_t rlo,Double_t rhi,Double_t dz);
29~~~
30
31Begin_Macro
32{
33 new TGeoManager("parab", "paraboloid");
34 TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
35 TGeoMedium *med = new TGeoMedium("MED",1,mat);
36 TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
37 gGeoManager->SetTopVolume(top);
38 TGeoVolume *vol = gGeoManager->MakeParaboloid("PARAB",med,0, 40, 50);
39 TGeoParaboloid *par = (TGeoParaboloid*)vol->GetShape();
40 top->AddNode(vol,1);
41 gGeoManager->CloseGeometry();
42 gGeoManager->SetNsegments(80);
43 top->Draw();
44 if (gPad) {
45 TView *view = gPad->GetView();
46 if (view) view->ShowAxis();
47 }
48}
49End_Macro
50*/
51
52#include <iostream>
53#include "TGeoManager.h"
54#include "TGeoVolume.h"
55#include "TVirtualGeoPainter.h"
56#include "TGeoParaboloid.h"
57#include "TBuffer3D.h"
58#include "TBuffer3DTypes.h"
59#include "TMath.h"
60
61
62////////////////////////////////////////////////////////////////////////////////
63/// Dummy constructor
64
66{
67 fRlo = 0;
68 fRhi = 0;
69 fDz = 0;
70 fA = 0;
71 fB = 0;
73}
74
75////////////////////////////////////////////////////////////////////////////////
76/// Default constructor specifying X and Y semiaxis length
77
89
90////////////////////////////////////////////////////////////////////////////////
91/// Default constructor specifying X and Y semiaxis length
92
94{
95 fRlo = 0;
96 fRhi = 0;
97 fDz = 0;
98 fA = 0;
99 fB = 0;
102 ComputeBBox();
103}
104
105////////////////////////////////////////////////////////////////////////////////
106/// Default constructor specifying minimum and maximum radius
107/// - param[0] = rlo
108/// - param[1] = rhi
109/// - param[2] = dz
110
117
118////////////////////////////////////////////////////////////////////////////////
119/// destructor
120
122
123////////////////////////////////////////////////////////////////////////////////
124/// Computes capacity of the shape in [length^3]
125
127{
128 Double_t capacity = TMath::Pi() * fDz * (fRlo * fRlo + fRhi * fRhi);
129 return capacity;
130}
131
132////////////////////////////////////////////////////////////////////////////////
133/// compute bounding box of the tube
134
136{
138 fDY = fDX;
139 fDZ = fDz;
140}
141
142////////////////////////////////////////////////////////////////////////////////
143/// Compute normal to closest surface from POINT.
144
145void TGeoParaboloid::ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const
146{
147 norm[0] = norm[1] = 0.0;
148 if (TMath::Abs(point[2]) > fDz) {
149 norm[2] = TMath::Sign(1., dir[2]);
150 return;
151 }
152 Double_t safz = fDz - TMath::Abs(point[2]);
153 Double_t r = TMath::Sqrt(point[0] * point[0] + point[1] * point[1]);
154 Double_t safr = TMath::Abs(r - TMath::Sqrt((point[2] - fB) / fA));
155 if (safz < safr) {
156 norm[2] = TMath::Sign(1., dir[2]);
157 return;
158 }
159 Double_t talf = -2. * fA * r;
160 Double_t calf = 1. / TMath::Sqrt(1. + talf * talf);
162 Double_t phi = TMath::ATan2(point[1], point[0]);
163
164 norm[0] = salf * TMath::Cos(phi);
165 norm[1] = salf * TMath::Sin(phi);
166 norm[2] = calf;
167 Double_t ndotd = norm[0] * dir[0] + norm[1] * dir[1] + norm[2] * dir[2];
168 if (ndotd < 0) {
169 norm[0] = -norm[0];
170 norm[1] = -norm[1];
171 norm[2] = -norm[2];
172 }
173}
174
175////////////////////////////////////////////////////////////////////////////////
176/// test if point is inside the elliptical tube
177
179{
180 if (TMath::Abs(point[2]) > fDz)
181 return kFALSE;
182 Double_t aa = fA * (point[2] - fB);
183 if (aa < 0)
184 return kFALSE;
185 Double_t rsq = point[0] * point[0] + point[1] * point[1];
186 if (aa < fA * fA * rsq)
187 return kFALSE;
188 return kTRUE;
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// compute closest distance from point px,py to each vertex
193
195{
197 const Int_t numPoints = n * (n + 1) + 2;
198 return ShapeDistancetoPrimitive(numPoints, px, py);
199}
200
201////////////////////////////////////////////////////////////////////////////////
202/// Compute distance from a point to the parabola given by:
203/// `z = a*rsq + b; rsq = x*x+y*y`
204
206{
207 Double_t rsq = point[0] * point[0] + point[1] * point[1];
208 Double_t a = fA * (dir[0] * dir[0] + dir[1] * dir[1]);
209 Double_t b = 2. * fA * (point[0] * dir[0] + point[1] * dir[1]) - dir[2];
210 Double_t c = fA * rsq + fB - point[2];
211 Double_t dist = TGeoShape::Big();
214 return dist; // big
215 dist = -c / b;
216 if (dist < 0)
217 return TGeoShape::Big();
218 return dist; // OK
219 }
220 Double_t ainv = 1. / a;
221 Double_t sum = -b * ainv;
222 Double_t prod = c * ainv;
223 Double_t delta = sum * sum - 4. * prod;
224 if (delta < 0)
225 return dist; // big
226 delta = TMath::Sqrt(delta);
228 Int_t i = -1;
229 while (i < 2) {
230 dist = 0.5 * (sum + i * sone * delta);
231 i += 2;
232 if (dist < 0)
233 continue;
234 if (dist < 1.E-8) {
235 Double_t talf = -2. * fA * TMath::Sqrt(rsq);
236 Double_t phi = TMath::ATan2(point[1], point[0]);
237 Double_t ndotd = talf * (TMath::Cos(phi) * dir[0] + TMath::Sin(phi) * dir[1]) + dir[2];
238 if (!in)
239 ndotd *= -1;
240 if (ndotd < 0)
241 return dist;
242 } else
243 return dist;
244 }
245 return TGeoShape::Big();
246}
247
248////////////////////////////////////////////////////////////////////////////////
249/// compute distance from inside point to surface of the paraboloid
250
252 Double_t *safe) const
253{
254 if (iact < 3 && safe) {
255 // compute safe distance
256 *safe = Safety(point, kTRUE);
257 if (iact == 0)
258 return TGeoShape::Big();
259 if (iact == 1 && step < *safe)
260 return TGeoShape::Big();
261 }
262
264 if (dir[2] < 0) {
265 dz = -(point[2] + fDz) / dir[2];
266 } else if (dir[2] > 0) {
267 dz = (fDz - point[2]) / dir[2];
268 }
269 Double_t dpara = DistToParaboloid(point, dir, kTRUE);
270 return TMath::Min(dz, dpara);
271}
272
273////////////////////////////////////////////////////////////////////////////////
274/// compute distance from outside point to surface of the paraboloid and safe distance
275
277 Double_t *safe) const
278{
279 if (iact < 3 && safe) {
280 // compute safe distance
281 *safe = Safety(point, kFALSE);
282 if (iact == 0)
283 return TGeoShape::Big();
284 if (iact == 1 && step < *safe)
285 return TGeoShape::Big();
286 }
288 if (point[2] <= -fDz) {
289 if (dir[2] <= 0)
290 return TGeoShape::Big();
291 Double_t snxt = -(fDz + point[2]) / dir[2];
292 // find extrapolated X and Y
293 xnew = point[0] + snxt * dir[0];
294 ynew = point[1] + snxt * dir[1];
295 if ((xnew * xnew + ynew * ynew) <= fRlo * fRlo)
296 return snxt;
297 } else if (point[2] >= fDz) {
298 if (dir[2] >= 0)
299 return TGeoShape::Big();
300 Double_t snxt = (fDz - point[2]) / dir[2];
301 // find extrapolated X and Y
302 xnew = point[0] + snxt * dir[0];
303 ynew = point[1] + snxt * dir[1];
304 if ((xnew * xnew + ynew * ynew) <= fRhi * fRhi)
305 return snxt;
306 }
307 Double_t snxt = DistToParaboloid(point, dir, kFALSE);
308 if (snxt > 1E20)
309 return snxt;
310 znew = point[2] + snxt * dir[2];
311 if (TMath::Abs(znew) <= fDz)
312 return snxt;
313 return TGeoShape::Big();
314}
315
316////////////////////////////////////////////////////////////////////////////////
317/// Divide the paraboloid along one axis.
318
319TGeoVolume *TGeoParaboloid::Divide(TGeoVolume * /*voldiv*/, const char * /*divname*/, Int_t /*iaxis*/, Int_t /*ndiv*/,
320 Double_t /*start*/, Double_t /*step*/)
321{
322 Error("Divide", "Paraboloid divisions not implemented");
323 return nullptr;
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// Fill vector param[4] with the bounding cylinder parameters. The order
328/// is the following : Rmin, Rmax, Phi1, Phi2
329
331{
332 param[0] = 0.; // Rmin
333 param[1] = fDX; // Rmax
334 param[1] *= param[1];
335 param[2] = 0.; // Phi1
336 param[3] = 360.; // Phi2
337}
338
339////////////////////////////////////////////////////////////////////////////////
340/// in case shape has some negative parameters, these has to be computed
341/// in order to fit the mother
342
344{
345 return nullptr;
346}
347
348////////////////////////////////////////////////////////////////////////////////
349/// print shape parameters
350
352{
353 printf("*** Shape %s: TGeoParaboloid ***\n", GetName());
354 printf(" rlo = %11.5f\n", fRlo);
355 printf(" rhi = %11.5f\n", fRhi);
356 printf(" dz = %11.5f\n", fDz);
357 printf(" Bounding box:\n");
359}
360
361////////////////////////////////////////////////////////////////////////////////
362/// Creates a TBuffer3D describing *this* shape.
363/// Coordinates are in local reference frame.
364
366{
368 Int_t nbPnts = n * (n + 1) + 2;
369 Int_t nbSegs = n * (2 * n + 3);
370 Int_t nbPols = n * (n + 2);
371
372 TBuffer3D *buff =
373 new TBuffer3D(TBuffer3DTypes::kGeneric, nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 2 * n * 5 + n * n * 6);
374
375 if (buff) {
376 SetPoints(buff->fPnts);
378 }
379
380 return buff;
381}
382
383////////////////////////////////////////////////////////////////////////////////
384/// Fill TBuffer3D structure for segments and polygons.
385
387{
388 Int_t indx, i, j;
390
392
393 Int_t nn1 = (n + 1) * n + 1;
394 indx = 0;
395 // Lower end-cap (n radial segments)
396 for (j = 0; j < n; j++) {
397 buff.fSegs[indx++] = c + 2;
398 buff.fSegs[indx++] = 0;
399 buff.fSegs[indx++] = j + 1;
400 }
401 // Sectors (n)
402 for (i = 0; i < n + 1; i++) {
403 // lateral (circles) segments (n)
404 for (j = 0; j < n; j++) {
405 buff.fSegs[indx++] = c;
406 buff.fSegs[indx++] = n * i + 1 + j;
407 buff.fSegs[indx++] = n * i + 1 + ((j + 1) % n);
408 }
409 if (i == n)
410 break; // skip i=n for generators
411 // generator segments (n)
412 for (j = 0; j < n; j++) {
413 buff.fSegs[indx++] = c;
414 buff.fSegs[indx++] = n * i + 1 + j;
415 buff.fSegs[indx++] = n * (i + 1) + 1 + j;
416 }
417 }
418 // Upper end-cap
419 for (j = 0; j < n; j++) {
420 buff.fSegs[indx++] = c + 1;
421 buff.fSegs[indx++] = n * n + 1 + j;
422 buff.fSegs[indx++] = nn1;
423 }
424
425 indx = 0;
426
427 // lower end-cap (n polygons)
428 for (j = 0; j < n; j++) {
429 buff.fPols[indx++] = c + 2;
430 buff.fPols[indx++] = 3;
431 buff.fPols[indx++] = n + j;
432 buff.fPols[indx++] = (j + 1) % n;
433 buff.fPols[indx++] = j;
434 }
435 // Sectors (n)
436 for (i = 0; i < n; i++) {
437 // lateral faces (n)
438 for (j = 0; j < n; j++) {
439 buff.fPols[indx++] = c;
440 buff.fPols[indx++] = 4;
441 buff.fPols[indx++] = (2 * i + 1) * n + j;
442 buff.fPols[indx++] = 2 * (i + 1) * n + j;
443 buff.fPols[indx++] = (2 * i + 3) * n + j;
444 buff.fPols[indx++] = 2 * (i + 1) * n + ((j + 1) % n);
445 }
446 }
447 // upper end-cap (n polygons)
448 for (j = 0; j < n; j++) {
449 buff.fPols[indx++] = c + 1;
450 buff.fPols[indx++] = 3;
451 buff.fPols[indx++] = 2 * n * (n + 1) + j;
452 buff.fPols[indx++] = 2 * n * (n + 1) + ((j + 1) % n);
453 buff.fPols[indx++] = (2 * n + 1) * n + j;
454 }
455}
456
457////////////////////////////////////////////////////////////////////////////////
458/// Computes the closest distance from given point to this shape.
459
461{
462 Double_t safz = fDz - TMath::Abs(point[2]);
463 if (!in)
464 safz = -safz;
466 Double_t rsq = point[0] * point[0] + point[1] * point[1];
467 Double_t z0 = fA * rsq + fB;
468 Double_t r0sq = (point[2] - fB) / fA;
469 if (r0sq < 0) {
470 if (in)
471 return 0.;
472 return safz;
473 }
475 if (in) {
476 if (dr > -1.E-8)
477 return 0.;
478 Double_t dz = TMath::Abs(point[2] - z0);
479 safr = -dr * dz / TMath::Sqrt(dr * dr + dz * dz);
480 } else {
481 if (dr < 1.E-8)
482 return safz;
483 Double_t talf = -2. * fA * TMath::Sqrt(r0sq);
485 safr = TMath::Abs(dr * salf);
486 }
487 if (in)
488 return TMath::Min(safr, safz);
489 return TMath::Max(safr, safz);
490}
491
492////////////////////////////////////////////////////////////////////////////////
493/// Set paraboloid dimensions.
494
496{
497 if ((rlo < 0) || (rhi < 0) || (dz <= 0) || TMath::Abs(rlo - rhi) < TGeoShape::Tolerance()) {
499 Error("SetParaboloidDimensions", "Dimensions of %s invalid: check (rlo>=0) (rhi>=0) (rlo!=rhi) dz>0", GetName());
500 return;
501 }
502 fRlo = rlo;
503 fRhi = rhi;
504 fDz = dz;
505 Double_t dd = 1. / (fRhi * fRhi - fRlo * fRlo);
506 fA = 2. * fDz * dd;
507 fB = -fDz * (fRlo * fRlo + fRhi * fRhi) * dd;
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Set paraboloid dimensions starting from an array.
512
514{
515 Double_t rlo = param[0];
516 Double_t rhi = param[1];
517 Double_t dz = param[2];
519}
520
521////////////////////////////////////////////////////////////////////////////////
522/// Create paraboloid mesh points.
523/// ~~~ {.cpp}
524/// Npoints = n*(n+1) + 2
525/// ifirst = 0
526/// ipoint(i,j) = 1+i*n+j; i=[0,n] j=[0,n-1]
527/// ilast = 1+n*(n+1)
528/// Nsegments = n*(2*n+3)
529/// lower: (0, j+1); j=[0,n-1]
530/// circle(i): (n*i+1+j, n*i+1+(j+1)%n); i=[0,n] j=[0,n-1]
531/// generator(i): (n*i+1+j, n*(i+1)+1+j); i,j=[0,n-1]
532/// upper: (n*n+1+j, (n+1)*n+1) j=[0,n-1]
533/// Npolygons = n*(n+2)
534/// lower: (n+j, (j+1)%n, j) j=[0,n-1]
535/// lateral(i): ((2*i+1)*n+j, 2*(i+1)*n+j, (2*i+3)*n+j, 2*(i+1)*n+(j+1)%n)
536/// i,j = [0,n-1]
537/// upper: ((2n+1)*n+j, 2*n*(n+1)+(j+1)%n, 2*n*(n+1)+j) j=[0,n-1]
538/// ~~~
539
541{
542 if (!points)
543 return;
548 Double_t dtt = (ttmax - ttmin) / n;
549 Double_t dphi = 360. / n;
550 Double_t tt;
551 Double_t r, z, delta;
552 Double_t phi, sph, cph;
553 Int_t indx = 0;
554 // center of the lower endcap:
555 points[indx++] = 0; // x
556 points[indx++] = 0; // y
557 points[indx++] = -fDz;
558 for (Int_t i = 0; i < n + 1; i++) { // nz planes = n+1
559 if (i == 0) {
560 r = fRlo;
561 z = -fDz;
562 } else if (i == n) {
563 r = fRhi;
564 z = fDz;
565 } else {
566 tt = TMath::Tan(ttmin + i * dtt);
567 delta = tt * tt - 4 * fA * fB; // should be always positive (a*b<0)
568 r = 0.5 * (tt + TMath::Sqrt(delta)) / fA;
569 z = r * tt;
570 }
571 for (Int_t j = 0; j < n; j++) {
572 phi = j * dphi * TMath::DegToRad();
573 sph = TMath::Sin(phi);
574 cph = TMath::Cos(phi);
575 points[indx++] = r * cph;
576 points[indx++] = r * sph;
577 points[indx++] = z;
578 }
579 }
580 // center of the upper endcap
581 points[indx++] = 0; // x
582 points[indx++] = 0; // y
583 points[indx++] = fDz;
584}
585
586////////////////////////////////////////////////////////////////////////////////
587/// Returns numbers of vertices, segments and polygons composing the shape mesh.
588
590{
592 nvert = n * (n + 1) + 2;
593 nsegs = n * (2 * n + 3);
594 npols = n * (n + 2);
595}
596
597////////////////////////////////////////////////////////////////////////////////
598/// Returns number of vertices on the paraboloid mesh.
599
601{
603 return (n * (n + 1) + 2);
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Save a primitive as a C++ statement(s) on output stream "out".
608
609void TGeoParaboloid::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
610{
612 return;
613 out << " // Shape: " << GetName() << " type: " << ClassName() << std::endl;
614 out << " rlo = " << fRlo << ";" << std::endl;
615 out << " rhi = " << fRhi << ";" << std::endl;
616 out << " dz = " << fDZ << ";" << std::endl;
617 out << " TGeoShape *" << GetPointerName() << " = new TGeoParaboloid(\"" << GetName() << "\", rlo,rhi,dz);"
618 << std::endl;
620}
621
622////////////////////////////////////////////////////////////////////////////////
623/// Create paraboloid mesh points.
624
626{
627 if (!points)
628 return;
633 Double_t dtt = (ttmax - ttmin) / n;
634 Double_t dphi = 360. / n;
635 Double_t tt;
636 Double_t r, z, delta;
637 Double_t phi, sph, cph;
638 Int_t indx = 0;
639 // center of the lower endcap:
640 points[indx++] = 0; // x
641 points[indx++] = 0; // y
642 points[indx++] = -fDz;
643 for (Int_t i = 0; i < n + 1; i++) { // nz planes = n+1
644 if (i == 0) {
645 r = fRlo;
646 z = -fDz;
647 } else if (i == n) {
648 r = fRhi;
649 z = fDz;
650 } else {
651 tt = TMath::Tan(ttmin + i * dtt);
652 delta = tt * tt - 4 * fA * fB; // should be always positive (a*b<0)
653 r = 0.5 * (tt + TMath::Sqrt(delta)) / fA;
654 z = r * tt;
655 }
656 for (Int_t j = 0; j < n; j++) {
657 phi = j * dphi * TMath::DegToRad();
658 sph = TMath::Sin(phi);
659 cph = TMath::Cos(phi);
660 points[indx++] = r * cph;
661 points[indx++] = r * sph;
662 points[indx++] = z;
663 }
664 }
665 // center of the upper endcap
666 points[indx++] = 0; // x
667 points[indx++] = 0; // y
668 points[indx++] = fDz;
669}
670
671////////////////////////////////////////////////////////////////////////////////
673
674////////////////////////////////////////////////////////////////////////////////
675/// Fills a static 3D buffer and returns a reference.
676
678{
679 static TBuffer3D buffer(TBuffer3DTypes::kGeneric);
681
684 Int_t nbPnts = n * (n + 1) + 2;
685 Int_t nbSegs = n * (2 * n + 3);
686 Int_t nbPols = n * (n + 2);
687 if (buffer.SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 2 * n * 5 + n * n * 6)) {
689 }
690 }
692 SetPoints(buffer.fPnts);
693 if (!buffer.fLocalFrame) {
694 TransformPoints(buffer.fPnts, buffer.NbPnts());
695 }
696 SetSegsAndPols(buffer);
698 }
699
700 return buffer;
701}
702
703////////////////////////////////////////////////////////////////////////////////
704/// Check the inside status for each of the points in the array.
705/// Input: Array of point coordinates + vector size
706/// Output: Array of Booleans for the inside of each point
707
709{
710 for (Int_t i = 0; i < vecsize; i++)
711 inside[i] = Contains(&points[3 * i]);
712}
713
714////////////////////////////////////////////////////////////////////////////////
715/// Compute the normal for an array o points so that norm.dot.dir is positive
716/// Input: Arrays of point coordinates and directions + vector size
717/// Output: Array of normal directions
718
720{
721 for (Int_t i = 0; i < vecsize; i++)
722 ComputeNormal(&points[3 * i], &dirs[3 * i], &norms[3 * i]);
723}
724
725////////////////////////////////////////////////////////////////////////////////
726/// Compute distance from array of input points having directions specified by dirs. Store output in dists
727
729 Double_t *step) const
730{
731 for (Int_t i = 0; i < vecsize; i++)
732 dists[i] = DistFromInside(&points[3 * i], &dirs[3 * i], 3, step[i]);
733}
734
735////////////////////////////////////////////////////////////////////////////////
736/// Compute distance from array of input points having directions specified by dirs. Store output in dists
737
739 Double_t *step) const
740{
741 for (Int_t i = 0; i < vecsize; i++)
742 dists[i] = DistFromOutside(&points[3 * i], &dirs[3 * i], 3, step[i]);
743}
744
745////////////////////////////////////////////////////////////////////////////////
746/// Compute safe distance from each of the points in the input array.
747/// Input: Array of point coordinates, array of statuses for these points, size of the arrays
748/// Output: Safety values
749
751{
752 for (Int_t i = 0; i < vecsize; i++)
753 safe[i] = Safety(&points[3 * i], inside[i]);
754}
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
Generic 3D primitive description class.
Definition TBuffer3D.h:18
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
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:113
Box class.
Definition TGeoBBox.h:17
void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override
Fills the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
Double_t fDX
Definition TGeoBBox.h:20
void InspectShape() const override
Prints shape parameters.
Definition TGeoBBox.cxx:810
Double_t fDY
Definition TGeoBBox.h:21
Double_t fDZ
Definition TGeoBBox.h:22
Int_t GetNsegments() const
Get number of segments approximating circles.
Geometrical transformation package.
Definition TGeoMatrix.h:38
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
Double_t Capacity() const override
Computes capacity of the shape in [length^3].
Double_t DistToParaboloid(const Double_t *point, const Double_t *dir, Bool_t in) const
Compute distance from a point to the parabola given by: z = a*rsq + b; rsq = x*x+y*y
void InspectShape() const override
print shape parameters
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
in case shape has some negative parameters, these has to be computed in order to fit the mother
TBuffer3D * MakeBuffer3D() const override
Creates a TBuffer3D describing this shape.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
Int_t GetNmeshVertices() const override
Returns number of vertices on the paraboloid mesh.
void Sizeof3D() const override
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT.
void SetPoints(Double_t *points) const override
Create paraboloid mesh points.
void GetBoundingCylinder(Double_t *param) const override
Fill vector param[4] with the bounding cylinder parameters.
void SetParaboloidDimensions(Double_t rlo, Double_t rhi, Double_t dz)
Set paraboloid dimensions.
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
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 override
compute distance from outside point to surface of the paraboloid and safe distance
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each vertex
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
~TGeoParaboloid() override
destructor
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
void ComputeBBox() override
compute bounding box of the tube
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 override
compute distance from inside point to surface of the paraboloid
Bool_t Contains(const Double_t *point) const override
test if point is inside the elliptical tube
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
void SetDimensions(Double_t *param) override
Set paraboloid dimensions starting from an array.
TGeoParaboloid()
Dummy constructor.
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide the paraboloid along one axis.
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
Computes the closest distance from given point to this shape.
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
Base abstract class for all shapes.
Definition TGeoShape.h:25
static Double_t Big()
Definition TGeoShape.h:94
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.
const char * GetName() const override
Get the shape name.
@ kGeoSavePrimitive
Definition TGeoShape.h:64
@ kGeoParaboloid
Definition TGeoShape.h:61
@ kGeoRunTimeShape
Definition TGeoShape.h:40
static Double_t Tolerance()
Definition TGeoShape.h:97
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:864
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
const Int_t n
Definition legend1.C:16
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:251
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Definition TMathBase.h:176
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:657
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Definition TMath.h:82
Double_t Sqrt(Double_t x)
Returns the square root of x.
Definition TMath.h:673
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:199
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:605
constexpr Double_t Pi()
Definition TMath.h:40
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition TMath.h:599
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Definition TMath.h:611
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:124
auto * tt
Definition textangle.C:16
static uint64_t sum(uint64_t i)
Definition Factory.cxx:2339