CMS 3D CMS Logo

Public Member Functions

DDLTubs Class Reference

DDLTubs processes Tubs elements. More...

#include <DDLTubs.h>

Inheritance diagram for DDLTubs:
DDLSolid DDXMLElement

List of all members.

Public Member Functions

 DDLTubs (DDLElementRegistry *myreg)
 Constructor.
void processElement (const std::string &name, const std::string &nmspace, DDCompactView &cpv)
 Processing the element.
 ~DDLTubs (void)
 Destructor.

Detailed Description

DDLTubs processes Tubs elements.

Author:
Michael Case

DDLTubs.h - description ------------------- begin: Mon Oct 29 2001 email: case@ucdhep.ucdavis.edu

Tube and Tubs elements are handled by this processor.

Definition at line 22 of file DDLTubs.h.


Constructor & Destructor Documentation

DDLTubs::DDLTubs ( DDLElementRegistry myreg)

Constructor.

Definition at line 22 of file DDLTubs.cc.

  : DDLSolid( myreg )
{}
DDLTubs::~DDLTubs ( void  )

Destructor.

Definition at line 26 of file DDLTubs.cc.

{}

Member Function Documentation

void DDLTubs::processElement ( const std::string &  name,
const std::string &  nmspace,
DDCompactView cpv 
) [virtual]

Processing the element.

The processElement method completes any necessary work to process the XML element.

For example, this can be used to call the DDCore to make the geometry in memory. There is a default for this so that if not declared in the inheriting class, no processing is done.

Reimplemented from DDXMLElement.

Definition at line 31 of file DDLTubs.cc.

References DCOUT_V, ExprEvalInterface::eval(), DDXMLElement::getAttributeSet(), DDXMLElement::getDDName(), DDI::Singleton< I >::instance(), MatrixRunner::msg, DDLSolid::setReference(), DDXMLElement::throwError(), DDSolidFactory::truncTubs(), and DDSolidFactory::tubs().

{
  DCOUT_V('P', "DDLTubs::processElement started");

  ExprEvalInterface & ev = ExprEvalSingleton::instance();
  DDXMLAttribute atts = getAttributeSet();
  bool cutInside(false);

  if (atts.find("cutInside") != atts.end()) {
    cutInside = (atts.find("cutInside")->second == "true") ? true : false;
  }

  if (name == "Tubs")
  {
    DDSolid myTubs = DDSolidFactory::tubs( getDDName(nmspace),
                                           ev.eval(nmspace, atts.find("dz")->second),
                                           ev.eval(nmspace, atts.find("rMin")->second),
                                           ev.eval(nmspace, atts.find("rMax")->second),
                                           ev.eval(nmspace, atts.find("startPhi")->second),
                                           ev.eval(nmspace, atts.find("deltaPhi")->second));
  }
  else if (name == "Tube")
  {
    DDSolid myTubs = DDSolidFactory::tubs( getDDName(nmspace),
                                           ev.eval(nmspace, atts.find("dz")->second),
                                           ev.eval(nmspace, atts.find("rMin")->second),
                                           ev.eval(nmspace, atts.find("rMax")->second),
                                           0,
                                           360*deg );
  }
  else if (name == "TruncTubs")
  {      
    DDSolid myTT = DDSolidFactory::truncTubs( getDDName(nmspace),
                                              ev.eval(nmspace, atts.find("zHalf")->second),
                                              ev.eval(nmspace, atts.find("rMin")->second),
                                              ev.eval(nmspace, atts.find("rMax")->second),
                                              ev.eval(nmspace, atts.find("startPhi")->second), //0. // startPhi
                                              ev.eval(nmspace, atts.find("deltaPhi")->second),
                                              ev.eval(nmspace, atts.find("cutAtStart")->second),
                                              ev.eval(nmspace, atts.find("cutAtDelta")->second),
                                              cutInside ); // cutInside
  }
  else
  {
    std::string msg = "\nDDLTubs::processElement could not process element.";
    throwError(msg);
  }
  DDLSolid::setReference(nmspace, cpv);

  DCOUT_V('P', "DDLTubs::processElement completed");

}