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
62
63////////////////////////////////////////////////////////////////////////////////
64/// Dummy constructor
65
67{
68 fRlo = 0;
69 fRhi = 0;
70 fDz = 0;
71 fA = 0;
72 fB = 0;
74}
75
76////////////////////////////////////////////////////////////////////////////////
77/// Default constructor specifying X and Y semiaxis length
78
90
91////////////////////////////////////////////////////////////////////////////////
92/// Default constructor specifying X and Y semiaxis length
93
95{
96 fRlo = 0;
97 fRhi = 0;
98 fDz = 0;
99 fA = 0;
100 fB = 0;
103 ComputeBBox();
104}
105
106////////////////////////////////////////////////////////////////////////////////
107/// Default constructor specifying minimum and maximum radius
108/// - param[0] = rlo
109/// - param[1] = rhi
110/// - param[2] = dz
111
118
119////////////////////////////////////////////////////////////////////////////////
120/// destructor
121
123
124////////////////////////////////////////////////////////////////////////////////
125/// Computes capacity of the shape in [length^3]
126
128{
129 Double_t capacity = TMath::Pi() * fDz * (fRlo * fRlo + fRhi * fRhi);
130 return capacity;
131}
132
133////////////////////////////////////////////////////////////////////////////////
134/// compute bounding box of the tube
135
137{
139 fDY = fDX;
140 fDZ = fDz;
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// Compute normal to closest surface from POINT.
145
146void TGeoParaboloid::ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const
147{
148 norm[0] = norm[1] = 0.0;
149 if (TMath::Abs(point[2]) > fDz) {
150 norm[2] = TMath::Sign(1., dir[2]);
151 return;
152 }
153 Double_t safz = fDz - TMath::Abs(point[2]);
154 Double_t r = TMath::Sqrt(point[0] * point[0] + point[1] * point[1]);
155 Double_t safr = TMath::Abs(r - TMath::Sqrt((point[2] - fB) / fA));
156 if (safz < safr) {
157 norm[2] = TMath::Sign(1., dir[2]);
158 return;
159 }
160 Double_t talf = -2. * fA * r;
161 Double_t calf = 1. / TMath::Sqrt(1. + talf * talf);
163 Double_t phi = TMath::ATan2(point[1], point[0]);
164
165 norm[0] = salf * TMath::Cos(phi);
166 norm[1] = salf * TMath::Sin(phi);
167 norm[2] = calf;
168 Double_t ndotd = norm[0] * dir[0] + norm[1] * dir[1] + norm[2] * dir[2];
169 if (ndotd < 0) {
170 norm[0] = -norm[0];
171 norm[1] = -norm[1];
172 norm[2] = -norm[2];
173 }
174}
175
176////////////////////////////////////////////////////////////////////////////////
177/// test if point is inside the elliptical tube
178
180{
181 if (TMath::Abs(point[2]) > fDz)
182 return kFALSE;
183 Double_t aa = fA * (point[2] - fB);
184 if (aa < 0)
185 return kFALSE;
186 Double_t rsq = point[0] * point[0] + point[1] * point[1];
187 if (aa < fA * fA * rsq)
188 return kFALSE;
189 return kTRUE;
190}
191
192////////////////////////////////////////////////////////////////////////////////
193/// compute closest distance from point px,py to each vertex
194
196{
198 const Int_t numPoints = n * (n + 1) + 2;
199 return ShapeDistancetoPrimitive(numPoints, px, py);
200}
201
202////////////////////////////////////////////////////////////////////////////////
203/// Compute distance from a point to the parabola given by:
204/// `z = a*rsq + b; rsq = x*x+y*y`
205
207{
208 Double_t rsq = point[0] * point[0] + point[1] * point[1];
209 Double_t a = fA * (dir[0] * dir[0] + dir[1] * dir[1]);
210 Double_t b = 2. * fA * (point[0] * dir[0] + point[1] * dir[1]) - dir[2];
211 Double_t c = fA * rsq + fB - point[2];
212 Double_t dist = TGeoShape::Big();
215 return dist; // big
216 dist = -c / b;
217 if (dist < 0)
218 return TGeoShape::Big();
219 return dist; // OK
220 }
221 Double_t ainv = 1. / a;
222 Double_t sum = -b * ainv;
223 Double_t prod = c * ainv;
224 Double_t delta = sum * sum - 4. * prod;
225 if (delta < 0)
226 return dist; // big
227 delta = TMath::Sqrt(delta);
229 Int_t i = -1;
230 while (i < 2) {
231 dist = 0.5 * (sum + i * sone * delta);
232 i += 2;
233 if (dist < 0)
234 continue;
235 if (dist < 1.E-8) {
236 Double_t talf = -2. * fA * TMath::Sqrt(rsq);
237 Double_t phi = TMath::ATan2(point[1], point[0]);
238 Double_t ndotd = talf * (TMath::Cos(phi) * dir[0] + TMath::Sin(phi) * dir[1]) + dir[2];
239 if (!in)
240 ndotd *= -1;
241 if (ndotd < 0)
242 return dist;
243 } else
244 return dist;
245 }
246 return TGeoShape::Big();
247}
248
249////////////////////////////////////////////////////////////////////////////////
250/// compute distance from inside point to surface of the paraboloid
251
253 Double_t *safe) const
254{
255 if (iact < 3 && safe) {
256 // compute safe distance
257 *safe = Safety(point, kTRUE);
258 if (iact == 0)
259 return TGeoShape::Big();
260 if (iact == 1 && step < *safe)
261 return TGeoShape::Big();
262 }
263
265 if (dir[2] < 0) {
266 dz = -(point[2] + fDz) / dir[2];
267 } else if (dir[2] > 0) {
268 dz = (fDz - point[2]) / dir[2];
269 }
270 Double_t dpara = DistToParaboloid(point, dir, kTRUE);
271 return TMath::Min(dz, dpara);
272}
273
274////////////////////////////////////////////////////////////////////////////////
275/// compute distance from outside point to surface of the paraboloid and safe distance
276
278 Double_t *safe) const
279{
280 if (iact < 3 && safe) {
281 // compute safe distance
282 *safe = Safety(point, kFALSE);
283 if (iact == 0)
284 return TGeoShape::Big();
285 if (iact == 1 && step < *safe)
286 return TGeoShape::Big();
287 }
289 if (point[2] <= -fDz) {
290 if (dir[2] <= 0)
291 return TGeoShape::Big();
292 Double_t snxt = -(fDz + point[2]) / dir[2];
293 // find extrapolated X and Y
294 xnew = point[0] + snxt * dir[0];
295 ynew = point[1] + snxt * dir[1];
296 if ((xnew * xnew + ynew * ynew) <= fRlo * fRlo)
297 return snxt;
298 } else if (point[2] >= fDz) {
299 if (dir[2] >= 0)
300 return TGeoShape::Big();
301 Double_t snxt = (fDz - point[2]) / dir[2];
302 // find extrapolated X and Y
303 xnew = point[0] + snxt * dir[0];
304 ynew = point[1] + snxt * dir[1];
305 if ((xnew * xnew + ynew * ynew) <= fRhi * fRhi)
306 return snxt;
307 }
308 Double_t snxt = DistToParaboloid(point, dir, kFALSE);
309 if (snxt > 1E20)
310 return snxt;
311 znew = point[2] + snxt * dir[2];
312 if (TMath::Abs(znew) <= fDz)
313 return snxt;
314 return TGeoShape::Big();
315}
316
317////////////////////////////////////////////////////////////////////////////////
318/// Divide the paraboloid along one axis.
319
320TGeoVolume *TGeoParaboloid::Divide(TGeoVolume * /*voldiv*/, const char * /*divname*/, Int_t /*iaxis*/, Int_t /*ndiv*/,
321 Double_t /*start*/, Double_t /*step*/)
322{
323 Error("Divide", "Paraboloid divisions not implemented");
324 return nullptr;
325}
326
327////////////////////////////////////////////////////////////////////////////////
328/// Fill vector param[4] with the bounding cylinder parameters. The order
329/// is the following : Rmin, Rmax, Phi1, Phi2
330
332{
333 param[0] = 0.; // Rmin
334 param[1] = fDX; // Rmax
335 param[1] *= param[1];
336 param[2] = 0.; // Phi1
337 param[3] = 360.; // Phi2
338}
339
340////////////////////////////////////////////////////////////////////////////////
341/// in case shape has some negative parameters, these has to be computed
342/// in order to fit the mother
343
345{
346 return nullptr;
347}
348
349////////////////////////////////////////////////////////////////////////////////
350/// print shape parameters
351
353{
354 printf("*** Shape %s: TGeoParaboloid ***\n", GetName());
355 printf(" rlo = %11.5f\n", fRlo);
356 printf(" rhi = %11.5f\n", fRhi);
357 printf(" dz = %11.5f\n", fDz);
358 printf(" Bounding box:\n");
360}
361
362////////////////////////////////////////////////////////////////////////////////
363/// Creates a TBuffer3D describing *this* shape.
364/// Coordinates are in local reference frame.
365
367{
369 Int_t nbPnts = n * (n + 1) + 2;
370 Int_t nbSegs = n * (2 * n + 3);
371 Int_t nbPols = n * (n + 2);
372
373 TBuffer3D *buff =
374 new TBuffer3D(TBuffer3DTypes::kGeneric, nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 2 * n * 5 + n * n * 6);
375
376 if (buff) {
377 SetPoints(buff->fPnts);
379 }
380
381 return buff;
382}
383
384////////////////////////////////////////////////////////////////////////////////
385/// Fill TBuffer3D structure for segments and polygons.
386
388{
389 Int_t indx, i, j;
391
393
394 Int_t nn1 = (n + 1) * n + 1;
395 indx = 0;
396 // Lower end-cap (n radial segments)
397 for (j = 0; j < n; j++) {
398 buff.fSegs[indx++] = c + 2;
399 buff.fSegs[indx++] = 0;
400 buff.fSegs[indx++] = j + 1;
401 }
402 // Sectors (n)
403 for (i = 0; i < n + 1; i++) {
404 // lateral (circles) segments (n)
405 for (j = 0; j < n; j++) {
406 buff.fSegs[indx++] = c;
407 buff.fSegs[indx++] = n * i + 1 + j;
408 buff.fSegs[indx++] = n * i + 1 + ((j + 1) % n);
409 }
410 if (i == n)
411 break; // skip i=n for generators
412 // generator segments (n)
413 for (j = 0; j < n; j++) {
414 buff.fSegs[indx++] = c;
415 buff.fSegs[indx++] = n * i + 1 + j;
416 buff.fSegs[indx++] = n * (i + 1) + 1 + j;
417 }
418 }
419 // Upper end-cap
420 for (j = 0; j < n; j++) {
421 buff.fSegs[indx++] = c + 1;
422 buff.fSegs[indx++] = n * n + 1 + j;
423 buff.fSegs[indx++] = nn1;
424 }
425
426 indx = 0;
427
428 // lower end-cap (n polygons)
429 for (j = 0; j < n; j++) {
430 buff.fPols[indx++] = c + 2;
431 buff.fPols[indx++] = 3;
432 buff.fPols[indx++] = n + j;
433 buff.fPols[indx++] = (j + 1) % n;
434 buff.fPols[indx++] = j;
435 }
436 // Sectors (n)
437 for (i = 0; i < n; i++) {
438 // lateral faces (n)
439 for (j = 0; j < n; j++) {
440 buff.fPols[indx++] = c;
441 buff.fPols[indx++] = 4;
442 buff.fPols[indx++] = (2 * i + 1) * n + j;
443 buff.fPols[indx++] = 2 * (i + 1) * n + j;
444 buff.fPols[indx++] = (2 * i + 3) * n + j;
445 buff.fPols[indx++] = 2 * (i + 1) * n + ((j + 1) % n);
446 }
447 }
448 // upper end-cap (n polygons)
449 for (j = 0; j < n; j++) {
450 buff.fPols[indx++] = c + 1;
451 buff.fPols[indx++] = 3;
452 buff.fPols[indx++] = 2 * n * (n + 1) + j;
453 buff.fPols[indx++] = 2 * n * (n + 1) + ((j + 1) % n);
454 buff.fPols[indx++] = (2 * n + 1) * n + j;
455 }
456}
457
458////////////////////////////////////////////////////////////////////////////////
459/// Computes the closest distance from given point to this shape.
460
462{
463 Double_t safz = fDz - TMath::Abs(point[2]);
464 if (!in)
465 safz = -safz;
467 Double_t rsq = point[0] * point[0] + point[1] * point[1];
468 Double_t z0 = fA * rsq + fB;
469 Double_t r0sq = (point[2] - fB) / fA;
470 if (r0sq < 0) {
471 if (in)
472 return 0.;
473 return safz;
474 }
476 if (in) {
477 if (dr > -1.E-8)
478 return 0.;
479 Double_t dz = TMath::Abs(point[2] - z0);
480 safr = -dr * dz / TMath::Sqrt(dr * dr + dz * dz);
481 } else {
482 if (dr < 1.E-8)
483 return safz;
484 Double_t talf = -2. * fA * TMath::Sqrt(r0sq);
486 safr = TMath::Abs(dr * salf);
487 }
488 if (in)
489 return TMath::Min(safr, safz);
490 return TMath::Max(safr, safz);
491}
492
493////////////////////////////////////////////////////////////////////////////////
494/// Set paraboloid dimensions.
495
497{
498 if ((rlo < 0) || (rhi < 0) || (dz <= 0) || TMath::Abs(rlo - rhi) < TGeoShape::Tolerance()) {
500 Error("SetParaboloidDimensions", "Dimensions of %s invalid: check (rlo>=0) (rhi>=0) (rlo!=rhi) dz>0", GetName());
501 return;
502 }
503 fRlo = rlo;
504 fRhi = rhi;
505 fDz = dz;
506 Double_t dd = 1. / (fRhi * fRhi - fRlo * fRlo);
507 fA = 2. * fDz * dd;
508 fB = -fDz * (fRlo * fRlo + fRhi * fRhi) * dd;
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// Set paraboloid dimensions starting from an array.
513
515{
516 Double_t rlo = param[0];
517 Double_t rhi = param[1];
518 Double_t dz = param[2];
520}
521
522////////////////////////////////////////////////////////////////////////////////
523/// Create paraboloid mesh points.
524/// ~~~ {.cpp}
525/// Npoints = n*(n+1) + 2
526/// ifirst = 0
527/// ipoint(i,j) = 1+i*n+j; i=[0,n] j=[0,n-1]
528/// ilast = 1+n*(n+1)
529/// Nsegments = n*(2*n+3)
530/// lower: (0, j+1); j=[0,n-1]
531/// circle(i): (n*i+1+j, n*i+1+(j+1)%n); i=[0,n] j=[0,n-1]
532/// generator(i): (n*i+1+j, n*(i+1)+1+j); i,j=[0,n-1]
533/// upper: (n*n+1+j, (n+1)*n+1) j=[0,n-1]
534/// Npolygons = n*(n+2)
535/// lower: (n+j, (j+1)%n, j) j=[0,n-1]
536/// lateral(i): ((2*i+1)*n+j, 2*(i+1)*n+j, (2*i+3)*n+j, 2*(i+1)*n+(j+1)%n)
537/// i,j = [0,n-1]
538/// upper: ((2n+1)*n+j, 2*n*(n+1)+(j+1)%n, 2*n*(n+1)+j) j=[0,n-1]
539/// ~~~
540
542{
543 if (!points)
544 return;
549 Double_t dtt = (ttmax - ttmin) / n;
550 Double_t dphi = 360. / n;
551 Double_t tt;
552 Double_t r, z, delta;
553 Double_t phi, sph, cph;
554 Int_t indx = 0;
555 // center of the lower endcap:
556 points[indx++] = 0; // x
557 points[indx++] = 0; // y
558 points[indx++] = -fDz;
559 for (Int_t i = 0; i < n + 1; i++) { // nz planes = n+1
560 if (i == 0) {
561 r = fRlo;
562 z = -fDz;
563 } else if (i == n) {
564 r = fRhi;
565 z = fDz;
566 } else {
567 tt = TMath::Tan(ttmin + i * dtt);
568 delta = tt * tt - 4 * fA * fB; // should be always positive (a*b<0)
569 r = 0.5 * (tt + TMath::Sqrt(delta)) / fA;
570 z = r * tt;
571 }
572 for (Int_t j = 0; j < n; j++) {
573 phi = j * dphi * TMath::DegToRad();
574 sph = TMath::Sin(phi);
575 cph = TMath::Cos(phi);
576 points[indx++] = r * cph;
577 points[indx++] = r * sph;
578 points[indx++] = z;
579 }
580 }
581 // center of the upper endcap
582 points[indx++] = 0; // x
583 points[indx++] = 0; // y
584 points[indx++] = fDz;
585}
586
587////////////////////////////////////////////////////////////////////////////////
588/// Returns numbers of vertices, segments and polygons composing the shape mesh.
589
591{
593 nvert = n * (n + 1) + 2;
594 nsegs = n * (2 * n + 3);
595 npols = n * (n + 2);
596}
597
598////////////////////////////////////////////////////////////////////////////////
599/// Returns number of vertices on the paraboloid mesh.
600
602{
604 return (n * (n + 1) + 2);
605}
606
607////////////////////////////////////////////////////////////////////////////////
608/// Save a primitive as a C++ statement(s) on output stream "out".
609
610void TGeoParaboloid::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
611{
613 return;
614 out << " // Shape: " << GetName() << " type: " << ClassName() << std::endl;
615 out << " rlo = " << fRlo << ";" << std::endl;
616 out << " rhi = " << fRhi << ";" << std::endl;
617 out << " dz = " << fDZ << ";" << std::endl;
618 out << " TGeoShape *" << GetPointerName() << " = new TGeoParaboloid(\"" << GetName() << "\", rlo,rhi,dz);"
619 << std::endl;
621}
622
623////////////////////////////////////////////////////////////////////////////////
624/// Create paraboloid mesh points.
625
627{
628 if (!points)
629 return;
634 Double_t dtt = (ttmax - ttmin) / n;
635 Double_t dphi = 360. / n;
636 Double_t tt;
637 Double_t r, z, delta;
638 Double_t phi, sph, cph;
639 Int_t indx = 0;
640 // center of the lower endcap:
641 points[indx++] = 0; // x
642 points[indx++] = 0; // y
643 points[indx++] = -fDz;
644 for (Int_t i = 0; i < n + 1; i++) { // nz planes = n+1
645 if (i == 0) {
646 r = fRlo;
647 z = -fDz;
648 } else if (i == n) {
649 r = fRhi;
650 z = fDz;
651 } else {
652 tt = TMath::Tan(ttmin + i * dtt);
653 delta = tt * tt - 4 * fA * fB; // should be always positive (a*b<0)
654 r = 0.5 * (tt + TMath::Sqrt(delta)) / fA;
655 z = r * tt;
656 }
657 for (Int_t j = 0; j < n; j++) {
658 phi = j * dphi * TMath::DegToRad();
659 sph = TMath::Sin(phi);
660 cph = TMath::Cos(phi);
661 points[indx++] = r * cph;
662 points[indx++] = r * sph;
663 points[indx++] = z;
664 }
665 }
666 // center of the upper endcap
667 points[indx++] = 0; // x
668 points[indx++] = 0; // y
669 points[indx++] = fDz;
670}
671
672////////////////////////////////////////////////////////////////////////////////
674
675////////////////////////////////////////////////////////////////////////////////
676/// Fills a static 3D buffer and returns a reference.
677
679{
680 static TBuffer3D buffer(TBuffer3DTypes::kGeneric);
682
685 Int_t nbPnts = n * (n + 1) + 2;
686 Int_t nbSegs = n * (2 * n + 3);
687 Int_t nbPols = n * (n + 2);
688 if (buffer.SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 2 * n * 5 + n * n * 6)) {
690 }
691 }
693 SetPoints(buffer.fPnts);
694 if (!buffer.fLocalFrame) {
695 TransformPoints(buffer.fPnts, buffer.NbPnts());
696 }
697 SetSegsAndPols(buffer);
699 }
700
701 return buffer;
702}
703
704////////////////////////////////////////////////////////////////////////////////
705/// Check the inside status for each of the points in the array.
706/// Input: Array of point coordinates + vector size
707/// Output: Array of Booleans for the inside of each point
708
710{
711 for (Int_t i = 0; i < vecsize; i++)
712 inside[i] = Contains(&points[3 * i]);
713}
714
715////////////////////////////////////////////////////////////////////////////////
716/// Compute the normal for an array o points so that norm.dot.dir is positive
717/// Input: Arrays of point coordinates and directions + vector size
718/// Output: Array of normal directions
719
721{
722 for (Int_t i = 0; i < vecsize; i++)
723 ComputeNormal(&points[3 * i], &dirs[3 * i], &norms[3 * i]);
724}
725
726////////////////////////////////////////////////////////////////////////////////
727/// Compute distance from array of input points having directions specified by dirs. Store output in dists
728
730 Double_t *step) const
731{
732 for (Int_t i = 0; i < vecsize; i++)
733 dists[i] = DistFromInside(&points[3 * i], &dirs[3 * i], 3, step[i]);
734}
735
736////////////////////////////////////////////////////////////////////////////////
737/// Compute distance from array of input points having directions specified by dirs. Store output in dists
738
740 Double_t *step) const
741{
742 for (Int_t i = 0; i < vecsize; i++)
743 dists[i] = DistFromOutside(&points[3 * i], &dirs[3 * i], 3, step[i]);
744}
745
746////////////////////////////////////////////////////////////////////////////////
747/// Compute safe distance from each of the points in the input array.
748/// Input: Array of point coordinates, array of statuses for these points, size of the arrays
749/// Output: Safety values
750
752{
753 for (Int_t i = 0; i < vecsize; i++)
754 safe[i] = Safety(&points[3 * i], inside[i]);
755}
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:374
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:811
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
A paraboloid is defined by the revolution surface generated by a parabola and is bounded by two plane...
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:205
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:250
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:650
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:666
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:598
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:592
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Definition TMath.h:604
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:123
auto * tt
Definition textangle.C:16
static uint64_t sum(uint64_t i)
Definition Factory.cxx:2345