/DetectorDescription/Parser/src/DDLSphere.cc

https://github.com/aivanov-cern/cmssw · C++ · 47 lines · 26 code · 9 blank · 12 comment · 0 complexity · f53a5342a3c6b4861012f42280534ca4 MD5 · raw file

  1. /***************************************************************************
  2. DDLSphere.cc - description
  3. -------------------
  4. begin : Sun July 12 2009
  5. email : case@ucdhep.ucdavis.edu
  6. ***************************************************************************/
  7. /***************************************************************************
  8. * *
  9. * DDDParser sub-component of DDD *
  10. * *
  11. ***************************************************************************/
  12. #include "DetectorDescription/Parser/src/DDLSphere.h"
  13. #include "DetectorDescription/Core/interface/DDName.h"
  14. #include "DetectorDescription/Core/interface/DDSolid.h"
  15. #include "DetectorDescription/Base/interface/DDdebug.h"
  16. #include "DetectorDescription/ExprAlgo/interface/ClhepEvaluator.h"
  17. DDLSphere::DDLSphere( DDLElementRegistry* myreg )
  18. : DDLSolid( myreg )
  19. {}
  20. DDLSphere::~DDLSphere( void )
  21. {}
  22. // Upon encountering the end of the Sphere element, call DDCore.
  23. void
  24. DDLSphere::processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
  25. {
  26. DCOUT_V('P', "DDLSphere::processElement started");
  27. ClhepEvaluator & ev = myRegistry_->evaluator();
  28. DDXMLAttribute atts = getAttributeSet();
  29. DDSolid ddsphere = DDSolidFactory::sphere( getDDName(nmspace),
  30. ev.eval(nmspace, atts.find("innerRadius")->second),
  31. ev.eval(nmspace, atts.find("outerRadius")->second),
  32. ev.eval(nmspace, atts.find("startPhi")->second),
  33. ev.eval(nmspace, atts.find("deltaPhi")->second),
  34. ev.eval(nmspace, atts.find("startTheta")->second),
  35. ev.eval(nmspace, atts.find("deltaTheta")->second ));
  36. DDLSolid::setReference(nmspace, cpv);
  37. DCOUT_V('P', "DDLSphere::processElement completed");
  38. }