Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoPcon.h
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 24/10/01
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#ifndef ROOT_TGeoPcon
13#define ROOT_TGeoPcon
14
15#include "TGeoBBox.h"
16
17class TGeoPcon : public TGeoBBox {
18protected:
19 // data members
20 Int_t fNz = 0; // number of z planes (at least two)
21 Double_t fPhi1 = 0; // lower phi limit (converted to [0,2*pi)
22 Double_t fDphi = 0; // phi range
23 Double_t *fRmin = nullptr; //[fNz] pointer to array of inner radii
24 Double_t *fRmax = nullptr; //[fNz] pointer to array of outer radii
25 Double_t *fZ = nullptr; //[fNz] pointer to array of Z planes positions
26 Bool_t fFullPhi = false; //! Full phi range flag
27 Double_t fC1 = 0; //! Cosine of phi1
28 Double_t fS1 = 0; //! Sine of phi1
29 Double_t fC2 = 0; //! Cosine of phi1+dphi
30 Double_t fS2 = 0; //! Sine of phi1+dphi
31 Double_t fCm = 0; //! Cosine of (phi1+phi2)/2
32 Double_t fSm = 0; //! Sine of (phi1+phi2)/2
33 Double_t fCdphi = 0; //! Cosine of dphi
34
35 // methods
36 TGeoPcon(const TGeoPcon &) = delete;
37 TGeoPcon &operator=(const TGeoPcon &) = delete;
38
41
42public:
43 // constructors
45 TGeoPcon(const char *name) : TGeoBBox(name, 0, 0, 0) {}
47 TGeoPcon(const char *name, Double_t phi, Double_t dphi, Int_t nz);
49 // destructor
50 ~TGeoPcon() override;
51 // methods
52 Double_t Capacity() const override;
53 void ComputeBBox() override;
54 void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override;
55 void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
56 Bool_t Contains(const Double_t *point) const override;
57 void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
58 virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax);
59 Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
60 Double_t *safe = nullptr) const override;
61 void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
62 Double_t *step) const override;
63 Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
64 Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
65 void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
66 Double_t *step) const override;
67 Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const;
70 Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
71 const char *GetAxisName(Int_t iaxis) const override;
72 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
73 void GetBoundingCylinder(Double_t *param) const override;
74 const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
75 Int_t GetByteCount() const override { return 60 + 12 * fNz; }
76 Double_t GetPhi1() const { return fPhi1; }
77 Double_t GetDphi() const { return fDphi; }
78 Int_t GetNz() const { return fNz; }
79 virtual Int_t GetNsegments() const;
80 Double_t *GetRmin() const { return fRmin; }
82 Double_t *GetRmax() const { return fRmax; }
84 Double_t *GetZ() const { return fZ; }
85 Double_t GetZ(Int_t ipl) const;
86 TGeoShape *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMatrix * /*mat*/) const override { return nullptr; }
87 Int_t GetNmeshVertices() const override;
88 Bool_t GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const override { return kFALSE; }
89 void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
90 void InspectShape() const override;
91 Bool_t IsCylType() const override { return kTRUE; }
92 TBuffer3D *MakeBuffer3D() const override;
93 Double_t &Phi1() { return fPhi1; }
94 Double_t &Dphi() { return fDphi; }
95 Double_t &Rmin(Int_t ipl) { return fRmin[ipl]; }
96 Double_t &Rmax(Int_t ipl) { return fRmax[ipl]; }
97 Double_t &Z(Int_t ipl) { return fZ[ipl]; }
98 Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
99 void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
101 SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in = kTRUE, Double_t safmin = TGeoShape::Big()) const;
102 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
103 void SetDimensions(Double_t *param) override;
104 void SetPoints(Double_t *points) const override;
105 void SetPoints(Float_t *points) const override;
106 void SetSegsAndPols(TBuffer3D &buff) const override;
107 void Sizeof3D() const override;
108
109 ClassDefOverride(TGeoPcon, 1) // polycone class
110};
111
112#endif
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 ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t option
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
Generic 3D primitive description class.
Definition TBuffer3D.h:18
Geometrical transformation package.
Definition TGeoMatrix.h:38
Double_t fSm
Cosine of (phi1+phi2)/2.
Definition TGeoPcon.h:32
Double_t * GetRmax() const
Definition TGeoPcon.h:82
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override
Double_t & Rmin(Int_t ipl)
Definition TGeoPcon.h:95
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Double_t GetRmax(Int_t ipl) const
Double_t GetDphi() const
Definition TGeoPcon.h:77
Double_t & Rmax(Int_t ipl)
Definition TGeoPcon.h:96
Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const
Double_t * fRmax
Definition TGeoPcon.h:24
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void SetPoints(Double_t *points) const override
virtual Int_t GetNsegments() const
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
TBuffer3D * MakeBuffer3D() const override
Bool_t Contains(const Double_t *point) const override
Bool_t GetPointsOnSegments(Int_t, Double_t *) const override
Definition TGeoPcon.h:88
const char * GetAxisName(Int_t iaxis) const override
Int_t GetByteCount() const override
Definition TGeoPcon.h:75
Double_t * fRmin
Definition TGeoPcon.h:23
Double_t Capacity() const override
Int_t GetNmeshVertices() const override
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Int_t fNz
Definition TGeoPcon.h:20
Double_t * fZ
Definition TGeoPcon.h:25
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
Double_t fC1
Full phi range flag.
Definition TGeoPcon.h:27
void InspectShape() const override
void SetDimensions(Double_t *param) override
TGeoShape * GetMakeRuntimeShape(TGeoShape *, TGeoMatrix *) const override
Definition TGeoPcon.h:86
Double_t fCdphi
Sine of (phi1+phi2)/2.
Definition TGeoPcon.h:33
Bool_t fFullPhi
Definition TGeoPcon.h:26
Double_t fS1
Cosine of phi1.
Definition TGeoPcon.h:28
Bool_t IsCylType() const override
Definition TGeoPcon.h:91
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
TGeoPcon(Double_t phi, Double_t dphi, Int_t nz)
Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const
Double_t GetZ(Int_t ipl) const
Double_t fCm
Sine of phi1+dphi.
Definition TGeoPcon.h:31
TGeoPcon(const char *name, Double_t phi, Double_t dphi, Int_t nz)
TGeoPcon & operator=(const TGeoPcon &)=delete
TGeoPcon(const TGeoPcon &)=delete
Cosine of dphi.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
~TGeoPcon() override
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
Double_t & Z(Int_t ipl)
Definition TGeoPcon.h:97
Double_t * GetZ() const
Definition TGeoPcon.h:84
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
TGeoPcon(const char *name)
Definition TGeoPcon.h:45
Bool_t HasInsideSurface() const
Double_t fPhi1
Definition TGeoPcon.h:21
Double_t & Phi1()
Definition TGeoPcon.h:93
void SetPoints(Float_t *points) const override
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Double_t & Dphi()
Definition TGeoPcon.h:94
Double_t fS2
Cosine of phi1+dphi.
Definition TGeoPcon.h:30
Double_t GetRmin(Int_t ipl) const
void SetSegsAndPolsNoInside(TBuffer3D &buff) const
Double_t fDphi
Definition TGeoPcon.h:22
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
void ComputeBBox() override
Double_t fC2
Sine of phi1.
Definition TGeoPcon.h:29
void Sizeof3D() const override
void SetSegsAndPols(TBuffer3D &buff) const override
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Stub implementation to avoid forcing implementation at this stage.
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
TGeoPcon(Double_t *params)
Int_t GetNz() const
Definition TGeoPcon.h:78
void GetBoundingCylinder(Double_t *param) const override
Double_t * GetRmin() const
Definition TGeoPcon.h:80
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Double_t GetPhi1() const
Definition TGeoPcon.h:76
Base abstract class for all shapes.
Definition TGeoShape.h:25
static Double_t Big()
Definition TGeoShape.h:87
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43