/DetectorDescription/Parser/src/DDLNumeric.cc

https://github.com/aivanov-cern/cmssw · C++ · 37 lines · 22 code · 9 blank · 6 comment · 4 complexity · 7f727cc4b358283c8087cb31f53a4f32 MD5 · raw file

  1. /***************************************************************************
  2. DDLNumeric.cc - description
  3. -------------------
  4. begin : Friday Nov. 21, 2003
  5. email : case@ucdhep.ucdavis.edu
  6. ***************************************************************************/
  7. #include "DetectorDescription/Parser/src/DDLNumeric.h"
  8. #include "DetectorDescription/Base/interface/DDdebug.h"
  9. #include "DetectorDescription/ExprAlgo/interface/ClhepEvaluator.h"
  10. DDLNumeric::DDLNumeric( DDLElementRegistry* myreg )
  11. : DDXMLElement( myreg )
  12. {}
  13. DDLNumeric::~DDLNumeric( void )
  14. {}
  15. void
  16. DDLNumeric::preProcessElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
  17. {}
  18. void
  19. DDLNumeric::processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
  20. {
  21. DCOUT_V( 'P', "DDLNumeric::processElement started" );
  22. if( parent() == "ConstantsSection" || parent() == "DDDefinition" )
  23. {
  24. DDNumeric ddnum( getDDName( nmspace ), new double( myRegistry_->evaluator().eval( nmspace, getAttributeSet().find( "value" )->second )));
  25. clear();
  26. } // else, save it, don't clear it, because some other element (parent node) will use it.
  27. DCOUT_V( 'P', "DDLNumeric::processElement completed" );
  28. }