Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
17 class TGeoPcon : public TGeoBBox
18 {
19 protected:
20  // data members
21  Int_t fNz; // number of z planes (at least two)
22  Double_t fPhi1; // lower phi limit (converted to [0,2*pi)
23  Double_t fDphi; // phi range
24  Double_t *fRmin; //[fNz] pointer to array of inner radii
25  Double_t *fRmax; //[fNz] pointer to array of outer radii
26  Double_t *fZ; //[fNz] pointer to array of Z planes positions
27  Bool_t fFullPhi; //! Full phi range flag
28  Double_t fC1; //! Cosine of phi1
29  Double_t fS1; //! Sine of phi1
30  Double_t fC2; //! Cosine of phi1+dphi
31  Double_t fS2; //! Sine of phi1+dphi
32  Double_t fCm; //! Cosine of (phi1+phi2)/2
33  Double_t fSm; //! Sine of (phi1+phi2)/2
34  Double_t fCdphi; //! Cosine of dphi
35 
36  // methods
37  TGeoPcon(const TGeoPcon&);
38  TGeoPcon& operator=(const TGeoPcon&);
39 
40 public:
41  // constructors
42  TGeoPcon();
43  TGeoPcon(Double_t phi, Double_t dphi, Int_t nz);
44  TGeoPcon(const char *name, Double_t phi, Double_t dphi, Int_t nz);
45  TGeoPcon(Double_t *params);
46  // destructor
47  virtual ~TGeoPcon();
48  // methods
49  virtual Double_t Capacity() const;
50  virtual void ComputeBBox();
51  virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm);
52  virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize);
53  virtual Bool_t Contains(const Double_t *point) const;
54  virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const;
55  virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax);
56  virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1,
57  Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
58  virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
59  virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1,
60  Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
61  virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const;
62  Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const;
63  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
64  virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
65  Double_t start, Double_t step);
66  virtual const char *GetAxisName(Int_t iaxis) const;
67  virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
68  virtual void GetBoundingCylinder(Double_t *param) const;
69  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const;
70  virtual Int_t GetByteCount() const {return 60+12*fNz;}
71  Double_t GetPhi1() const {return fPhi1;}
72  Double_t GetDphi() const {return fDphi;}
73  Int_t GetNz() const {return fNz;}
74  virtual Int_t GetNsegments() const;
75  Double_t *GetRmin() const {return fRmin;}
76  Double_t GetRmin(Int_t ipl) const;
77  Double_t *GetRmax() const {return fRmax;}
78  Double_t GetRmax(Int_t ipl) const;
79  Double_t *GetZ() const {return fZ;}
80  Double_t GetZ(Int_t ipl) const;
81  virtual TGeoShape *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMatrix * /*mat*/) const {return 0;}
82  virtual Int_t GetNmeshVertices() const;
83  virtual Bool_t GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const {return kFALSE;}
84  virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const;
85  virtual void InspectShape() const;
86  virtual Bool_t IsCylType() const {return kTRUE;}
87  virtual TBuffer3D *MakeBuffer3D() const;
88  Double_t &Phi1() {return fPhi1;}
89  Double_t &Dphi() {return fDphi;}
90  Double_t &Rmin(Int_t ipl) {return fRmin[ipl];}
91  Double_t &Rmax(Int_t ipl) {return fRmax[ipl];}
92  Double_t &Z(Int_t ipl) {return fZ[ipl];}
93  virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const;
94  virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const;
95  Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const;
96  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
97  virtual void SetDimensions(Double_t *param);
98  virtual void SetPoints(Double_t *points) const;
99  virtual void SetPoints(Float_t *points) const;
100  virtual void SetSegsAndPols(TBuffer3D &buff) const;
101  virtual void Sizeof3D() const;
102 
103  ClassDef(TGeoPcon, 1) // polycone class
104 };
105 
106 #endif