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

/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 *                                                                         *
10 *           DDDParser sub-component of DDD                                *
11 *                                                                         *
12 ***************************************************************************/
13
14#include "DetectorDescription/Parser/src/DDLSphere.h"
15
16#include "DetectorDescription/Core/interface/DDName.h"
17#include "DetectorDescription/Core/interface/DDSolid.h"
18#include "DetectorDescription/Base/interface/DDdebug.h"
19
20#include "DetectorDescription/ExprAlgo/interface/ClhepEvaluator.h"
21
22DDLSphere::DDLSphere( DDLElementRegistry* myreg )
23  : DDLSolid( myreg )
24{}
25
26DDLSphere::~DDLSphere( void )
27{}
28
29// Upon encountering the end of the Sphere element, call DDCore.
30void
31DDLSphere::processElement( const std::string& name, const std::string& nmspace, DDCompactView& cpv )
32{  
33  DCOUT_V('P', "DDLSphere::processElement started");
34  ClhepEvaluator & ev = myRegistry_->evaluator();
35  DDXMLAttribute atts = getAttributeSet();
36  DDSolid ddsphere = DDSolidFactory::sphere( getDDName(nmspace),
37					     ev.eval(nmspace, atts.find("innerRadius")->second),
38					     ev.eval(nmspace, atts.find("outerRadius")->second),
39					     ev.eval(nmspace, atts.find("startPhi")->second),
40					     ev.eval(nmspace, atts.find("deltaPhi")->second),
41					     ev.eval(nmspace, atts.find("startTheta")->second),
42					     ev.eval(nmspace, atts.find("deltaTheta")->second ));
43  
44  DDLSolid::setReference(nmspace, cpv);
45
46  DCOUT_V('P', "DDLSphere::processElement completed");
47}