ROBAST logo
// Author: Akira Okumura <mailto:oxon@mac.com>
/******************************************************************************
 * Copyright (C) 2006-, Akira Okumura                                         *
 * All rights reserved.                                                       *
 *****************************************************************************/

#ifndef A_GEO_WINSTON_CONE_2D_H
#define A_GEO_WINSTON_CONE_2D_H

#include "TGeoBBox.h"

#if ROOT_VERSION_CODE >= ROOT_VERSION(5, 34, 10)
#define CONST53410 const
#else
#define CONST53410
#endif

///////////////////////////////////////////////////////////////////////////////
//
// AGeoWinstonCone2D
//
// Geometry class for 2 dimensional (+ 1D length) Winston cone
// The 3rd dimention is along with Y axis
// Roland Winston (1970) J. Opt. Soc.Amer. 60, 245-247
//
///////////////////////////////////////////////////////////////////////////////

class AGeoWinstonCone2D : public TGeoBBox {
 protected:
  Double_t fR1;     // Half of the larger aperture
  Double_t fR2;     // Half of the smaller aperture
  Double_t fTheta;  // Cutoff angle
  Double_t fF;      // Focal length

 public:
  AGeoWinstonCone2D();
  AGeoWinstonCone2D(Double_t r1, Double_t r2, Double_t y);
  AGeoWinstonCone2D(const char* name, Double_t r1, Double_t r2, Double_t y);
  virtual ~AGeoWinstonCone2D();

  virtual Double_t CalcR(Double_t z) const noexcept(false);
  virtual Double_t CalcdRdZ(Double_t z) const noexcept(false);
  virtual Double_t Capacity() const;
  virtual void ComputeBBox();
  virtual void ComputeNormal(CONST53410 Double_t* point,
                             CONST53410 Double_t* dir, Double_t* norm);
  virtual Bool_t Contains(CONST53410 Double_t* point) const;
  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
  virtual Double_t DistFromInside(CONST53410 Double_t* point,
                                  CONST53410 Double_t* dir, Int_t iact = 1,
                                  Double_t step = TGeoShape::Big(),
                                  Double_t* safe = 0) const;
  virtual Double_t DistFromOutside(CONST53410 Double_t* point,
                                   CONST53410 Double_t* dir, Int_t iact = 1,
                                   Double_t step = TGeoShape::Big(),
                                   Double_t* safe = 0) const;
  virtual Double_t DistToParabola(CONST53410 Double_t* point,
                                  CONST53410 Double_t* dir, Double_t phi,
                                  Double_t open) const;
  virtual TGeoVolume* Divide(TGeoVolume* voldiv, const char* divname,
                             Int_t iaxis, Int_t ndiv, Double_t start,
                             Double_t step);
  virtual void GetBoundingCylinder(Double_t* param) const;
  virtual const TBuffer3D& GetBuffer3D(Int_t reqSections,
                                       Bool_t localFrame) const;
  // virtual Int_t       GetByteCount() const {return 68 + 4*(fNPol1 + fNPol2);}
  // // to be checked
  virtual TGeoShape* GetMakeRuntimeShape(TGeoShape*, TGeoMatrix*) const {
    return 0;
  }
  virtual void GetMeshNumbers(Int_t& nvert, Int_t& nsegs, Int_t& npols) const;
  virtual Int_t GetNmeshVertices() const;
  virtual Double_t GetTheta() const { return fTheta; }
  virtual void InspectShape() const;
  virtual Bool_t IsCylType() const { return kFALSE; }
  virtual TBuffer3D* MakeBuffer3D() const;
  virtual Double_t Safety(CONST53410 Double_t* point, Bool_t in = kTRUE) const;
  virtual void SavePrimitive(std::ostream& out, Option_t* option = "");
  virtual void SetWinstonDimensions(Double_t r1, Double_t r2, Double_t y);
  virtual void SetDimensions(Double_t* param);
  virtual void SetPoints(Double_t* points) const;
  virtual void SetPoints(Float_t* points) const;
  virtual void SetSegsAndPols(TBuffer3D& buff) const;
  virtual void Sizeof3D() const;

  ClassDef(AGeoWinstonCone2D, 1)
};

#endif  // A_GEO_WINSTON_CONE_2D_H
 AGeoWinstonCone2D.h:1
 AGeoWinstonCone2D.h:2
 AGeoWinstonCone2D.h:3
 AGeoWinstonCone2D.h:4
 AGeoWinstonCone2D.h:5
 AGeoWinstonCone2D.h:6
 AGeoWinstonCone2D.h:7
 AGeoWinstonCone2D.h:8
 AGeoWinstonCone2D.h:9
 AGeoWinstonCone2D.h:10
 AGeoWinstonCone2D.h:11
 AGeoWinstonCone2D.h:12
 AGeoWinstonCone2D.h:13
 AGeoWinstonCone2D.h:14
 AGeoWinstonCone2D.h:15
 AGeoWinstonCone2D.h:16
 AGeoWinstonCone2D.h:17
 AGeoWinstonCone2D.h:18
 AGeoWinstonCone2D.h:19
 AGeoWinstonCone2D.h:20
 AGeoWinstonCone2D.h:21
 AGeoWinstonCone2D.h:22
 AGeoWinstonCone2D.h:23
 AGeoWinstonCone2D.h:24
 AGeoWinstonCone2D.h:25
 AGeoWinstonCone2D.h:26
 AGeoWinstonCone2D.h:27
 AGeoWinstonCone2D.h:28
 AGeoWinstonCone2D.h:29
 AGeoWinstonCone2D.h:30
 AGeoWinstonCone2D.h:31
 AGeoWinstonCone2D.h:32
 AGeoWinstonCone2D.h:33
 AGeoWinstonCone2D.h:34
 AGeoWinstonCone2D.h:35
 AGeoWinstonCone2D.h:36
 AGeoWinstonCone2D.h:37
 AGeoWinstonCone2D.h:38
 AGeoWinstonCone2D.h:39
 AGeoWinstonCone2D.h:40
 AGeoWinstonCone2D.h:41
 AGeoWinstonCone2D.h:42
 AGeoWinstonCone2D.h:43
 AGeoWinstonCone2D.h:44
 AGeoWinstonCone2D.h:45
 AGeoWinstonCone2D.h:46
 AGeoWinstonCone2D.h:47
 AGeoWinstonCone2D.h:48
 AGeoWinstonCone2D.h:49
 AGeoWinstonCone2D.h:50
 AGeoWinstonCone2D.h:51
 AGeoWinstonCone2D.h:52
 AGeoWinstonCone2D.h:53
 AGeoWinstonCone2D.h:54
 AGeoWinstonCone2D.h:55
 AGeoWinstonCone2D.h:56
 AGeoWinstonCone2D.h:57
 AGeoWinstonCone2D.h:58
 AGeoWinstonCone2D.h:59
 AGeoWinstonCone2D.h:60
 AGeoWinstonCone2D.h:61
 AGeoWinstonCone2D.h:62
 AGeoWinstonCone2D.h:63
 AGeoWinstonCone2D.h:64
 AGeoWinstonCone2D.h:65
 AGeoWinstonCone2D.h:66
 AGeoWinstonCone2D.h:67
 AGeoWinstonCone2D.h:68
 AGeoWinstonCone2D.h:69
 AGeoWinstonCone2D.h:70
 AGeoWinstonCone2D.h:71
 AGeoWinstonCone2D.h:72
 AGeoWinstonCone2D.h:73
 AGeoWinstonCone2D.h:74
 AGeoWinstonCone2D.h:75
 AGeoWinstonCone2D.h:76
 AGeoWinstonCone2D.h:77
 AGeoWinstonCone2D.h:78
 AGeoWinstonCone2D.h:79
 AGeoWinstonCone2D.h:80
 AGeoWinstonCone2D.h:81
 AGeoWinstonCone2D.h:82
 AGeoWinstonCone2D.h:83
 AGeoWinstonCone2D.h:84
 AGeoWinstonCone2D.h:85
 AGeoWinstonCone2D.h:86
 AGeoWinstonCone2D.h:87
 AGeoWinstonCone2D.h:88
 AGeoWinstonCone2D.h:89