Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPCON.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Nenad Buncic 29/09/95
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_TPCON
13 #define ROOT_TPCON
14 
15 
16 ////////////////////////////////////////////////////////////////////////////
17 // //
18 // TPCON //
19 // //
20 // PCON is a polycone. It has at least 9 parameters, the lower phi limit, //
21 // the range in phi, the number (at least two) of z planes where the //
22 // radius is changing for each z boundary and the z coordinate, the //
23 // minimum radius and the maximum radius. //
24 // //
25 ////////////////////////////////////////////////////////////////////////////
26 
27 #include "TShape.h"
28 
29 
30 const Int_t kDiv = 20; //default number of divisions
31 
32 
33 class TPCON : public TShape {
34 protected:
35  // Internal cache
36  mutable Double_t *fSiTab; //! Table of sin(fPhi1) .... sin(fPhil+fDphi1)
37  mutable Double_t *fCoTab; //! Table of cos(fPhi1) .... cos(fPhil+fDphi1)
38 
39  Float_t fPhi1; // lower phi limit
40  Float_t fDphi1; // range in phi
41  Int_t fNdiv; // number of divisions
42  Int_t fNz; // number of z segments
43  Float_t *fRmin; //[fNz] pointer to array of inside radiuses
44  Float_t *fRmax; //[fNz] pointer to array of outside radiuses
45  Float_t *fDz; //[fNz] pointer to array of half lengths in z
46 
47  TPCON(const TPCON&);
48  TPCON& operator=(const TPCON&);
49 
50  virtual void MakeTableOfCoSin() const; // Create the table of the fSiTab; fCoTab
51  virtual void FillTableOfCoSin(Double_t phi, Double_t angstep,Int_t n) const; // Fill the table of cosin
52  virtual void SetPoints(Double_t *points) const;
53  virtual Bool_t SetSegsAndPols(TBuffer3D & buffer) const;
54 
55 public:
56  TPCON();
57  TPCON(const char *name, const char *title, const char *material, Float_t phi1, Float_t dphi1, Int_t nz);
58  virtual ~TPCON();
59 
60  virtual void DefineSection(Int_t secNum, Float_t z, Float_t rmin, Float_t rmax);
61  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
62  virtual const TBuffer3D &GetBuffer3D(Int_t reqSections) const;
63  virtual Int_t GetNumberOfDivisions () const {if (fNdiv) return fNdiv; else return kDiv;}
64  virtual Float_t GetPhi1() const {return fPhi1;}
65  virtual Float_t GetDhi1() const {return fDphi1;}
66  virtual Int_t GetNz() const {return fNz;}
67  virtual Float_t *GetRmin() const {return fRmin;}
68  virtual Float_t *GetRmax() const {return fRmax;}
69  virtual Float_t *GetDz() const {return fDz;}
70  virtual Int_t GetNdiv() const {return fNdiv;}
71  virtual void SetNumberOfDivisions (Int_t p);
72  virtual void Sizeof3D() const;
73 
74  ClassDef(TPCON,2) //PCON shape
75 };
76 
77 #endif