00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGeoArb8
00013 #define ROOT_TGeoArb8
00014
00015 #ifndef ROOT_TGeoBBox
00016 #include "TGeoBBox.h"
00017 #endif
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 class TGeoArb8 : public TGeoBBox
00045 {
00046 protected:
00047 enum EGeoArb8Type {
00048
00049
00050 kArb8Trap = BIT(27),
00051 kArb8Tra = BIT(28)
00052 };
00053
00054 Double_t fDz;
00055 Double_t *fTwist;
00056 Double_t fXY[8][2];
00057
00058 TGeoArb8(const TGeoArb8&);
00059 TGeoArb8& operator=(const TGeoArb8&);
00060
00061 public:
00062
00063 TGeoArb8();
00064 TGeoArb8(Double_t dz, Double_t *vertices=0);
00065 TGeoArb8(const char *name, Double_t dz, Double_t *vertices=0);
00066
00067 virtual ~TGeoArb8();
00068
00069 virtual Double_t Capacity() const;
00070 virtual void ComputeBBox();
00071 virtual void ComputeNormal(Double_t *point, Double_t *dir, Double_t *norm);
00072 void ComputeTwist();
00073 virtual Bool_t Contains(Double_t *point) const;
00074 Double_t DistToPlane(Double_t *point, Double_t *dir, Int_t ipl, Bool_t in) const;
00075 virtual Double_t DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1,
00076 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00077 virtual Double_t DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1,
00078 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00079 virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
00080 Double_t start, Double_t step);
00081 virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const;
00082 virtual void GetBoundingCylinder(Double_t *param) const;
00083 virtual Int_t GetByteCount() const {return 100;}
00084 Double_t GetClosestEdge(Double_t *point, Double_t *vert, Int_t &isegment) const;
00085 virtual Bool_t GetPointsOnFacet(Int_t , Int_t , Double_t * ) const;
00086 Double_t GetDz() const {return fDz;}
00087 virtual Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const;
00088 virtual TGeoShape *GetMakeRuntimeShape(TGeoShape * , TGeoMatrix * ) const {return 0;}
00089 static void GetPlaneNormal(Double_t *p1, Double_t *p2, Double_t *p3, Double_t *norm);
00090 Double_t *GetVertices() {return &fXY[0][0];}
00091 Double_t GetTwist(Int_t iseg) const;
00092 virtual Bool_t IsCylType() const {return kFALSE;}
00093 static Bool_t IsSamePoint(Double_t *p1, Double_t *p2) {return (TMath::Abs(p1[0]-p2[0])<1.E-16 && TMath::Abs(p1[1]-p2[1])<1.E-16)?kTRUE:kFALSE;}
00094 static Bool_t InsidePolygon(Double_t x, Double_t y, Double_t *pts);
00095 virtual void InspectShape() const;
00096 Bool_t IsTwisted() const {return (fTwist==0)?kFALSE:kTRUE;}
00097 Double_t SafetyToFace(Double_t *point, Int_t iseg, Bool_t in) const;
00098 virtual Double_t Safety(Double_t *point, Bool_t in=kTRUE) const;
00099 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00100 void SetPlaneVertices(Double_t zpl, Double_t *vertices) const;
00101 virtual void SetVertex(Int_t vnum, Double_t x, Double_t y);
00102 virtual void SetDimensions(Double_t *param);
00103 void SetDz(Double_t dz) {fDz = dz;}
00104 virtual void SetPoints(Double_t *points) const;
00105 virtual void SetPoints(Float_t *points) const;
00106 virtual void Sizeof3D() const;
00107
00108 ClassDef(TGeoArb8, 1)
00109 };
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 class TGeoTrap : public TGeoArb8
00127 {
00128 protected:
00129
00130 Double_t fTheta;
00131 Double_t fPhi;
00132 Double_t fH1;
00133 Double_t fBl1;
00134 Double_t fTl1;
00135 Double_t fAlpha1;
00136 Double_t fH2;
00137 Double_t fBl2;
00138 Double_t fTl2;
00139 Double_t fAlpha2;
00140
00141 public:
00142
00143 TGeoTrap();
00144 TGeoTrap(Double_t dz, Double_t theta, Double_t phi);
00145 TGeoTrap(Double_t dz, Double_t theta, Double_t phi, Double_t h1,
00146 Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
00147 Double_t tl2, Double_t alpha2);
00148 TGeoTrap(const char *name, Double_t dz, Double_t theta, Double_t phi, Double_t h1,
00149 Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
00150 Double_t tl2, Double_t alpha2);
00151
00152 virtual ~TGeoTrap();
00153 virtual Double_t DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1,
00154 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00155 virtual Double_t DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1,
00156 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00157 virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv,
00158 Double_t start, Double_t step);
00159 Double_t GetTheta() const {return fTheta;}
00160 Double_t GetPhi() const {return fPhi;}
00161 Double_t GetH1() const {return fH1;}
00162 Double_t GetBl1() const {return fBl1;}
00163 Double_t GetTl1() const {return fTl1;}
00164 Double_t GetAlpha1() const {return fAlpha1;}
00165 Double_t GetH2() const {return fH2;}
00166 Double_t GetBl2() const {return fBl2;}
00167 Double_t GetTl2() const {return fTl2;}
00168 Double_t GetAlpha2() const {return fAlpha2;}
00169 virtual TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
00170 virtual void SetDimensions(Double_t *param);
00171 virtual Double_t Safety(Double_t *point, Bool_t in=kTRUE) const;
00172 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00173
00174 ClassDef(TGeoTrap, 1)
00175 };
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192 class TGeoGtra : public TGeoTrap
00193 {
00194 protected:
00195
00196 Double_t fTwistAngle;
00197 public:
00198
00199 TGeoGtra();
00200 TGeoGtra(Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1,
00201 Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
00202 Double_t tl2, Double_t alpha2);
00203 TGeoGtra(const char *name, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1,
00204 Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2,
00205 Double_t tl2, Double_t alpha2);
00206
00207 virtual ~TGeoGtra();
00208 virtual Double_t DistFromInside(Double_t *point, Double_t *dir, Int_t iact=1,
00209 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00210 virtual Double_t DistFromOutside(Double_t *point, Double_t *dir, Int_t iact=1,
00211 Double_t step=TGeoShape::Big(), Double_t *safe=0) const;
00212 virtual TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const;
00213 Double_t GetTwistAngle() const {return fTwistAngle;}
00214 virtual void SetDimensions(Double_t *param);
00215 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00216
00217 ClassDef(TGeoGtra, 1)
00218 };
00219
00220 #endif