#include <DDDividedPolyhedra.h>
Public Member Functions | |
virtual void | checkParametersValidity () |
DDDividedPolyhedraZ (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 | ~DDDividedPolyhedraZ () |
Definition at line 64 of file DDDividedPolyhedra.h.
DDDividedPolyhedraZ::DDDividedPolyhedraZ | ( | const DDDivision & | div, |
DDCompactView * | cpv | ||
) |
Definition at line 286 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(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), DDDivision::width(), and DDPolyhedra::zVec().
: DDDividedGeometryObject( div, cpv ) { checkParametersValidity(); setType( "DivisionPolyhedraZ" ); DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); std::vector<double> zvec = msol.zVec(); if ( divisionType_ == DivWIDTH ) { compNDiv_ = calculateNDiv( zvec[zvec.size() - 1] - zvec[0], div_.width(), div_.offset() ); } else if( divisionType_ == DivNDIV ) { compWidth_ = calculateWidth( zvec[zvec.size() - 1] - zvec[0], div_.nReplicas(), div_.offset()); // ?what? CalculateNDiv( zvec[zvec.size() - 1] - zvec[0], origparamMother->Z_values[origparamMother->Num_z_planes-1] // - origparamMother->Z_values[0] , nDiv, offset ); } DCOUT_V ('P', " DDDividedPolyhedraZ - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << " = " << div_.offset() << "\n Width " << compWidth_ << " = " << div_.width()); }
DDDividedPolyhedraZ::~DDDividedPolyhedraZ | ( | void | ) | [virtual] |
Definition at line 313 of file DDDividedPolyhedra.cc.
{}
void DDDividedPolyhedraZ::checkParametersValidity | ( | void | ) | [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 326 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::compNDiv_, gather_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, DDDivision::offset(), DDDivision::parent(), asciidump::s, DDLogicalPart::solid(), and DDPolyhedra::zVec().
Referenced by DDDividedPolyhedraZ().
{ DDDividedGeometryObject::checkParametersValidity(); DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); if( divisionType_ == DivNDIVandWIDTH || divisionType_ == DivWIDTH ) { std::cout << "WARNING - " << "DDDividedPolyhedraZ::checkParametersValidity()" << std::endl << " Solid " << msol << std::endl << " Division along Z will be done splitting " << "in the defined z_planes." << std::endl << " WIDTH will not be used !" << std::endl; } if( div_.offset() != 0. ) { std::cout << "WARNING - " << "DDDividedPolyhedraZ::checkParametersValidity()" << std::endl << " Solid " << msol << std::endl << " Division along Z will be done splitting " << "in the defined z_planes." << std::endl << " OFFSET will not be used !" << std::endl; } std::vector<double> zvec = msol.zVec(); if ( zvec.size() - 1 != size_t(compNDiv_) ) { std::cout << "ERROR - " << "DDDividedPolyhedraZ::checkParametersValidity()" << std::endl << " Division along Z can only be done by splitting in the defined" << std::endl << " z_planes, i.e, the number of division would be :" << " " << zvec.size() - 1 << " instead of " << compNDiv_ << " !" << std::endl; std::string s = "DDDividedPolyhedraZ::checkParametersValidity()"; s += "Illegal Construct. Not a supported configuration."; throw DDException (s); } }
double DDDividedPolyhedraZ::getMaxParameter | ( | void | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 317 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDPolyhedra::zVec().
{ DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); std::vector<double> zvec = msol.zVec(); return (zvec[zvec.size() - 1] - zvec[0]); }
DDLogicalPart DDDividedPolyhedraZ::makeDDLogicalPart | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 396 of file DDDividedPolyhedra.cc.
References DCOUT_V, DDBase< N, C >::ddname(), DDPolyhedra::deltaPhi(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::parent(), DDSolidFactory::polyhedra(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDPolyhedra::sides(), DDLogicalPart::solid(), DDPolyhedra::startPhi(), and DDPolyhedra::zVec().
{ // only for mother number of planes = 2!! // mec: what? why? comment above and = 2 below straight from G4 impl. DDPolyhedra msol = (DDPolyhedra)( div_.parent().solid()); DDMaterial usemat = div_.parent().material(); std::vector<double> zvec = msol.zVec(); std::vector<double> rminvec = msol.rMinVec(); std::vector<double> rmaxvec = msol.rMaxVec(); double posi = ( zvec[ copyNo ] + zvec[ copyNo + 1 ] ) / 2.0; DDName solname( div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr( copyNo ), div_.parent().ddname().ns()); std::vector<double> newRmin, newRmax, newZ; newZ.push_back( zvec[ copyNo ] - posi ); newZ.push_back( zvec[ copyNo + 1 ] - posi ); newRmin.push_back( rminvec[ copyNo ]); newRmin.push_back( rminvec[ copyNo + 1 ]); newRmax.push_back( rmaxvec[ copyNo ]); newRmax.push_back( rmaxvec[ copyNo + 1 ]); DDSolid dsol = DDSolidFactory::polyhedra( solname, msol.sides(), msol.startPhi(), msol.deltaPhi(), newZ, newRmin, newRmax ); DDLogicalPart lp( solname, usemat, dsol ); DCOUT_V( 'P', "DDDividedPolyhedraZ::makeDDLogicalPart" << "\n-- Parametrised phedra copy-number: " << copyNo << "\n-- DDLogicalPart " << lp ); return lp; }
DDRotation DDDividedPolyhedraZ::makeDDRotation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 390 of file DDDividedPolyhedra.cc.
{ return DDRotation(); }
DDTranslation DDDividedPolyhedraZ::makeDDTranslation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 374 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDPolyhedra::zVec().
{ DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); std::vector<double> zvec = msol.zVec(); //----- set translation: along Z axis double posi = (zvec[copyNo] + zvec[copyNo+1])/2; DDTranslation tr(0,0,posi); //----- calculate rotation matrix: unit DCOUT_V ('P', " DDDividedPolyhedraZ - position: " << posi << "\n copyNo: " << copyNo << " - offset: " << div_.offset()/deg << " - compWidth_: " << compWidth_/deg << " translation = " << tr); return tr; }