PageRenderTime 25ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 8#include "DetectorDescription/Parser/src/DDLNumeric.h"
 9
10#include "DetectorDescription/Base/interface/DDdebug.h"
11#include "DetectorDescription/ExprAlgo/interface/ClhepEvaluator.h"
12
13DDLNumeric::DDLNumeric( DDLElementRegistry* myreg )
14  : DDXMLElement( myreg )
15{}
16
17DDLNumeric::~DDLNumeric( void )
18{}
19 
20void
21DDLNumeric::preProcessElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
22{}
23
24void
25DDLNumeric::processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
26{
27  DCOUT_V( 'P', "DDLNumeric::processElement started" );
28
29  if( parent() == "ConstantsSection" || parent() == "DDDefinition" )
30  {
31    DDNumeric ddnum( getDDName( nmspace ), new double( myRegistry_->evaluator().eval( nmspace, getAttributeSet().find( "value" )->second )));
32    clear();
33  } // else, save it, don't clear it, because some other element (parent node) will use it.
34
35  DCOUT_V( 'P', "DDLNumeric::processElement completed" );
36}
37