TCONE.cxx

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: TCONE.cxx 31624 2009-12-08 09:58:40Z couet $
00002 // Author: Nenad Buncic   18/09/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "TCONE.h"
00013 #include "TNode.h"
00014 
00015 ClassImp(TCONE)
00016 
00017 //______________________________________________________________________________
00018 // Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/cone.gif"> </P> End_Html
00019 // CONE is a conical tube. It has 8 parameters:
00020 //
00021 //     - name       name of the shape
00022 //     - title      shape's title
00023 //     - material  (see TMaterial)
00024 //     - dz         half-length in z
00025 //     - rmin1      inside radius at -DZ in z
00026 //     - rmax1      outside radius at -DZ in z
00027 //     - rmin2      inside radius at +DZ in z
00028 //     - rmax2      outside radius at +DZ in z
00029 
00030 
00031 //______________________________________________________________________________
00032 TCONE::TCONE()
00033 {
00034    // CONE shape default constructor
00035 
00036    fRmin2 = 0.;
00037    fRmax2 = 0.;
00038 }
00039 
00040 
00041 //______________________________________________________________________________
00042 TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz,
00043              Float_t rmin1, Float_t rmax1,
00044              Float_t rmin2, Float_t rmax2)
00045       : TTUBE(name, title,material,rmin1,rmax1,dz)
00046 {
00047    // CONE shape normal constructor
00048 
00049    fRmin2 = rmin2;
00050    fRmax2 = rmax2;
00051 }
00052 
00053 
00054 //______________________________________________________________________________
00055 TCONE::TCONE(const char *name, const char *title, const char *material, Float_t dz, Float_t rmax1
00056             , Float_t rmax2) : TTUBE(name, title,material,0,rmax1,dz)
00057 {
00058    // CONE shape "simplified" constructor
00059 
00060    fRmin2 = 0;
00061    fRmax2 = rmax2;
00062 }
00063 //______________________________________________________________________________
00064 TCONE::~TCONE()
00065 {
00066    // CONE shape default destructor
00067 }
00068 
00069 //______________________________________________________________________________
00070 void TCONE::SetPoints(Double_t *points) const
00071 {
00072    // Create CONE points
00073 
00074    Double_t rmin1, rmax1, dz;
00075    Int_t j, n;
00076 
00077    n = GetNumberOfDivisions();
00078 
00079    rmin1 = TTUBE::fRmin;
00080    rmax1 = TTUBE::fRmax;
00081    dz    = TTUBE::fDz;
00082 
00083    Int_t indx = 0;
00084 
00085    if (!fCoTab) MakeTableOfCoSin();
00086 
00087    if (points) {
00088       for (j = 0; j < n; j++) {
00089          points[indx++] = rmin1 * fCoTab[j];
00090          points[indx++] = rmin1 * fSiTab[j];
00091          points[indx++] = -dz;
00092       }
00093       for (j = 0; j < n; j++) {
00094          points[indx++] = rmax1 * fCoTab[j];
00095          points[indx++] = rmax1 * fSiTab[j];
00096          points[indx++] = -dz;
00097       }
00098       for (j = 0; j < n; j++) {
00099          points[indx++] = fRmin2 * fCoTab[j];
00100          points[indx++] = fRmin2 * fSiTab[j];
00101          points[indx++] = dz;
00102       }
00103       for (j = 0; j < n; j++) {
00104          points[indx++] = fRmax2 * fCoTab[j];
00105          points[indx++] = fRmax2 * fSiTab[j];
00106          points[indx++] = dz;
00107       }
00108    }
00109 }

Generated on Tue Jul 5 14:16:40 2011 for ROOT_528-00b_version by  doxygen 1.5.1