Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoEltu.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Mihaela Gheata 05/06/02
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 TGeoEltu
13\ingroup Tubes
14
15An elliptical tube is defined by the two semi-axes `A` and `B`. It ranges
16from `-dZ` to `+dZ` as all other tubes:
17
18~~~ {.cpp}
19TGeoEltu(Double_t a,Double_t b,Double_t dz);
20~~~
21
22Begin_Macro
23{
24 TCanvas *c = new TCanvas("c", "c",0,0,600,600);
25 new TGeoManager("eltu", "poza6");
26 TGeoMaterial *mat = new TGeoMaterial("Al", 26.98,13,2.7);
27 TGeoMedium *med = new TGeoMedium("MED",1,mat);
28 TGeoVolume *top = gGeoManager->MakeBox("TOP",med,100,100,100);
29 gGeoManager->SetTopVolume(top);
30 TGeoVolume *vol = gGeoManager->MakeEltu("ELTU",med, 30,10,40);
31 top->AddNode(vol,1);
32 gGeoManager->CloseGeometry();
33 gGeoManager->SetNsegments(50);
34 top->Draw();
35 TView *view = gPad->GetView();
36 if (view) view->ShowAxis();
37}
38End_Macro
39*/
40
41#include <iostream>
42
43#include "TGeoManager.h"
44#include "TGeoVolume.h"
45#include "TGeoEltu.h"
46#include "TBuffer3D.h"
47#include "TBuffer3DTypes.h"
48#include "TMath.h"
49
50
51////////////////////////////////////////////////////////////////////////////////
52/// Dummy constructor
53
58
59////////////////////////////////////////////////////////////////////////////////
60/// Default constructor specifying X and Y semiaxis length
61
68
69////////////////////////////////////////////////////////////////////////////////
70/// Default constructor specifying X and Y semiaxis length
71
79
80////////////////////////////////////////////////////////////////////////////////
81/// Default constructor specifying minimum and maximum radius
82/// param[0] = A
83/// param[1] = B
84/// param[2] = dz
85
92
93////////////////////////////////////////////////////////////////////////////////
94/// destructor
95
97
98////////////////////////////////////////////////////////////////////////////////
99/// Computes capacity of the shape in [length^3]
100
102{
103 Double_t capacity = 2. * TMath::Pi() * fDz * fRmin * fRmax;
104 return capacity;
105}
106
107////////////////////////////////////////////////////////////////////////////////
108/// compute bounding box of the tube
109
111{
112 fDX = fRmin;
113 fDY = fRmax;
114 fDZ = fDz;
115}
116
117////////////////////////////////////////////////////////////////////////////////
118/// Compute normal to closest surface from POINT.
119
120void TGeoEltu::ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const
121{
122 Double_t a = fRmin;
123 Double_t b = fRmax;
124 Double_t safr = TMath::Abs(TMath::Sqrt(point[0] * point[0] / (a * a) + point[1] * point[1] / (b * b)) - 1.);
125 safr *= TMath::Min(a, b);
126 Double_t safz = TMath::Abs(fDz - TMath::Abs(point[2]));
127 if (safz < safr) {
128 norm[0] = norm[1] = 0;
129 norm[2] = TMath::Sign(1., dir[2]);
130 return;
131 }
132 norm[2] = 0.;
133 norm[0] = point[0] * b * b;
134 norm[1] = point[1] * a * a;
136}
137
138////////////////////////////////////////////////////////////////////////////////
139/// test if point is inside the elliptical tube
140
142{
143 if (TMath::Abs(point[2]) > fDz)
144 return kFALSE;
145 Double_t r2 = (point[0] * point[0]) / (fRmin * fRmin) + (point[1] * point[1]) / (fRmax * fRmax);
146 if (r2 > 1.)
147 return kFALSE;
148 return kTRUE;
149}
150
151////////////////////////////////////////////////////////////////////////////////
152/// compute closest distance from point px,py to each vertex
153
160
161////////////////////////////////////////////////////////////////////////////////
162/// compute distance from inside point to surface of the tube
163
166{
168 Double_t b2 = fRmax * fRmax;
169 Double_t safz1 = fDz - point[2];
170 Double_t safz2 = fDz + point[2];
171
172 if (iact < 3 && safe) {
173 *safe = Safety(point, kTRUE);
174 if (iact == 0)
175 return TGeoShape::Big();
176 if ((iact == 1) && (*safe > step))
177 return TGeoShape::Big();
178 }
179 // compute distance to surface
180 // Do Z
182 if (dir[2] > 0) {
183 snxt = safz1 / dir[2];
184 } else {
185 if (dir[2] < 0)
186 snxt = -safz2 / dir[2];
187 }
188 Double_t sz = snxt;
189 Double_t xz = point[0] + dir[0] * sz;
190 Double_t yz = point[1] + dir[1] * sz;
191 if ((xz * xz / a2 + yz * yz / b2) <= 1)
192 return snxt;
193 // do elliptical surface
195 Double_t u = dir[0] * dir[0] * b2 + dir[1] * dir[1] * a2;
196 Double_t v = point[0] * dir[0] * b2 + point[1] * dir[1] * a2;
197 Double_t w = point[0] * point[0] * b2 + point[1] * point[1] * a2 - a2 * b2;
198 Double_t d = v * v - u * w;
199 if (d < 0 || TGeoShape::IsSameWithinTolerance(u, 0))
200 return tolerance;
202 snxt = (-v + sd) / u;
203
204 if (snxt < 0)
205 return tolerance;
206 return snxt;
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// compute distance from outside point to surface of the tube and safe distance
211
214{
215 Double_t safz = TMath::Abs(point[2]) - fDz;
217 Double_t b2 = fRmax * fRmax;
218 if (iact < 3 && safe) {
219 Double_t x0 = TMath::Abs(point[0]);
220 Double_t y0 = TMath::Abs(point[1]);
221 *safe = 0.;
222 if ((x0 * x0 / a2 + y0 * y0 / b2) >= 1) {
223 Double_t phi1 = 0;
224 Double_t phi2 = 0.5 * TMath::Pi();
226 Double_t x3 = 0., y3 = 0., d;
227 for (Int_t i = 0; i < 10; i++) {
228 phi3 = (phi1 + phi2) * 0.5;
229 x3 = fRmin * TMath::Cos(phi3);
230 y3 = fRmax * TMath::Sin(phi3);
231 d = y3 * a2 * (x0 - x3) - x3 * b2 * (y0 - y3);
232 if (d < 0)
233 phi1 = phi3;
234 else
235 phi2 = phi3;
236 }
237 *safe = TMath::Sqrt((x0 - x3) * (x0 - x3) + (y0 - y3) * (y0 - y3));
238 }
239 if (safz > 0) {
240 *safe = TMath::Sqrt((*safe) * (*safe) + safz * safz);
241 }
242 if (iact == 0)
243 return TGeoShape::Big();
244 if ((iact == 1) && (step < *safe))
245 return TGeoShape::Big();
246 }
247 // compute vector distance
248 Double_t zi, tau;
250 if (safz > -epsil) {
251 // point beyond the z limit (up or down)
252 // Check if direction is outgoing
253 if (point[2] * dir[2] > 0)
254 return TGeoShape::Big();
255 // Check if direction is perpendicular to Z axis
257 return TGeoShape::Big();
258 // select +z or -z depending on the side of the point
259 zi = (point[2] > 0) ? fDz : -fDz;
260 // Distance to zi plane position
261 tau = (zi - point[2]) / dir[2];
262 // Extrapolated coordinates at the z position of the end plane.
263 Double_t xz = point[0] + dir[0] * tau;
264 Double_t yz = point[1] + dir[1] * tau;
265 if ((xz * xz / a2 + yz * yz / b2) < 1)
266 return tau;
267 }
268
269 // Check if the bounding box is crossed within the requested distance
270 Double_t sdist = TGeoBBox::DistFromOutside(point, dir, fDX, fDY, fDZ, fOrigin, step);
271 if (sdist >= step)
272 return TGeoShape::Big();
273 Double_t u = dir[0] * dir[0] * b2 + dir[1] * dir[1] * a2; // positive
275 return TGeoShape::Big();
276 Double_t v = point[0] * dir[0] * b2 + point[1] * dir[1] * a2;
277 Double_t w = point[0] * point[0] * b2 + point[1] * point[1] * a2 - a2 * b2;
278 Double_t d = v * v - u * w;
279 if (d < 0)
280 return TGeoShape::Big();
282 // Biggest solution - if negative, or very close to boundary
283 // no crossing (just exiting, no re-entering possible)
284 tau = (-v + dsq) / u;
285 if (tau < epsil)
286 return TGeoShape::Big();
287 // only entering crossing must be considered (smallest)
288 tau = (-v - dsq) / u;
289 zi = point[2] + tau * dir[2];
290 // If the crossing point is not in the Z range, there is no crossing
291 if ((TMath::Abs(zi) - fDz) > 0)
292 return TGeoShape::Big();
293 // crossing is backwards (point inside the ellipse) in Z range
294 if (tau < 0)
295 return 0.;
296 // Point is outside and crossing the elliptical tube in Z range
297 return tau;
298}
299
300////////////////////////////////////////////////////////////////////////////////
301/// Divide the shape along one axis.
302
303TGeoVolume *TGeoEltu::Divide(TGeoVolume * /*voldiv*/, const char * /*divname*/, Int_t /*iaxis*/, Int_t /*ndiv*/,
304 Double_t /*start*/, Double_t /*step*/)
305{
306 Error("Divide", "Elliptical tubes divisions not implemented");
307 return nullptr;
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Fill vector param[4] with the bounding cylinder parameters. The order
312/// is the following : Rmin, Rmax, Phi1, Phi2
313
315{
316 param[0] = 0.; // Rmin
317 param[1] = TMath::Max(fRmin, fRmax); // Rmax
318 param[1] *= param[1];
319 param[2] = 0.; // Phi1
320 param[3] = 360.; // Phi2
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// in case shape has some negative parameters, these has to be computed
325/// in order to fit the mother
326
328{
330 return nullptr;
331 if (!mother->TestShapeBit(kGeoEltu)) {
332 Error("GetMakeRuntimeShape", "invalid mother");
333 return nullptr;
334 }
335 Double_t a, b, dz;
336 a = fRmin;
337 b = fRmax;
338 dz = fDz;
339 if (fDz < 0)
340 dz = ((TGeoEltu *)mother)->GetDz();
341 if (fRmin < 0)
342 a = ((TGeoEltu *)mother)->GetA();
343 if (fRmax < 0)
344 a = ((TGeoEltu *)mother)->GetB();
345
346 return (new TGeoEltu(a, b, dz));
347}
348
349////////////////////////////////////////////////////////////////////////////////
350/// print shape parameters
351
353{
354 printf("*** Shape %s: TGeoEltu ***\n", GetName());
355 printf(" A = %11.5f\n", fRmin);
356 printf(" B = %11.5f\n", fRmax);
357 printf(" dz = %11.5f\n", fDz);
358 printf(" Bounding box:\n");
360}
361
362////////////////////////////////////////////////////////////////////////////////
363/// computes the closest distance from given point to this shape, according
364/// to option. The matching point on the shape is stored in spoint.
365
366Double_t TGeoEltu::Safety(const Double_t *point, Bool_t /*in*/) const
367{
368 Double_t x0 = TMath::Abs(point[0]);
369 Double_t y0 = TMath::Abs(point[1]);
370 Double_t x1, y1, dx, dy;
374 Double_t sqdist = x0 * x0 / (fRmin * fRmin) + y0 * y0 / (fRmax * fRmax);
375 Bool_t in = kTRUE;
376 if (sqdist > onepls)
377 in = kFALSE;
378 else if (sqdist < onemin)
379 in = kTRUE;
380 else
381 return 0.;
382
383 if (in) {
384 // Within the elliptical projection, an outside point reaches the end cap first.
385 safz = fDz - TMath::Abs(point[2]);
386 if (safz < 0.)
387 return -safz;
388 x1 = fRmin * TMath::Sqrt(1. - (y0 * y0) / (fRmax * fRmax));
389 y1 = fRmax * TMath::Sqrt(1. - (x0 * x0) / (fRmin * fRmin));
390 dx = x1 - x0;
391 dy = y1 - y0;
393 return 0;
394 safr = dx * dy / TMath::Sqrt(dx * dx + dy * dy);
395 return TMath::Min(safr, safz);
396 }
397
398 if (TMath::Abs(x0) < TGeoShape::Tolerance()) {
399 safr = y0 - fRmax;
400 } else {
402 safr = x0 - fRmin;
403 } else {
404 Double_t f = fRmin * fRmax / TMath::Sqrt(x0 * x0 * fRmax * fRmax + y0 * y0 * fRmin * fRmin);
405 x1 = f * x0;
406 y1 = f * y0;
407 dx = x0 - x1;
408 dy = y0 - y1;
409 Double_t ast = fRmin * y1 / fRmax;
410 Double_t bct = fRmax * x1 / fRmin;
412 safr = (dx * bct + dy * ast) / d;
413 }
414 }
415 safz = TMath::Abs(point[2]) - fDz;
416 return TMath::Max(safr, safz);
417}
418
419////////////////////////////////////////////////////////////////////////////////
420/// Save a primitive as a C++ statement(s) on output stream "out".
421
422void TGeoEltu::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
423{
425 return;
426 out << " // Shape: " << GetName() << " type: " << ClassName() << std::endl;
427 out << " a = " << fRmin << ";" << std::endl;
428 out << " b = " << fRmax << ";" << std::endl;
429 out << " dz = " << fDz << ";" << std::endl;
430 out << " TGeoShape *" << GetPointerName() << " = new TGeoEltu(\"" << GetName() << "\",a,b,dz);" << std::endl;
432}
433
434////////////////////////////////////////////////////////////////////////////////
435/// Set dimensions of the elliptical tube.
436
438{
439 if ((a <= 0) || (b < 0) || (dz < 0)) {
441 }
442 fRmin = a;
443 fRmax = b;
444 fDz = dz;
445}
446
447////////////////////////////////////////////////////////////////////////////////
448/// Set shape dimensions starting from an array.
449
451{
452 Double_t a = param[0];
453 Double_t b = param[1];
454 Double_t dz = param[2];
456}
457
458////////////////////////////////////////////////////////////////////////////////
459/// Create elliptical tube mesh points
460
462{
463 Double_t dz;
464 Int_t j, n;
465
467 Double_t dphi = 360. / n;
468 Double_t phi = 0;
470 dz = fDz;
471
472 Int_t indx = 0;
473 Double_t r2, r;
475 Double_t b2 = fRmax * fRmax;
476
477 if (points) {
478 for (j = 0; j < n; j++) {
479 points[indx + 6 * n] = points[indx] = 0;
480 indx++;
481 points[indx + 6 * n] = points[indx] = 0;
482 indx++;
483 points[indx + 6 * n] = dz;
484 points[indx] = -dz;
485 indx++;
486 }
487 for (j = 0; j < n; j++) {
488 phi = j * dphi * TMath::DegToRad();
489 sph = TMath::Sin(phi);
490 cph = TMath::Cos(phi);
491 r2 = (a2 * b2) / (b2 + (a2 - b2) * sph * sph);
492 r = TMath::Sqrt(r2);
493 points[indx + 6 * n] = points[indx] = r * cph;
494 indx++;
495 points[indx + 6 * n] = points[indx] = r * sph;
496 indx++;
497 points[indx + 6 * n] = dz;
498 points[indx] = -dz;
499 indx++;
500 }
501 }
502}
503
504////////////////////////////////////////////////////////////////////////////////
505/// Returns numbers of vertices, segments and polygons composing the shape mesh.
506
511
512////////////////////////////////////////////////////////////////////////////////
513/// Returns the number of vertices on the mesh.
514
519
520////////////////////////////////////////////////////////////////////////////////
521/// Create elliptical tube mesh points
522
524{
525 Double_t dz;
526 Int_t j, n;
527
529 Double_t dphi = 360. / n;
530 Double_t phi = 0;
532 dz = fDz;
533
534 Int_t indx = 0;
535 Double_t r2, r;
537 Double_t b2 = fRmax * fRmax;
538
539 if (points) {
540 for (j = 0; j < n; j++) {
541 points[indx + 6 * n] = points[indx] = 0;
542 indx++;
543 points[indx + 6 * n] = points[indx] = 0;
544 indx++;
545 points[indx + 6 * n] = dz;
546 points[indx] = -dz;
547 indx++;
548 }
549 for (j = 0; j < n; j++) {
550 phi = j * dphi * TMath::DegToRad();
551 sph = TMath::Sin(phi);
552 cph = TMath::Cos(phi);
553 r2 = (a2 * b2) / (b2 + (a2 - b2) * sph * sph);
554 r = TMath::Sqrt(r2);
555 points[indx + 6 * n] = points[indx] = r * cph;
556 indx++;
557 points[indx + 6 * n] = points[indx] = r * sph;
558 indx++;
559 points[indx + 6 * n] = dz;
560 points[indx] = -dz;
561 indx++;
562 }
563 }
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Fills a static 3D buffer and returns a reference.
568
570{
571 static TBuffer3D buffer(TBuffer3DTypes::kGeneric);
573
576 Int_t nbPnts = 4 * n;
577 Int_t nbSegs = 8 * n;
578 Int_t nbPols = 4 * n;
579 if (buffer.SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 6 * nbPols)) {
581 }
582 }
584 SetPoints(buffer.fPnts);
585 if (!buffer.fLocalFrame) {
586 TransformPoints(buffer.fPnts, buffer.NbPnts());
587 }
588 SetSegsAndPols(buffer);
590 }
591
592 return buffer;
593}
594
595////////////////////////////////////////////////////////////////////////////////
596/// Check the inside status for each of the points in the array.
597/// Input: Array of point coordinates + vector size
598/// Output: Array of Booleans for the inside of each point
599
601{
602 for (Int_t i = 0; i < vecsize; i++)
603 inside[i] = Contains(&points[3 * i]);
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Compute the normal for an array o points so that norm.dot.dir is positive
608/// Input: Arrays of point coordinates and directions + vector size
609/// Output: Array of normal directions
610
612{
613 for (Int_t i = 0; i < vecsize; i++)
614 ComputeNormal(&points[3 * i], &dirs[3 * i], &norms[3 * i]);
615}
616
617////////////////////////////////////////////////////////////////////////////////
618/// Compute distance from array of input points having directions specified by dirs. Store output in dists
619
621 Double_t *step) const
622{
623 for (Int_t i = 0; i < vecsize; i++)
624 dists[i] = DistFromInside(&points[3 * i], &dirs[3 * i], 3, step[i]);
625}
626
627////////////////////////////////////////////////////////////////////////////////
628/// Compute distance from array of input points having directions specified by dirs. Store output in dists
629
631 Double_t *step) const
632{
633 for (Int_t i = 0; i < vecsize; i++)
634 dists[i] = DistFromOutside(&points[3 * i], &dirs[3 * i], 3, step[i]);
635}
636
637////////////////////////////////////////////////////////////////////////////////
638/// Compute safe distance from each of the points in the input array.
639/// Input: Array of point coordinates, array of statuses for these points, size of the arrays
640/// Output: Safety values
641
642void TGeoEltu::Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
643{
644 for (Int_t i = 0; i < vecsize; i++)
645 safe[i] = Safety(&points[3 * i], inside[i]);
646}
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
#define a(i)
Definition RSha256.hxx:99
std::size_t capacity
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
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 x1
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t TPoint TPoint const char y1
char name[80]
Definition TGX11.cxx:142
R__EXTERN TGeoManager * gGeoManager
Generic 3D primitive description class.
Definition TBuffer3D.h:18
UInt_t NbPnts() const
Definition TBuffer3D.h:89
Bool_t SectionsValid(UInt_t mask) const
Definition TBuffer3D.h:76
void SetSectionsValid(UInt_t mask)
Definition TBuffer3D.h:74
Bool_t fLocalFrame
Definition TBuffer3D.h:99
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:122
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:21
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 box.
Definition TGeoBBox.cxx:431
Double_t fOrigin[3]
Definition TGeoBBox.h:24
void InspectShape() const override
Prints shape parameters.
Definition TGeoBBox.cxx:845
Double_t fDY
Definition TGeoBBox.h:22
Double_t fDZ
Definition TGeoBBox.h:23
An elliptical tube is defined by the two semi-axes A and B.
Definition TGeoEltu.h:17
void ComputeBBox() override
compute bounding box of the tube
Definition TGeoEltu.cxx:110
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.
Definition TGeoEltu.cxx:642
void SetDimensions(Double_t *param) override
Set shape dimensions starting from an array.
Definition TGeoEltu.cxx:450
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...
Definition TGeoEltu.cxx:620
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
Definition TGeoEltu.cxx:507
void SetPoints(Double_t *points) const override
Create elliptical tube mesh points.
Definition TGeoEltu.cxx:461
~TGeoEltu() override
destructor
Definition TGeoEltu.cxx:96
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 tube and safe distance
Definition TGeoEltu.cxx:213
Double_t Capacity() const override
Computes capacity of the shape in [length^3].
Definition TGeoEltu.cxx:101
TGeoEltu()
Dummy constructor.
Definition TGeoEltu.cxx:54
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each vertex
Definition TGeoEltu.cxx:154
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...
Definition TGeoEltu.cxx:611
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
Definition TGeoEltu.cxx:327
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...
Definition TGeoEltu.cxx:630
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 tube
Definition TGeoEltu.cxx:165
void GetBoundingCylinder(Double_t *param) const override
Fill vector param[4] with the bounding cylinder parameters.
Definition TGeoEltu.cxx:314
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
Definition TGeoEltu.cxx:569
Int_t GetNmeshVertices() const override
Returns the number of vertices on the mesh.
Definition TGeoEltu.cxx:515
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT.
Definition TGeoEltu.cxx:120
void SetEltuDimensions(Double_t a, Double_t b, Double_t dz)
Set dimensions of the elliptical tube.
Definition TGeoEltu.cxx:437
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Definition TGeoEltu.cxx:422
void InspectShape() const override
print shape parameters
Definition TGeoEltu.cxx:352
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide the shape along one axis.
Definition TGeoEltu.cxx:303
Bool_t Contains(const Double_t *point) const override
test if point is inside the elliptical tube
Definition TGeoEltu.cxx:141
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.
Definition TGeoEltu.cxx:600
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point to this shape, according to option.
Definition TGeoEltu.cxx:366
Int_t GetNsegments() const
Get number of segments approximating circles.
Geometrical transformation package.
Definition TGeoMatrix.h:39
Base abstract class for all shapes.
Definition TGeoShape.h:25
static Double_t Big()
Definition TGeoShape.h:95
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.
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
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:65
@ kGeoRunTimeShape
Definition TGeoShape.h:40
static Double_t Tolerance()
Definition TGeoShape.h:98
Bool_t TestShapeBit(UInt_t f) const
Definition TGeoShape.h:177
Cylindrical tube class.
Definition TGeoTube.h:17
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
Double_t fRmin
Definition TGeoTube.h:20
Double_t fDz
Definition TGeoTube.h:22
Double_t fRmax
Definition TGeoTube.h:21
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
Definition TGeoTube.cxx:686
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:45
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
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:886
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:249
Float_t Normalize(Float_t v[3])
Normalize a vector v in place.
Definition TMath.cxx:518
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Definition TMathBase.h:174
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:675
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition TMathBase.h:197
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition TMath.h:607
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:601
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Definition TMathBase.h:122