TCONS.cxx

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: TCONS.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 "TCONS.h"
00013 #include "TNode.h"
00014 
00015 
00016 ClassImp(TCONS)
00017 
00018 
00019 
00020 //______________________________________________________________________________
00021 // Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/cons.gif"> </P> End_Html
00022 // CONS is a segment of a conical tube. It has 10 parameters:
00023 //
00024 //     - name       name of the shape
00025 //     - title      shape's title
00026 //     - material  (see TMaterial)
00027 //     - dz         half-length in z
00028 //     - rmin1      inside radius at -DZ in z
00029 //     - rmax1      outside radius at -DZ in z
00030 //     - rmin2      inside radius at +DZ in z
00031 //     - rmax2      outside radius at +DZ in z
00032 //     - phi1       starting angle of the segment
00033 //     - phi2       ending angle of the segment
00034 //
00035 //
00036 // NOTE: phi1 should be smaller than phi2. If this is not the case,
00037 //       the system adds 360 degrees to phi2.
00038 
00039 
00040 
00041 
00042 
00043 //______________________________________________________________________________
00044 TCONS::TCONS()
00045 {
00046    // CONS shape default constructor
00047 
00048    fRmin2 = 0.;
00049    fRmax2 = 0.;
00050 }
00051 
00052 
00053 //______________________________________________________________________________
00054 TCONS::TCONS(const char *name, const char *title, const char *material, Float_t dz, Float_t rmin1, Float_t rmax1, Float_t rmin2, Float_t rmax2,
00055              Float_t phi1, Float_t phi2)
00056       : TTUBS(name,title,material,rmin1,rmax1,dz,phi1,phi2)
00057 {
00058    // CONS shape normal constructor
00059 
00060    fRmin2 = rmin2;
00061    fRmax2 = rmax2;
00062 }
00063 
00064 
00065 //______________________________________________________________________________
00066 TCONS::TCONS(const char *name, const char *title, const char *material,  Float_t rmax1, Float_t dz
00067                           , Float_t phi1, Float_t phi2, Float_t rmax2)
00068              : TTUBS(name,title,material,rmax1,dz,phi1,phi2)
00069 {
00070    // CONS shape normal constructor
00071 
00072    fRmin2 = 0;
00073    fRmax2 = rmax2;
00074 }
00075 
00076 //______________________________________________________________________________
00077 TCONS::~TCONS()
00078 {
00079    // CONS shape default destructor
00080 }
00081 
00082 //______________________________________________________________________________
00083 void TCONS::SetPoints(Double_t *points) const
00084 {
00085    // Create CONS points
00086 
00087    Int_t j, n;
00088    Float_t rmin1, rmax1, dz;
00089 
00090    n = GetNumberOfDivisions()+1;
00091 
00092    rmin1 = TTUBE::fRmin;
00093    rmax1 = TTUBE::fRmax;
00094    dz    = TTUBE::fDz;
00095 
00096    Int_t indx = 0;
00097 
00098    if (!fCoTab) MakeTableOfCoSin();
00099 
00100    if (points) {
00101       for (j = 0; j < n; j++) {
00102          points[indx++] = rmin1 * fCoTab[j];
00103          points[indx++] = rmin1 * fSiTab[j];
00104          points[indx++] = -dz;
00105       }
00106       for (j = 0; j < n; j++) {
00107          points[indx++] = rmax1 * fCoTab[j];
00108          points[indx++] = rmax1 * fSiTab[j];
00109          points[indx++] = -dz;
00110       }
00111       for (j = 0; j < n; j++) {
00112          points[indx++] = fRmin2 * fCoTab[j];
00113          points[indx++] = fRmin2 * fSiTab[j];
00114          points[indx++] = dz;
00115       }
00116       for (j = 0; j < n; j++) {
00117          points[indx++] = fRmax2 * fCoTab[j];
00118          points[indx++] = fRmax2 * fSiTab[j];
00119          points[indx++] = dz;
00120       }
00121    }
00122 }

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