#include <DDDividedTubs.h>
Public Member Functions | |
DDDividedTubsPhi (const DDDivision &div, DDCompactView *cpv) | |
virtual double | getMaxParameter () const |
virtual DDLogicalPart | makeDDLogicalPart (const int copyNo) const |
virtual DDRotation | makeDDRotation (const int copyNo) const |
virtual DDTranslation | makeDDTranslation (const int copyNo) const |
virtual | ~DDDividedTubsPhi () |
Definition at line 32 of file DDDividedTubs.h.
DDDividedTubsPhi::DDDividedTubsPhi | ( | const DDDivision & | div, |
DDCompactView * | cpv | ||
) |
Definition at line 96 of file DDDividedTubs.cc.
References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DDTubs::deltaPhi(), DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().
: DDDividedGeometryObject::DDDividedGeometryObject( div, cpv ) { checkParametersValidity(); setType( "DivisionTubsPhi" ); DDTubs msol = (DDTubs)(div_.parent().solid()); if( divisionType_ == DivWIDTH ) { //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees if( msol.deltaPhi() == 360.*deg ) { compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. ); }else { compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), div_.offset() ); } } else if( divisionType_ == DivNDIV ) { if( msol.deltaPhi() == 360.*deg ) { compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. ); }else { compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), div_.offset() ); } } }
DDDividedTubsPhi::~DDDividedTubsPhi | ( | void | ) | [virtual] |
Definition at line 123 of file DDDividedTubs.cc.
{}
double DDDividedTubsPhi::getMaxParameter | ( | void | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 127 of file DDDividedTubs.cc.
References DDTubs::deltaPhi(), DDDividedGeometryObject::div_, DDDivision::parent(), and DDLogicalPart::solid().
DDLogicalPart DDDividedTubsPhi::makeDDLogicalPart | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 160 of file DDDividedTubs.cc.
References DDDividedGeometryObject::compWidth_, DCOUT_V, ddtubs, DDDividedGeometryObject::div_, DDLogicalPart::material(), DDBase< N, C >::name(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDSolidFactory::tubs().
{ DDName solname(div_.name()); //- DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns()); DDSolid ddtubs(solname); DDMaterial usemat(div_.parent().material()); DDTubs msol = (DDTubs) (div_.parent().solid()); DDLogicalPart ddlp(solname); if (!ddtubs.isDefined().second) // only if it is not defined, make new dimensions and solid. { double pRMin = msol.rIn(); double pRMax = msol.rOut(); double pDz = msol.zhalf(); double pSPhi = msol.startPhi()+div_.offset(); double pDPhi = compWidth_; ddtubs = DDSolidFactory::tubs(DDName(solname), pDz, pRMin, pRMax, pSPhi, pDPhi); ddlp = DDLogicalPart(solname, usemat, ddtubs); } DCOUT_V ('P', " DDDividedTubsPhi::computeDimensions() lp:" << ddlp); return ddlp; }
DDRotation DDDividedTubsPhi::makeDDRotation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 134 of file DDDividedTubs.cc.
References DDDividedGeometryObject::changeRotMatrix(), DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDrot(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDName::name(), DDName::ns(), and DDDivision::parent().
{ DDRotation myddrot; // sets to identity. double posi = ( copyNo - 1 ) * compWidth_; // This should put the first one at the 0 of the parent. DDRotationMatrix * rotMat = changeRotMatrix( posi ); // how to name the rotation?? // i hate this crap :-) DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + DDXMLElement::itostr(copyNo) , div_.parent().ddname().ns()); myddrot = DDrot(ddrotname, rotMat); return myddrot; }
DDTranslation DDDividedTubsPhi::makeDDTranslation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 150 of file DDDividedTubs.cc.
References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, and DDAxesNames::name().
{ //----- translation DDTranslation translation; DCOUT_V ('P', " DDDividedTubsPhi " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis())); return translation; }