#ifndef ISOSCELESPENTAGON #define ISOSCELESPENTAGON //=========================================================================== // // Class : IsoscelesPentagon // Created : 30-JAN-1998 by Stephen Kahn // Purpose : Characterize the Middle Hadronic End Cap calorimeter // as a pentagon with bilateral symmetry. There is no // corresponding Geant shape. A method to write out // two trapezoid for Geant will be available // // * 1 // * * // 2 * * 3 (Excuse the poor // * * quality diagram) // * * // * * // 4 ***** 5 //=========================================================================== #include #include namespace dgs { /** A pentagon with bilateral symmetry. Characterize the Middle Hadronic End Cap calorimeter as a pentagon with bilateral symmetry. There is no corresponding Geant shape. A method to write out two trapezoid for Geant will be available \begin{verbatim} x 1 x x 2 x x 3 (Excuse the poor x x quality diagram) x x x x 4 xxxxx 5 \end{verbatim} */ class IsoscelesPentagon : public GeometryElement { private : /// Half height from base to tip double _pent_half_height; /// Half height from base to line connecting pt 2 to pt 3 (above) double _trap_half_height; /// Half dist pt 4 to pt 5 double _inner_half_width; /// Half dist pt 2 to pt 3 double _outer_half_width; /// Half-length double _half_length; /// Support for positioning children. CartesianCoordinate xform_to_local(const GeometryXform& )const; /// Support for positioning children. GeometryXform local_to_xform(const CartesianCoordinate& )const; /// nominal Global position CartesianCoordinate _PentCenter; /// RCS version std::string _cvers; // Replaced at checkout public : /// Default constructor. IsoscelesPentagon(): _cvers("$Revision: 1.8 $") {} /// Fill pentagon void fill_Pentagon( double, double, double, double, double ); /// Get half height from base to tip double get_pent_half_height() const { return _pent_half_height; } /// Get half height from base to line connecting pt 2 to pt 3 (above) double get_trap_half_height() const { return _trap_half_height; } /// Get half dist pt 4 to pt 5 double get_inner_half_width() const { return _inner_half_width; } /// Get half dist pt 2 to pt 3 double get_outer_half_width() const { return _outer_half_width; } /// Get half-length double get_half_length() const{ return _half_length; } /// Convert local point to global one. SpacePoint local_to_global(const CartesianCoordinate& )const; /// Convert global point to local one CartesianCoordinate global_to_local(const SpacePoint& )const; /// Set center of pentagon to Cartesian x,y,z point void set_center_xyz(); // set from Xform void set_center_xyz( double, double, double); /// Set Xform. void set_Xform(double, double, double, double ); /// Position child surface at given local point. bool position_child_at( const CartesianCoordinate& , GeometryElement& ); bool position_child_at( const GeometryXform&, GeometryElement&); /// Get center of pentagon CartesianCoordinate get_center() const { return _PentCenter; } /// Get source code version. Kept to allow following code changes const std::string& code_version() const { return _cvers; } D0_OBJECT_SETUP(IsoscelesPentagon); // persistent class }; } #endif // ISOSCELESPENTAGON