//*CMZ : 1.00/07 17/04/98 12.09.55 by Rene Brun //*-- Author : Nenad Buncic 19/09/95 //*KEEP,CopyRight,T=C. /************************************************************************* * Copyright(c) 1995-1998, The ROOT System, All rights reserved. * * Authors: Rene Brun, Nenad Buncic, Valery Fine, Fons Rademakers. * * * * Permission to use, copy, modify and distribute this software and its * * documentation for non-commercial purposes is hereby granted without * * fee, provided that the above copyright notice appears in all copies * * and that both the copyright notice and this permission notice appear * * in the supporting documentation. The authors make no claims about the * * suitability of this software for any purpose. * * It is provided "as is" without express or implied warranty. * *************************************************************************/ //*KEND. //*KEEP,TTRAP. #include "TTRAP.h" //*KEEP,TNode. #include "TNode.h" //*KEND. ClassImp(TTRAP) //______________________________________________________________________________ //// TRAP is a general trapezoid. The faces perpendicular to z are trapezia and // their centres are not necessarily on a line parallel to the z axis. // This shape has 14 parameters. // // - name name of the shape // - title shape's title // - material (see TMaterial) // - dz half-length along the z axis // - theta polar angle of the line joining the centre of the face // at -DZ to the centre of the one at +DZ // - phi azimuthal angle of the line joining the centre of the face // at -DZ to the centre of the one at +DZ // - h1 half-length along y of the face at -DZ // - bl1 half-length along x of the side at -H1 in y of the face // at -DZ in z // - tl1 half-length along x of the side at +H1 in y of the face // at -DZ in z // - alpha1 angle with respect to the y axis from the centre of the // side at -H1 in y to the centre of the side at +H1 in y // of the face at -DZ in z // - h2 half-length along y of the face at +DZ // - bl2 half-length along x of the side at -H2 in y of the // face at +DZ in z // - tl2 half-length along x of the side at +H2 in y of the face // at +DZ in z // - alpha2 angle with respect to the y axis from the centre of the side // at -H2 in y to the centre of the side at +H2 in y of the // face at +DZ in z //______________________________________________________________________________ TTRAP::TTRAP() { //*-*-*-*-*-*-*-*-*-*-*-*-*TRAP shape default constructor*-*-*-*-*-*-*-*-*-*-*-* //*-* ============================== } //______________________________________________________________________________ TTRAP::TTRAP(Text_t *name, Text_t *title, Text_t *material, Float_t dz, Float_t theta, Float_t phi, Float_t h1, Float_t bl1, Float_t tl1, Float_t alpha1, Float_t h2, Float_t bl2, Float_t tl2, Float_t alpha2) : TBRIK(name, title,material,theta,phi,dz) { //*-*-*-*-*-*-*-*-*-*-*-*-*TRAP shape normal constructor*-*-*-*-*-*-*-*-*-*-*-*-* //*-* ============================= fH1 = h1; fBl1 = bl1; fTl1 = tl1; fAlpha1 = alpha1; fH2 = h2; fBl2 = bl2; fTl2 = tl2; fAlpha2 = alpha2; } //______________________________________________________________________________ TTRAP::~TTRAP() { //*-*-*-*-*-*-*-*-*-*-*-*-*TRAP shape default destructor*-*-*-*-*-*-*-*-*-*-*-*-* //*-* ============================= } //______________________________________________________________________________ void TTRAP::SetPoints(Float_t *buff) { //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*Create TRAP points*-*-*-*-*-*-*-*-*-*-*-*-*-*-* //*-* ================== Float_t dx, dy, dx1, dx2, dz, theta, phi, alpha; const Float_t PI = Float_t (TMath::Pi()); alpha = fAlpha1 * PI/180.0; theta = TBRIK::fDx * PI/180.0; phi = TBRIK::fDy * PI/180.0; dx = 2*fDz*TMath::Sin(theta)*TMath::Cos(phi); dy = 2*fDz*TMath::Sin(theta)*TMath::Sin(phi); dz = TBRIK::fDz; dx1 = 2*fH1*TMath::Tan(alpha); dx2 = 2*fH2*TMath::Tan(alpha); if (buff) { buff[ 0] = -fBl1; buff[ 1] = -fH1; buff[ 2] = -dz; buff[ 3] = fBl1; buff[ 4] = -fH1; buff[ 5] = -dz; buff[ 6] = fTl1+dx1; buff[ 7] = fH1; buff[ 8] = -dz; buff[ 9] = -fTl1+dx1; buff[10] = fH1; buff[11] = -dz; buff[12] = -fBl2+dx; buff[13] = -fH2+dy; buff[14] = dz; buff[15] = fBl2+dx; buff[16] = -fH2+dy; buff[17] = dz; buff[18] = fTl2+dx+dx2; buff[19] = fH2+dy; buff[20] = dz; buff[21] = -fTl2+dx+dx2; buff[22] = fH2+dy; buff[23] = dz; } }
![]()