#include <DetectorDescription/Parser/src/DDDividedPolyhedra.h>
Public Member Functions | |
virtual void | checkParametersValidity () |
DDDividedPolyhedraPhi (const DDDivision &div) | |
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 | ~DDDividedPolyhedraPhi () |
Definition at line 41 of file DDDividedPolyhedra.h.
DDDividedPolyhedraPhi::DDDividedPolyhedraPhi | ( | const DDDivision & | div | ) |
Definition at line 162 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::calculateWidth(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDPolyhedra::deltaPhi(), DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().
00163 : DDDividedGeometryObject( div ) 00164 { 00165 checkParametersValidity(); 00166 setType( "DivisionPolyhedraPhi" ); 00167 00168 DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); 00169 // double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi(); 00170 00171 if( divisionType_ == DivWIDTH ) 00172 { 00173 //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees 00174 if( msol.deltaPhi() == 360.*deg ) { 00175 compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. ); 00176 }else { 00177 compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), div_.offset() ); 00178 } 00179 } 00180 else if( divisionType_ == DivNDIV ) 00181 { 00182 if( msol.deltaPhi() == 360.*deg ) { 00183 compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. ); 00184 }else { 00185 // original line looks wrong! 00186 compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), div_.offset() ); 00187 } 00188 } 00189 00190 DCOUT_V ('P', " DDDividedPolyhedraRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n"); 00191 }
DDDividedPolyhedraPhi::~DDDividedPolyhedraPhi | ( | ) | [virtual] |
void DDDividedPolyhedraPhi::checkParametersValidity | ( | ) | [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 206 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::compNDiv_, GenMuonPlsPt100GeV_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, lat::endl(), DDDivision::offset(), DDDivision::parent(), s, DDPolyhedra::sides(), and DDLogicalPart::solid().
Referenced by DDDividedPolyhedraPhi().
00207 { 00208 DDDividedGeometryObject::checkParametersValidity(); 00209 00210 DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); 00211 00212 if( divisionType_ == DivNDIVandWIDTH || divisionType_ == DivWIDTH ) 00213 { 00214 std::cout << "WARNING - " 00215 << "DDDividedPolyhedraPhi::checkParametersValidity()" 00216 << std::endl 00217 << " Solid " << msol << std::endl 00218 << " Division along PHI will be done splitting " 00219 << "in the defined numSide." << std::endl 00220 << " WIDTH will not be used !" << std::endl; 00221 } 00222 if( div_.offset() != 0. ) 00223 { 00224 std::cout << "WARNING - " 00225 << "DDDividedPolyhedraPhi::checkParametersValidity()" 00226 << std::endl 00227 << " Solid " << msol << std::endl 00228 << " Division along PHI will be done splitting " 00229 << "in the defined numSide." << std::endl 00230 << " OFFSET will not be used !" << std::endl; 00231 } 00232 00233 // G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters(); 00234 00235 if ( msol.sides() != compNDiv_ )//origparamMother->numSide != compNDiv_ ) 00236 { 00237 std::cout << "ERROR - " 00238 << "DDDividedPolyhedraPhi::checkParametersValidity()" 00239 << std::endl 00240 << " Division along PHI will be done splitting in the defined" 00241 << std::endl 00242 << " numSide, i.e, the number of division would be :" 00243 << " " << msol.sides() //origparamMother->numSide 00244 << " instead of " << compNDiv_ << " !" 00245 << std::endl; 00246 std::string s = "DDDividedPolyhedraPhi::checkParametersValidity() Not supported configuration."; 00247 throw DDException(s); 00248 } 00249 }
double DDDividedPolyhedraPhi::getMaxParameter | ( | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 199 of file DDDividedPolyhedra.cc.
References DDPolyhedra::deltaPhi(), DDDividedGeometryObject::div_, DDDivision::parent(), and DDLogicalPart::solid().
00200 { 00201 DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); 00202 return msol.deltaPhi(); //msol->GetEndPhi() - msol->GetStartPhi(); 00203 }
DDLogicalPart DDDividedPolyhedraPhi::makeDDLogicalPart | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 279 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::compWidth_, DCOUT_V, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDBase< N, C >::isDefined(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polyhedra(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDPolyhedra::sides(), DDLogicalPart::solid(), DDPolyhedra::startPhi(), and DDPolyhedra::zVec().
00280 { 00281 DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); 00282 DDMaterial usemat = div_.parent().material(); 00283 //G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters(); 00284 //G4PolyhedraHistorical origparam( *origparamMother ); 00285 00286 //origparam.numSide = 1; 00287 //origparam.Start_angle = origparamMother->Start_angle; 00288 //origparam.Opening_angle = compWidth_; 00289 00290 //phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers 00291 //phedra.Reset(); // reset to new solid parameters 00292 00293 DDName solname(div_.parent().ddname().name() + "_DIVCHILD" 00294 , div_.parent().ddname().ns()); 00295 DDSolid dsol(solname); 00296 if (!dsol.isDefined().second) 00297 { 00298 dsol = DDSolidFactory::polyhedra(solname 00299 , msol.sides() 00300 , msol.startPhi()+div_.offset() 00301 , compWidth_ 00302 , msol.zVec() 00303 , msol.rMinVec() 00304 , msol.rMaxVec() 00305 ); 00306 } 00307 DDLogicalPart ddlp(solname); 00308 if (!ddlp.isDefined().second) 00309 DDLogicalPart ddlp2 = DDLogicalPart(solname, usemat, dsol); 00310 DCOUT_V ('P', "DDDividedPolyhedraPhi::makeDDLogicalPart() ddlp = " << ddlp); 00311 return ddlp; 00312 }
DDRotation DDDividedPolyhedraPhi::makeDDRotation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 259 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::changeRotMatrix(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDBase< N, C >::ddname(), DDrot(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDName::name(), DDName::ns(), and DDDivision::parent().
00260 { 00261 00262 double posi = ( copyNo - 1 ) * compWidth_; 00263 00264 DCOUT_V ('P', " DDDividedPolyhedraPhi - position: " << posi/deg << "\n copyNo: " << copyNo << " - compWidth_: " << compWidth_/deg << "\n"); 00265 00266 // ChangeRotMatrix( physVol, -posi ); 00267 DDRotationMatrix* rotMat = changeRotMatrix( posi); 00268 // how to name the rotation?? 00269 // i do not like this... 00270 DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + DDXMLElement::itostr(copyNo) 00271 , div_.parent().ddname().ns()); 00272 DDRotation myddrot = DDrot(ddrotname, rotMat); 00273 DCOUT_V ('P', "DDDividedPolyhedra::makeDDRotation: copyNo = " << copyNo << " rotation = " << myddrot); 00274 return myddrot; 00275 00276 }
DDTranslation DDDividedPolyhedraPhi::makeDDTranslation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 253 of file DDDividedPolyhedra.cc.
00254 { 00255 return DDTranslation(); 00256 }