Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Hype.cxx

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/geometry/src/Hype.cxx,v 1.1.1.1 1999/12/20 22:28:06 burnett Exp $
00002 //
00003 
00004 #include "geometry/Hype.h"
00005 #include "geometry/Hyperbolic.h"
00006 #include "geometry/Plane.h"
00007 
00008 
00009 /*Hype default parameters.
00010         axis = Vector( 0.0, 0.0, 1.0 );
00011         half_length = 1.0;
00012         inner_radius  = 0.9;
00013         outer_radius = 1.0;
00014         stereo_angle = 0.1;
00015 */
00016 
00017 Hype::Hype( double hl, double ri, double ro, double sa )
00018 : Volume(4)
00019 {
00020         if(    ( hl <= 0.0 ) || ( ri <= 0.0 ) || ( ro <= ri )
00021              ||( sa <= 0.0 ) || ( sa >=  M_PI/2 )
00022           ) FATAL("Illegal Hype parameters");
00023         Vector axis( 0.0, 0.0, 1.0 );
00024 
00025         double zt = hl * tan( sa );
00026         double rio = sqrt( ri * ri  +  zt * zt );
00027         double roo = sqrt( ro * ro  +  zt * zt );
00028 
00029    //   Create the surfaces: note order!
00030     addSurface(new Hyperbolic(center(), axis, -ri,-rio,hl));
00031         addSurface(new Hyperbolic(center(), axis,  ro, roo,hl));
00032     addSurface(new Plane(center(), Vector(0,0, hl)));
00033     addSurface(new Plane(center(), Vector(0,0,-hl)));
00034 }
00035 
00036 const Vector Hype::axis()const{return ((Hyperbolic&)surface(0)).axis();}
00037 
00038 void Hype::printOn( std::ostream& os ) const
00039 {
00040         Volume::printOn(os);
00041         os
00042            << "axis " << axis()
00043            << "\n half_length " << halfLength()
00044            << ", inner_radius " << innerRadius()
00045            << ", outer_radius " << outerRadius()
00046            << ", stereo_angle " << stereoAngle()
00047            << "\n"      ;
00048 }
00049 
00050 
00051 
00052 

Generated at Mon Nov 26 18:18:21 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000