diff --git a/DDCore/include/XML/XMLObjects.h b/DDCore/include/XML/XMLObjects.h deleted file mode 100644 index 8efa219704e10a38f73129b787add1fab1ef2aa5..0000000000000000000000000000000000000000 --- a/DDCore/include/XML/XMLObjects.h +++ /dev/null @@ -1,162 +0,0 @@ -#ifndef DD4hep_OBJECTS_H -#define DD4hep_OBJECTS_H - -// Framework include files -#include "XML/XMLTags.h" - -/* - * DD4hep namespace declaration - */ -namespace DD4hep { - - class IDDescriptor; - - /* - * XML namespace declaration - */ - namespace XML { - - struct Author : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - Author(Handle_t e) : RefElement(e) {} - /// Constructor to be used when creating a new DOM tree - Author(const Document& doc) : RefElement(doc,Tag_author,Tag_empty) {} - void setAuthorName(const char* nam) { setAttr(Attr_name,nam); } - void setAuthorEmail(const char* addr) { setAttr(Attr_email,addr); } - }; - - struct Header : public Element { - /// Constructor to be used when reading the already parsed DOM tree - Header(Handle_t e=0) : Element(e) {} - /// Constructor to be used when creating a new DOM tree - Header(const Document& doc) : Element(doc,Tag_header) {} - Header& fromCompact(Document doc, Handle_t element, const XMLCh* fname); - }; - - struct Constant : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - Constant(Handle_t e) : RefElement(e) {} - /// Constructor to be used when creating a new DOM tree - Constant(const Document& doc, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree - Constant(const Document& doc, const XMLCh* name, const XMLCh* val); - void setValue(const char* val) { setAttr(Attr_value,val); } - }; - - struct XYZ_element : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - XYZ_element(Handle_t e) : RefElement(e) {} - /// Constructor to be used when creating a new DOM tree - XYZ_element(const Document& doc, const XMLCh* type, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree. Automatically sets attributes - XYZ_element(const Document& doc, const XMLCh* type, const XMLCh* name, double x, double y, double z); - /// Constructor to be used when creating a new DOM tree. Automatically sets attributes - XYZ_element(const Document& doc, const XMLCh* type, const XMLCh* name, const XMLCh* x, const XMLCh* y, const XMLCh* z); - const XYZ_element& setX(double value) const; - const XYZ_element& setY(double value) const; - const XYZ_element& setZ(double value) const; - const XYZ_element& fromXML(Handle_t values); - }; - - struct Position : public XYZ_element { - /// Constructor to be used when reading the already parsed DOM tree - Position(Handle_t e) : XYZ_element(e) {} - /// Constructor to be used when creating a new DOM tree - Position(const RefElement& e) : XYZ_element(e) {} - /// Constructor to be used when creating a new DOM tree - Position(const Document& doc, const XMLCh* name) - : XYZ_element(doc,Tag_position,name) {} - /// Constructor to be used when creating a new DOM tree. Automatically sets attributes - Position(const Document& doc, const XMLCh* name, double x, double y, double z) - : XYZ_element(doc,Tag_position,name,x,y,z) {} - /// Constructor to be used when creating a new DOM tree. Automatically sets attributes - Position(const Document& doc, const XMLCh* name, const XMLCh* x, const XMLCh* y, const XMLCh* z) - : XYZ_element(doc,Tag_position,name,x,y,z) {} - }; - - struct Rotation : public XYZ_element { - /// Constructor to be used when reading the already parsed DOM tree - Rotation(Handle_t e) : XYZ_element(e) {} - /// Constructor to be used when creating a new DOM tree - Rotation(const RefElement& e) : XYZ_element(e) {} - /// Constructor to be used when creating a new DOM tree - Rotation(const Document& doc, const XMLCh* name) - : XYZ_element(doc,Tag_rotation,name) {} - /// Constructor to be used when creating a new DOM tree. Automatically sets attributes - Rotation(const Document& doc, const XMLCh* name, double x, double y, double z) - : XYZ_element(doc,Tag_rotation,name,x,y,z) {} - /// Constructor to be used when creating a new DOM tree. Automatically sets attributes - Rotation(const Document& doc, const XMLCh* name, const XMLCh* x, const XMLCh* y, const XMLCh* z) - : XYZ_element(doc,Tag_rotation,name,x,y,z) {} - }; - - struct Atom : public RefElement { - /// Constructor to be used when creating a new DOM tree - Atom(Handle_t e) : RefElement(e) {} - /// Constructor to be used when reading the already parsed DOM tree - Atom(const Document& doc, const XMLCh* name); - }; - - struct Material : public RefElement { - /// Constructor to be used when creating a new DOM tree - Material(const Handle_t& e) : RefElement(e) {} - /// Constructor to be used when creating a new DOM tree - Material(const RefElement& e) : RefElement(e) {} - /// Constructor to be used when reading the already parsed DOM tree - Material(const Document& doc, const XMLCh* name); - }; - - struct VisAttr : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - VisAttr(Handle_t e) : RefElement(e) {} - /// Constructor to be used when reading the already parsed DOM tree - VisAttr(const RefElement& e) : RefElement(e) {} - /// Constructor to be used when creating a new DOM tree - VisAttr(const Document& doc, const XMLCh* name); - void setVisible(bool value); - /// Convert compact visualization attribute to LCDD visualization attribute - const VisAttr& fromCompact(Handle_t e) const; - }; - - struct Limit : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - Limit(Handle_t h) : RefElement(h) {} - /// Constructor to be used when creating a new DOM tree - Limit(const Document& doc, const XMLCh* name); - void setParticles(const XMLCh* particleNames); - void setValue(double value); - void setUnit(const XMLCh* unit); - }; - - struct Region : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - Region(Handle_t h) : RefElement(h) {} - /// Constructor to be used when creating a new DOM tree - Region(const Document& doc, const XMLCh* name); - Region& setStoreSecondaries(bool value); - Region& setThreshold(double value); - Region& setCut(double value); - Region& setLengthUnit(const XMLCh* unit); - Region& setEnergyUnit(const XMLCh* unit); - }; - - struct LimitSet : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - LimitSet(Handle_t h) : RefElement(h) {} - /// Constructor to be used when creating a new DOM tree - LimitSet(const Document& doc, const XMLCh* name); - void addLimit(const Limit& limit); - }; - - struct IDSpec : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - IDSpec(Handle_t h) : RefElement(h) {} - /// Constructor to be used when creating a new DOM tree - IDSpec(const Document& doc, const XMLCh* name, const IDDescriptor& dsc); - void addField(const XMLCh* name, const std::pair<int,int>& field); - void addField(const std::string& name, const std::pair<int,int>& field); - }; - - } -} /* End namespace DD4hep */ -#endif /* DD4hep_OBJECTS_H */ diff --git a/DDCore/include/XML/XMLShapes.h b/DDCore/include/XML/XMLShapes.h deleted file mode 100644 index 9ecee2a72b2ecf183f90de9837f2cfd99520a13d..0000000000000000000000000000000000000000 --- a/DDCore/include/XML/XMLShapes.h +++ /dev/null @@ -1,174 +0,0 @@ -#ifndef DD4hep_XMLSHAPES_H -#define DD4hep_XMLSHAPES_H -#include "XML/XMLTags.h" - -// C/C++ include files -#define _USE_MATH_DEFINES -#include <cmath> - -/* - * DD4hep namespace declaration - */ -namespace DD4hep { - - /* - * XML namespace declaration - */ - namespace XML { - - struct Position; - struct Rotation; - - struct ZPlane : public Element { - /// Constructor to be used when reading the already parsed DOM tree - ZPlane(Handle_t e) : Element(e) {} - /// Constructor to be used when creating a new DOM tree - ZPlane(const Document& doc, double rmin, double rmax, double z); - /// Constructor to be used when creating a new DOM tree - ZPlane(const Document& doc, const XMLCh* rmin, const XMLCh* rmax, const XMLCh* z); - /// Set values - ZPlane& setRmin(double value); - ZPlane& setRmax(double value); - ZPlane& setZ(double value); - }; - - struct Solid : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - Solid(const Element& e) : RefElement(e) {} - /// Constructor to be used when creating a new DOM tree - Solid(const Document& doc, const XMLCh* type, const XMLCh* name) : RefElement(doc,type,name) {} - }; - - struct Box : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - Box(const Element& e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree - Box(const Document& doc, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree - Box(const Document& doc, const XMLCh* name, double x, double y, double z); - /// Set the box dimensions - Box& setDimensions(double x, double y, double z); - }; - - struct Polycone : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - Polycone(const Element& e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree - Polycone(const Document& doc, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree - Polycone(const Document& doc, const XMLCh* name, double start, double delta); - /// Add all Z-planes to the Polycone. Take the information from the given element - void addZPlanes(Handle_t e); - }; - - struct Tube : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - Tube(const Element& e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree - Tube(const Document& doc, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree with attribute initialization - Tube(const Document& doc, const XMLCh* name, double rmin, double rmax, double z, double deltaPhi=2*M_PI); - /// Set the box dimensions - Tube& setDimensions(double rmin, double rmax, double z, double deltaPhi=2*M_PI); - void fromCompact(Handle_t h); - }; - - struct Cone : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - Cone(const Element& e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree - Cone(const Document& doc, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree with attribute initialization - Cone(const Document& doc, const XMLCh* name, - double rmin1, - double rmin2, - double rmax1, - double rmax2, - double z, - double startphi, - double deltaphi); - Cone& setZ(double z); - Cone& setRmin1(double r); - Cone& setRmax1(double r); - Cone& setRmin2(double r); - Cone& setRmax2(double r); - Cone& setStartPhi(double phi); - Cone& setDeltaPhi(double phi); - void fromCompact(Handle_t h); - }; - - struct Trap : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - Trap(const Element& e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree with attribute initialization - Trap( const Document& doc, const XMLCh* name, - double z, - double theta, - double phi, - double y1, - double x1, - double x2, - double alpha1, - double y2, - double x3, - double x4, - double alpha2); - double zHalfLength() const; - double theta() const; - double phi() const; - double yHalfLength1() const; - double xHalfLength1() const; - double xHalfLength2() const; - double alpha1() const; - double yHalfLength2() const; - double xHalfLength3() const; - double xHalfLength4() const; - double alpha2() const; - }; - - struct Trapezoid : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - Trapezoid(const Element& e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree - Trapezoid(const Document& doc, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree with attribute initialization - Trapezoid(const Document& doc, const XMLCh* name, double x1, double x2, double y1, double y2, double z); - Trapezoid& setX1(double value); - Trapezoid& setX2(double value); - Trapezoid& setY1(double value); - Trapezoid& setY2(double value); - Trapezoid& setZ(double value); - double x1() const; - double x2() const; - double y1() const; - double y2() const; - double z() const; - }; - - struct PolyhedraRegular : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - PolyhedraRegular(const Element& e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree - PolyhedraRegular(const Document& doc, const XMLCh* name, int nsides, double rmin, double rmax, double zlen); - }; - - struct BooleanSolid : public Solid { - /// Constructor to be used when reading the already parsed DOM tree - BooleanSolid(Handle_t e) : Solid(e) {} - /// Constructor to be used when creating a new DOM tree - BooleanSolid(const Document& doc, const XMLCh* type, const XMLCh* name); - BooleanSolid& setFirstSolid(const Solid& s); - BooleanSolid& setSecondSolid(const Solid& s); - BooleanSolid& setPosition(const Position& pos); - BooleanSolid& setRotation(const Rotation& rot); - }; - - struct SubtractionSolid : public BooleanSolid { - /// Constructor to be used when reading the already parsed DOM tree - SubtractionSolid(Handle_t e) : BooleanSolid(e) {} - /// Constructor to be used when creating a new DOM tree - SubtractionSolid(const Document& doc, const XMLCh* name); - }; - } -} /* End namespace DD4hep */ -#endif /* DD4hep_XMLSHAPES_H */ diff --git a/DDCore/include/XML/XMLVolumes.h b/DDCore/include/XML/XMLVolumes.h deleted file mode 100644 index 564183a194ce2529ae0687a81ced61b602ff87b8..0000000000000000000000000000000000000000 --- a/DDCore/include/XML/XMLVolumes.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef DD4hep_XMLVOLUMES_H -#define DD4hep_XMLVOLUMES_H -#include "XML/XMLElements.h" - -/* - * DD4hep namespace declaration - */ -namespace DD4hep { - - /* - * XML namespace declaration - */ - namespace XML { - - struct Solid; - struct Material; - struct Volume; - struct PhysVol; - struct Position; - struct Rotation; - - struct Volume : public RefElement { - /// Constructor to be used when reading the already parsed DOM tree - Volume(Handle_t e = Handle_t(0)); - /// Constructor to be used when reading the already parsed DOM tree - Volume(const RefElement& e); - /// Constructor to be used when creating a new DOM tree - Volume(const Document& document, const XMLCh* name); - /// Constructor to be used when creating a new DOM tree. Also sets materuial and solid attributes - Volume(const Document& document, const XMLCh* name, const Solid& s, const Material& m); - Attribute setSolid(const Solid& s) const; - Attribute setMaterial(const Material& m) const; - void addPhysVol(const PhysVol& vol) const; - void setRegion(const RefElement& obj) const; - void setLimitSet(const RefElement& obj) const; - void setSensitiveDetector(const RefElement& obj) const; - void setVisAttributes(const RefElement& obj) const; - const XMLCh* solidRef() const; - }; - - struct PhysVol : Element { - /// Constructor to be used when reading the already parsed DOM tree - PhysVol(Handle_t e); - /// Constructor to be used when creating a new DOM tree - PhysVol(const Document& document, Volume vol); - /// Constructor to be used when creating a new DOM tree with additional parameters - PhysVol(const Document& document, Volume vol, const Position& pos, const Rotation& rot); - PhysVol& addPhysVolID(const XMLCh* name, int value); - PhysVol& setRotation(const RefElement& rot); - PhysVol& setPosition(const RefElement& pos); - PhysVol& setZ(double value); - }; - } -} /* End namespace DD4hep */ -#endif /* DD4hep_XMLVOLUMES_H */