Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGeoCone.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_TGeoCone
0013 #define ROOT_TGeoCone
0014 
0015 #include "TGeoBBox.h"
0016 
0017 class TGeoCone : public TGeoBBox {
0018 protected:
0019    // data members
0020    Double_t fDz;    // half length
0021    Double_t fRmin1; // inner radius at -dz
0022    Double_t fRmax1; // outer radius at -dz
0023    Double_t fRmin2; // inner radius at +dz
0024    Double_t fRmax2; // outer radius at +dz
0025                     // methods
0026    TGeoCone(const TGeoCone &) = delete;
0027    TGeoCone &operator=(const TGeoCone &) = delete;
0028 
0029 public:
0030    // constructors
0031    TGeoCone();
0032    TGeoCone(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
0033    TGeoCone(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
0034    TGeoCone(Double_t *params);
0035    // destructor
0036    ~TGeoCone() override;
0037    // methods
0038 
0039    Double_t Capacity() const override;
0040    static Double_t Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
0041    void ComputeBBox() override;
0042    void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override;
0043    void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
0044    static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1,
0045                               Double_t rmax1, Double_t rmin2, Double_t rmax2);
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    static void DistToCone(const Double_t *point, const Double_t *dir, Double_t dz, Double_t r1, Double_t r2,
0050                           Double_t &b, Double_t &delta);
0051    static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
0052                                    Double_t rmax1, Double_t rmin2, Double_t rmax2);
0053    Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
0054                            Double_t *safe = nullptr) const override;
0055    void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0056                          Double_t *step) const override;
0057    static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
0058                                     Double_t rmax1, Double_t rmin2, Double_t rmax2);
0059    Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
0060                             Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
0061    void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0062                           Double_t *step) const override;
0063    TGeoVolume *
0064    Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
0065 
0066    const char *GetAxisName(Int_t iaxis) const override;
0067    Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
0068    void GetBoundingCylinder(Double_t *param) const override;
0069    Int_t GetByteCount() const override { return 56; }
0070    const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
0071    virtual Double_t GetDz() const { return fDz; }
0072    TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
0073    void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
0074    Int_t GetNmeshVertices() const override;
0075    Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
0076    virtual Double_t GetRmin1() const { return fRmin1; }
0077    virtual Double_t GetRmax1() const { return fRmax1; }
0078    virtual Double_t GetRmin2() const { return fRmin2; }
0079    virtual Double_t GetRmax2() const { return fRmax2; }
0080 
0081    void InspectShape() const override;
0082    Bool_t IsCylType() const override { return kTRUE; }
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    static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
0087                            Double_t rmin2, Double_t rmax2, Int_t skipz = 0);
0088    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0089    void SetConeDimensions(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2);
0090    void SetDimensions(Double_t *param) override;
0091    void SetPoints(Double_t *points) const override;
0092    void SetPoints(Float_t *points) const override;
0093    void SetSegsAndPols(TBuffer3D &buffer) const override;
0094    void Sizeof3D() const override;
0095 
0096    ClassDefOverride(TGeoCone, 1) // conical tube class
0097 };
0098 
0099 class TGeoConeSeg : public TGeoCone {
0100 protected:
0101    // data members
0102    Double_t fPhi1; // first phi limit
0103    Double_t fPhi2; // second phi limit
0104    // Transient trigonometric data
0105    Double_t fS1;   // sin(phi1)
0106    Double_t fC1;   // cos(phi1)
0107    Double_t fS2;   // sin(phi2)
0108    Double_t fC2;   // cos(phi2)
0109    Double_t fSm;   // sin(0.5*(phi1+phi2))
0110    Double_t fCm;   // cos(0.5*(phi1+phi2))
0111    Double_t fCdfi; // cos(0.5*(phi1-phi2))
0112 
0113    void InitTrigonometry();
0114 
0115 public:
0116    // constructors
0117    TGeoConeSeg();
0118    TGeoConeSeg(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1,
0119                Double_t phi2);
0120    TGeoConeSeg(const char *name, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2,
0121                Double_t phi1, Double_t phi2);
0122    TGeoConeSeg(Double_t *params);
0123    // destructor
0124    ~TGeoConeSeg() override;
0125    // methods
0126    void AfterStreamer() override;
0127    Double_t Capacity() const override;
0128    static Double_t
0129    Capacity(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2);
0130    void ComputeBBox() override;
0131    void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override;
0132    void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override;
0133    static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1,
0134                               Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2,
0135                               Double_t s2);
0136    Bool_t Contains(const Double_t *point) const override;
0137    void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override;
0138 
0139    Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0140    static Double_t DistToCons(const Double_t *point, const Double_t *dir, Double_t r1, Double_t z1, Double_t r2,
0141                               Double_t z2, Double_t phi1, Double_t phi2);
0142    static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
0143                                    Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1,
0144                                    Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi);
0145    Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact = 1, Double_t step = TGeoShape::Big(),
0146                            Double_t *safe = nullptr) const override;
0147    void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0148                          Double_t *step) const override;
0149    static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1,
0150                                     Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1,
0151                                     Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi);
0152    Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact = 1,
0153                             Double_t step = TGeoShape::Big(), Double_t *safe = nullptr) const override;
0154    void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize,
0155                           Double_t *step) const override;
0156    TGeoVolume *
0157    Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override;
0158    Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override;
0159    void GetBoundingCylinder(Double_t *param) const override;
0160    const TBuffer3D &GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
0161    Int_t GetByteCount() const override { return 64; }
0162    TGeoShape *GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override;
0163    void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override;
0164    Int_t GetNmeshVertices() const override;
0165    Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override;
0166    Double_t GetPhi1() const { return fPhi1; }
0167    Double_t GetPhi2() const { return fPhi2; }
0168    void InspectShape() const override;
0169    TBuffer3D *MakeBuffer3D() const override;
0170    Double_t Safety(const Double_t *point, Bool_t in = kTRUE) const override;
0171    void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override;
0172    static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1,
0173                            Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2, Int_t skipz = 0);
0174    void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0175    void SetConsDimensions(Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1,
0176                           Double_t phi2);
0177    void SetDimensions(Double_t *param) override;
0178    void SetPoints(Double_t *points) const override;
0179    void SetPoints(Float_t *points) const override;
0180    void SetSegsAndPols(TBuffer3D &buffer) const override;
0181    void Sizeof3D() const override;
0182 
0183    ClassDefOverride(TGeoConeSeg, 2) // conical tube segment class
0184 };
0185 
0186 #endif