#ifndef AGDDTUBSHH #define AGDDTUBSHH #include "agddSection.hh" #include "agddPrimarySolid.hh" #include "agddAttribute.hh" #include "DWUnits.hh" #include "agddNumberString.hh" namespace agdd { class Tubs : public PrimarySolid { private: Attribute _params; public: explicit Tubs() : PrimarySolid("tubs"), _params ("Rio_Z" , Attribute::required) { }; void putMyselfIn(Section * sec) { assert(sec); // If this composition is already in a section, we need not go further. if (thisVolumeIsNotInSomeSection()) { cout << "Creating a " << flush << getTag() << " named " << flush << getName() << " ... " << endl; makeTheElement(); putThisVolumeElementIntoThisSection(theElement(), sec); doPrimarySolidThingsToThisElement(theElement()); // Now we need to put in the poses. _params.addAttributeTo(theElement()); cout << "done." << endl; } }; void setTubs(double rMin, double rMax, double zLength, double phi1 = 0.0*DWdegree, double phi2 = 360.0*DWdegree) { _params.setValue( makeNumberString(rMin/DWmm, rMax/DWmm, zLength/DWmm, phi1/DWdegree, phi2/DWdegree)); }; }; } #endif