#include <DDDividedCons.h>
Public Member Functions | |
DDDividedConsZ (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 | ~DDDividedConsZ () |
Definition at line 50 of file DDDividedCons.h.
DDDividedConsZ::DDDividedConsZ | ( | const DDDivision & | div, |
DDCompactView * | cpv | ||
) |
Definition at line 225 of file DDDividedCons.cc.
References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), DDDivision::width(), and DDCons::zhalf().
: DDDividedGeometryObject::DDDividedGeometryObject( div, cpv ) { checkParametersValidity(); DDCons msol = (DDCons)(div_.parent().solid()); setType( "DivisionConsZ" ); if( divisionType_ == DivWIDTH ) { DDCons msol = (DDCons)(div_.parent().solid()); compNDiv_ = calculateNDiv( 2*msol.zhalf() , div_.width(), div_.offset() ); } else if( divisionType_ == DivNDIV ) { DDCons msol = (DDCons)(div_.parent().solid()); compWidth_ = calculateWidth( 2*msol.zhalf() , div_.nReplicas(), div_.offset() ); } DCOUT_V( 'P', " DDDividedConsZ - no divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << "\n Width " << compWidth_ << " = " << div_.width() << "\n DivType " << divisionType_ ); }
DDDividedConsZ::~DDDividedConsZ | ( | void | ) | [virtual] |
Definition at line 252 of file DDDividedCons.cc.
{}
double DDDividedConsZ::getMaxParameter | ( | void | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 256 of file DDDividedCons.cc.
References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDCons::zhalf().
DDLogicalPart DDDividedConsZ::makeDDLogicalPart | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 286 of file DDDividedCons.cc.
References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), DCOUT_V, ddcons, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDCons::zhalf().
{ DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo) , div_.parent().ddname().ns()); DDSolid ddcons(solname); DDMaterial usemat(div_.parent().material()); DDCons msol = (DDCons)(div_.parent().solid()); double mHalfLength = msol.zhalf(); double aRInner = (msol.rInPlusZ() - msol.rInMinusZ()) / (2*mHalfLength); double bRInner = (msol.rInPlusZ() + msol.rInMinusZ()) / 2; double aROuter = (msol.rOutPlusZ() - msol.rOutMinusZ()) / (2*mHalfLength); double bROuter = (msol.rOutPlusZ() + msol.rOutMinusZ()) / 2; double xMinusZ = -mHalfLength + div_.offset() + compWidth_*copyNo; double xPlusZ = -mHalfLength + div_.offset() + compWidth_*(copyNo+1); double pDz = compWidth_ / 2.; double pSPhi = msol.phiFrom(); double pDPhi = msol.deltaPhi(); ddcons = DDSolidFactory::cons(DDName(solname) , pDz , aRInner * xMinusZ + bRInner , aROuter * xMinusZ + bROuter , aRInner * xPlusZ + bRInner , aROuter * xPlusZ + bROuter , pSPhi , pDPhi ); DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons); DCOUT_V( 'P', " DDDividedConsZ::makeDDLogicalPart() lp:" << ddlp ); return ddlp; }
DDRotation DDDividedConsZ::makeDDRotation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 263 of file DDDividedCons.cc.
References DCOUT_V.
{ DDRotation myddrot; // sets to identity. DCOUT_V ('P', "DDDividedConsZ::makeDDRotation : " << myddrot); return myddrot; }
DDTranslation DDDividedConsZ::makeDDTranslation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 271 of file DDDividedCons.cc.
References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDAxesNames::name(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDCons::zhalf().
{ //----- translation DDTranslation translation; DDCons motherCons = (DDCons)(div_.parent().solid()); double posi = - motherCons.zhalf() + div_.offset() + compWidth_/2 + copyNo*compWidth_; translation.SetZ(posi); DCOUT_V ('P', " DDDividedConsZ " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis())); return translation; }