1 #include "gearxml/VersatileDiskRowLayoutXML.h"
3 #include "gearxml/XMLHandler.h"
6 #include "gearxml/tinyxml.h"
7 #include "gearimpl/VersatileDiskRowLayout.h"
8 #include "gear/GearMgr.h"
23 if (padLayout==NULL) {
25 throw ParseException(
"VersatileDiskRowLayoutXML::toXML wrong type !");
31 padRowLayout2DXML.
SetAttribute(
"type",
"VersatileDiskRowLayout");
35 for (std::vector<VersatileDiskRowLayout::Row>::const_iterator rowIter = padLayout->
rows().begin();
36 rowIter < padLayout->
rows().end(); rowIter ++)
51 return padRowLayout2DXML ;
65 double padPitch = atof(
getXMLAttribute( xmlRow,
"padPitch" ) .c_str() ) ;
66 double rowHeight = atof(
getXMLAttribute( xmlRow ,
"rowHeight" ) .c_str() ) ;
73 padLayout->
addRow( nPad, padPitch, rowHeight, offset, padWidth, padHeight, repeat );
Abstract description of a planar subdetector with pads (cells) that are positioned in rows (circular ...
std::string getOptionalXMLAttribute(const TiXmlNode *node, const std::string &name, const std::string &defaultValue)
Helper method used for parsing XML.
virtual PadRowLayout2D * fromXML(const TiXmlElement *xmlElement) const
Creates the appropriate PadRowLayout2D subclass from the given XML element (node) ...
virtual const std::vector< double > & getPlaneExtent() const
Extent of the sensitive plane - [xmin,xmax,ymin,ymax] CARTESIAN or [rmin,rmax,phimin,phimax] POLAR.
const std::vector< Row > & rows() const
Get access to the individual rows.
virtual TiXmlElement toXML(const PadRowLayout2D *layout) const
Creates an XML node for the given PadRowLayout2D.
virtual void addRow(int nPads, double padPitch, double rowHeight, double offset=0., double padWidth=0., double padHeight=0., int repeat=1)
Add 'repeat' rows with the given parameters.
The parent class for everything in the Document Object Model.
ParseException used for parse errors, e.g.
std::string getXMLAttribute(const TiXmlNode *node, const std::string &name)
Helper method used for parsing XML.
The element is a container class.
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
void SetDoubleAttribute(const char *name, double value)
Sets an attribute of name to a given value.
const TiXmlNode * IterateChildren(const TiXmlNode *previous) const
An alternate way to walk the children of a node.
void SetAttribute(const char *name, const char *value)
Sets an attribute of name to a given value.
Implementation of PadRowLayout2D for a wedge shaped module.