TTRD2.cxx

Go to the documentation of this file.
00001 // @(#)root/g3d:$Id: TTRD2.cxx 31635 2009-12-08 10:35:17Z couet $
00002 // Author: Nenad Buncic   13/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 "TTRD2.h"
00013 #include "TNode.h"
00014 
00015 ClassImp(TTRD2)
00016 
00017 //______________________________________________________________________________
00018 // Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/trd2.gif"> </P> End_Html
00019 // TRD2 is a trapezoid with both x and y dimensions varying along z.
00020 // It has 8 parameters:
00021 //
00022 //     - name       name of the shape
00023 //     - title      shape's title
00024 //     - material  (see TMaterial)
00025 //     - dx1        half-length along x at the z surface positioned at -DZ
00026 //     - dx2        half-length along x at the z surface positioned at +DZ
00027 //     - dy1        half-length along y at the z surface positioned at -DZ
00028 //     - dy2        half-length along y at the z surface positioned at +DZ
00029 //     - dz         half-length along the z-axis
00030 
00031 
00032 //______________________________________________________________________________
00033 TTRD2::TTRD2()
00034 {
00035   // TRD2 shape default constructor
00036 
00037    fDx2 = 0.;
00038    fDy2 = 0.;
00039 }
00040 
00041 
00042 //______________________________________________________________________________
00043 TTRD2::TTRD2(const char *name, const char *title, const char *material, Float_t dx1, Float_t dx2, Float_t dy1,
00044        Float_t dy2, Float_t dz) : TBRIK(name, title,material,dx1,dy1,dz)
00045 {
00046    // TRD2 shape normal constructor
00047 
00048    fDx2 = dx2;
00049    fDy2 = dy2;
00050 }
00051 
00052 
00053 //______________________________________________________________________________
00054 TTRD2::~TTRD2()
00055 {
00056    // TRD2 shape default destructor
00057 }
00058 
00059 
00060 //______________________________________________________________________________
00061 void TTRD2::SetPoints(Double_t *points) const
00062 {
00063    // Create TRD2 points
00064 
00065    Float_t dx1, dx2, dy1, dy2, dz;
00066 
00067    dx1 = TBRIK::fDx;
00068    dx2 = fDx2;
00069    dy1 = TBRIK::fDy;
00070    dy2 = fDy2;
00071    dz  = TBRIK::fDz;
00072 
00073    if (points) {
00074       points[ 0] = -dx1 ; points[ 1] = -dy1 ; points[ 2] = -dz;
00075       points[ 3] = -dx1 ; points[ 4] =  dy1 ; points[ 5] = -dz;
00076       points[ 6] =  dx1 ; points[ 7] =  dy1 ; points[ 8] = -dz;
00077       points[ 9] =  dx1 ; points[10] = -dy1 ; points[11] = -dz;
00078       points[12] = -dx2 ; points[13] = -dy2 ; points[14] =  dz;
00079       points[15] = -dx2 ; points[16] =  dy2 ; points[17] =  dz;
00080       points[18] =  dx2 ; points[19] =  dy2 ; points[20] =  dz;
00081       points[21] =  dx2 ; points[22] = -dy2 ; points[23] =  dz;
00082    }
00083 }

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