Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGeoSphere.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/geom:$Id$
0002 // Author: Andrei Gheata   31/01/02
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGeoSphere
0013 #define ROOT_TGeoSphere
0014 
0015 #include "TGeoBBox.h"
0016 
0017 class TGeoSphere : public TGeoBBox {
0018 protected:
0019    Int_t fNz;        // number of z planes for drawing
0020    Int_t fNseg;      // number of segments for drawing
0021    Double_t fRmin;   // inner radius
0022    Double_t fRmax;   // outer radius
0023    Double_t fTheta1; // lower theta limit
0024    Double_t fTheta2; // higher theta limit
0025    Double_t fPhi1;   // lower phi limit
0026    Double_t fPhi2;   // higher phi limit
0027 
0028    TGeoSphere(const TGeoSphere &) = delete;
0029    TGeoSphere &operator=(const TGeoSphere &) = delete;
0030 
0031 public:
0032    // constructors
0033    TGeoSphere();
0034    TGeoSphere(Double_t rmin, Double_t rmax, Double_t theta1 = 0, Double_t theta2 = 180, Double_t phi1 = 0,
0035               Double_t phi2 = 360);
0036    TGeoSphere(const char *name, Double_t rmin, Double_t rmax, Double_t theta1 = 0, Double_t theta2 = 180,
0037               Double_t phi1 = 0, Double_t phi2 = 360);
0038    TGeoSphere(Double_t *param, Int_t nparam = 6);
0039    // destructor
0040    ~TGeoSphere() override;
0041    // methods
0042    Double_t Capacity() const override;
0043    void ComputeBBox() override;
0044    void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override;
0045    void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
0046    Bool_t Contains(const Double_t *point) const override;
0047    void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
0048    Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0049    Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
0050                            Double_t *safe = nullptr) const override;
0051    void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0052                          Double_t *step) const override;
0053    Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
0054                             Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
0055    void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0056                           Double_t *step) const override;
0057    Double_t DistToSphere(const Double_t *point, const Double_t *dir, Double_t rsph, Bool_t check = kTRUE,
0058                          Bool_t firstcross = kTRUE) const;
0059    TGeoVolume *
0060    Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
0061    const char *GetAxisName(Int_t iaxis) const override;
0062    Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
0063    void GetBoundingCylinder(Double_t *param) const override;
0064    const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
0065    Int_t GetByteCount() const override { return 42; }
0066    TGeoShape *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMatrix * /*mat*/) const override { return nullptr; }
0067    void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
0068    Int_t GetNmeshVertices() const override;
0069    Int_t GetNumberOfDivisions() const { return fNseg; }
0070    Bool_t GetPointsOnSegments(Int_t /*npoints*/, Double_t * /*array*/) const override { return kFALSE; }
0071    Int_t GetNz() const { return fNz; }
0072    virtual Double_t GetRmin() const { return fRmin; }
0073    virtual Double_t GetRmax() const { return fRmax; }
0074    Double_t GetTheta1() const { return fTheta1; }
0075    Double_t GetTheta2() const { return fTheta2; }
0076    Double_t GetPhi1() const { return fPhi1; }
0077    Double_t GetPhi2() const { return fPhi2; }
0078    void InspectShape() const override;
0079    Bool_t IsCylType() const override { return kFALSE; }
0080    Int_t IsOnBoundary(const Double_t *point) const;
0081    Bool_t
0082    IsPointInside(const Double_t *point, Bool_t checkR = kTRUE, Bool_t checkTh = kTRUE, Bool_t checkPh = kTRUE) const;
0083    TBuffer3D *MakeBuffer3D() const override;
0084    Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
0085    void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
0086    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0087    void SetSphDimensions(Double_t rmin, Double_t rmax, Double_t theta1, Double_t theta2, Double_t phi1, Double_t phi2);
0088    virtual void SetNumberOfDivisions(Int_t p);
0089    void SetDimensions(Double_t *param) override;
0090    void SetDimensions(Double_t *param, Int_t nparam);
0091    void SetPoints(Double_t *points) const override;
0092    void SetPoints(Float_t *points) const override;
0093    void SetSegsAndPols(TBuffer3D &buff) const override;
0094    void Sizeof3D() const override;
0095 
0096    ClassDefOverride(TGeoSphere, 1) // sphere class
0097 };
0098 
0099 #endif