CMS 3D CMS Logo

DDLNumeric.cc
Go to the documentation of this file.
6 
7 #include <map>
8 #include <utility>
9 
10 class DDCompactView;
11 
13  : DDXMLElement( myreg )
14 {}
15 
16 void
18 {}
19 
20 void
22 {
23  if( parent() == "ConstantsSection" || parent() == "DDDefinition" )
24  {
25  DDNumeric ddnum( getDDName( nmspace ), std::make_unique<double>( myRegistry_->evaluator().eval( nmspace, getAttributeSet().find( "value" )->second )));
26  clear();
27  } // else, save it, don't clear it, because some other element (parent node) will use it.
28 }
29 
DDLElementRegistry * myRegistry_
Definition: DDXMLElement.h:172
virtual const DDXMLAttribute & getAttributeSet(size_t aIndex=0) const
Get a "row" of attributes, i.e. one attribute set.
Definition: DDXMLElement.cc:72
const std::string & parent(void) const
access to parent element name
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
U second(std::pair< T, U > const &p)
ClhepEvaluator & evaluator()
DDLNumeric(DDLElementRegistry *myreg)
Definition: DDLNumeric.cc:12
This is a base class for processing XML elements in the DDD.
Definition: DDXMLElement.h:48
void preProcessElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Called by loadAttributes AFTER attributes are loaded.
Definition: DDLNumeric.cc:17
double eval(const std::string &ns, const std::string &expr)
The main class for processing parsed elements.
virtual void clear(void)
clear this element&#39;s contents.
Definition: DDXMLElement.cc:54
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector> ...
Definition: DDConstant.h:18
virtual const DDName getDDName(const std::string &defaultNS, const std::string &attname=std::string("name"), size_t aIndex=0)
Definition: DDXMLElement.cc:79
void processElement(const std::string &name, const std::string &nmspace, DDCompactView &cpv) override
Processing the element.
Definition: DDLNumeric.cc:21