TTRD1.cxx

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

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