CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DetectorDescription/Parser/src/DDLEllipsoid.cc

Go to the documentation of this file.
00001 /***************************************************************************
00002                           DDLEllipsoid.cc  -  description
00003                              -------------------
00004     begin                : Thu Aug 19 2010
00005     email                : case@ucdhep.ucdavis.edu
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *           DDDParser sub-component of DDD                                *
00011  *                                                                         *
00012  ***************************************************************************/
00013 
00014 #include "DetectorDescription/Parser/src/DDLEllipsoid.h"
00015 
00016 #include "DetectorDescription/Core/interface/DDName.h"
00017 #include "DetectorDescription/Core/interface/DDSolid.h"
00018 #include "DetectorDescription/Base/interface/DDdebug.h"
00019 
00020 #include "DetectorDescription/ExprAlgo/interface/ExprEvalSingleton.h"
00021 
00022 DDLEllipsoid::DDLEllipsoid( DDLElementRegistry* myreg )
00023   : DDLSolid( myreg )
00024 {}
00025 
00026 DDLEllipsoid::~DDLEllipsoid( void )
00027 {}
00028 
00029 // Upon encountering the end of the Ellipsoid element, call DDCore.
00030 void
00031 DDLEllipsoid::processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
00032 { 
00033   DCOUT_V( 'P', "DDLEllipsoid::processElement started" );
00034   ExprEvalInterface & ev = ExprEvalSingleton::instance();
00035   DDXMLAttribute atts = getAttributeSet();
00036   double zbot(0.), ztop(0.);
00037   if( atts.find( "zBottomCut" ) != atts.end() )
00038   {
00039     zbot = ev.eval( nmspace, atts.find( "zBottomCut" )->second );
00040   }
00041   if( atts.find( "zTopCut" ) != atts.end() )
00042   {
00043     ztop = ev.eval( nmspace, atts.find( "zTopCut" )->second );
00044   }
00045   DDSolid ddel = DDSolidFactory::ellipsoid( getDDName( nmspace ),
00046                                             ev.eval(nmspace, atts.find("xSemiAxis")->second),
00047                                             ev.eval(nmspace, atts.find("ySemiAxis")->second),
00048                                             ev.eval(nmspace, atts.find("zSemiAxis")->second),
00049                                             zbot,
00050                                             ztop );
00051   DDLSolid::setReference( nmspace, cpv );
00052 
00053   DCOUT_V( 'P', "DDLEllipsoid::processElement completed" );
00054 }