#include <DDDividedPolyhedra.h>
Public Member Functions | |
virtual void | checkParametersValidity () |
DDDividedPolyhedraRho (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 | ~DDDividedPolyhedraRho () |
Definition at line 18 of file DDDividedPolyhedra.h.
DDDividedPolyhedraRho::DDDividedPolyhedraRho | ( | const DDDivision & | div, |
DDCompactView * | cpv | ||
) |
Definition at line 19 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::calculateWidth(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().
: DDDividedGeometryObject( div, cpv ) { checkParametersValidity(); setType( "DivisionPolyhedraRho" ); DDPolyhedra msol = (DDPolyhedra)( div_.parent().solid() ); if( divisionType_ == DivWIDTH ) { compNDiv_ = calculateNDiv( msol.rMaxVec()[0] - msol.rMinVec()[0] , div_.width() , div_.offset() ); } else if( divisionType_ == DivNDIV ) { compWidth_ = calculateWidth( msol.rMaxVec()[0] - msol.rMinVec()[0] , div_.nReplicas() , div_.offset() ); } // for (int i = 0; i < compNDiv_; ++i) // { // DDpos( makeDDLogicalPart(i) // , div_.parent() // , i // , makeDDTranslation(i) // , makeDDRotation(i) // , &div_ // ); // } DCOUT_V ('P', " DDDividedPolyhedraRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n"); }
DDDividedPolyhedraRho::~DDDividedPolyhedraRho | ( | void | ) | [virtual] |
Definition at line 55 of file DDDividedPolyhedra.cc.
{}
void DDDividedPolyhedraRho::checkParametersValidity | ( | void | ) | [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 59 of file DDDividedPolyhedra.cc.
References gather_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, DDDivision::offset(), DDDivision::parent(), and DDLogicalPart::solid().
Referenced by DDDividedPolyhedraRho().
{ DDDividedGeometryObject::checkParametersValidity(); DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); if( divisionType_ == DivNDIVandWIDTH || divisionType_ == DivWIDTH ) { std::cout << "WARNING - " << "DDDividedPolyhedraRho::checkParametersValidity()" << std::endl << " Solid " << msol << std::endl << " Division along R will be done with a width " << "different for each solid section." << std::endl << " WIDTH will not be used !" << std::endl; } if( div_.offset() != 0. ) { std::cout << "WARNING - " << "DDDividedPolyhedraRho::checkParametersValidity()" << std::endl << " Solid " << msol << std::endl << " Division along R will be done with a width " << "different for each solid section." << std::endl << " OFFSET will not be used !" << std::endl; } }
double DDDividedPolyhedraRho::getMaxParameter | ( | void | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 88 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::div_, DDDivision::parent(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), and DDLogicalPart::solid().
{ DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); return msol.rMaxVec()[0] - msol.rMinVec()[0]; }
DDLogicalPart DDDividedPolyhedraRho::makeDDLogicalPart | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 107 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::compNDiv_, DCOUT_V, DDBase< N, C >::ddname(), DDPolyhedra::deltaPhi(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polyhedra(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDPolyhedra::sides(), DDLogicalPart::solid(), DDPolyhedra::startPhi(), tablePrinter::width, and DDPolyhedra::zVec().
{ DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); DDMaterial usemat = div_.parent().material(); std::vector<double> localrMaxVec = msol.rMaxVec(); std::vector<double> localrMinVec = msol.rMinVec(); std::vector<double> localzVec = msol.zVec(); std::vector<double> newrMinVec; std::vector<double> newrMaxVec; int nZplanes = localzVec.size(); double width = 0.; for(int ii = 0; ii < nZplanes; ++ii) { // width = CalculateWidth( origparamMother->Rmax[ii] // - origparamMother->Rmin[ii], compNDiv_, foffset ); // origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo; // origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1); width = calculateWidth(localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset()); newrMinVec[ii] = localrMinVec[ii] + div_.offset() + width * copyNo; newrMaxVec[ii] = localrMaxVec[ii] + div_.offset() + width * (copyNo + 1); } // phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers // phedra.Reset(); // reset to new solid parameters DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo) , div_.parent().ddname().ns()); DDSolid dsol = DDSolidFactory::polyhedra(solname , msol.sides() , msol.startPhi() , msol.deltaPhi() , localzVec , newrMinVec , newrMaxVec); DDLogicalPart ddlp = DDLogicalPart(solname, usemat, dsol); DCOUT_V ('P', "DDDividedPolyhedraRho:makeDDLogicalPart lp:" << ddlp); return ddlp; }
DDRotation DDDividedPolyhedraRho::makeDDRotation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 101 of file DDDividedPolyhedra.cc.
{ return DDRotation(); }
DDTranslation DDDividedPolyhedraRho::makeDDTranslation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 95 of file DDDividedPolyhedra.cc.
{ return DDTranslation(); }