![]() |
![]() |
#include <DetectorDescription/Parser/src/DDDividedPolyhedra.h>
Public Member Functions | |
virtual void | checkParametersValidity () |
DDDividedPolyhedraRho (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 | ~DDDividedPolyhedraRho () |
Definition at line 18 of file DDDividedPolyhedra.h.
DDDividedPolyhedraRho::DDDividedPolyhedraRho | ( | const DDDivision & | div | ) |
Definition at line 24 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().
00025 : DDDividedGeometryObject( div ) 00026 { 00027 checkParametersValidity(); 00028 setType( "DivisionPolyhedraRho" ); 00029 00030 DDPolyhedra msol = (DDPolyhedra)( div_.parent().solid() ); 00031 // G4PolyhedraHistorical* original_pars = msol->GetOriginalParameters(); 00032 00033 if( divisionType_ == DivWIDTH ) 00034 { 00035 compNDiv_ = calculateNDiv( msol.rMaxVec()[0] - msol.rMinVec()[0] 00036 , div_.width() 00037 , div_.offset() ); 00038 } 00039 else if( divisionType_ == DivNDIV ) 00040 { 00041 compWidth_ = calculateWidth( msol.rMaxVec()[0] - msol.rMinVec()[0] 00042 , div_.nReplicas() 00043 , div_.offset() ); 00044 } 00045 00046 // for (int i = 0; i < compNDiv_; ++i) 00047 // { 00048 // DDpos( makeDDLogicalPart(i) 00049 // , div_.parent() 00050 // , i 00051 // , makeDDTranslation(i) 00052 // , makeDDRotation(i) 00053 // , &div_ 00054 // ); 00055 // } 00056 00057 DCOUT_V ('P', " DDDividedPolyhedraRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n"); 00058 00059 }
DDDividedPolyhedraRho::~DDDividedPolyhedraRho | ( | ) | [virtual] |
void DDDividedPolyhedraRho::checkParametersValidity | ( | ) | [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 67 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::checkParametersValidity(), GenMuonPlsPt100GeV_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, lat::endl(), DDDivision::offset(), DDDivision::parent(), and DDLogicalPart::solid().
Referenced by DDDividedPolyhedraRho().
00068 { 00069 DDDividedGeometryObject::checkParametersValidity(); 00070 00071 DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); 00072 00073 if( divisionType_ == DivNDIVandWIDTH || divisionType_ == DivWIDTH ) 00074 { 00075 std::cout << "WARNING - " 00076 << "DDDividedPolyhedraRho::checkParametersValidity()" 00077 << std::endl 00078 << " Solid " << msol << std::endl 00079 << " Division along R will be done with a width " 00080 << "different for each solid section." << std::endl 00081 << " WIDTH will not be used !" << std::endl; 00082 } 00083 if( div_.offset() != 0. ) 00084 { 00085 std::cout << "WARNING - " 00086 << "DDDividedPolyhedraRho::checkParametersValidity()" 00087 << std::endl 00088 << " Solid " << msol << std::endl 00089 << " Division along R will be done with a width " 00090 << "different for each solid section." << std::endl 00091 << " OFFSET will not be used !" << std::endl; 00092 } 00093 00094 00095 }
double DDDividedPolyhedraRho::getMaxParameter | ( | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 98 of file DDDividedPolyhedra.cc.
References DDDividedGeometryObject::div_, DDDivision::parent(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), and DDLogicalPart::solid().
00099 { 00100 DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); 00101 // G4PolyhedraHistorical* original_pars = msol->GetOriginalParameters(); 00102 return msol.rMaxVec()[0] - msol.rMinVec()[0]; 00103 }
DDLogicalPart DDDividedPolyhedraRho::makeDDLogicalPart | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 118 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(), width, and DDPolyhedra::zVec().
00119 { 00120 DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid()); 00121 DDMaterial usemat = div_.parent().material(); 00122 //G4PolyhedraHistorical* origparamMother = msol->GetOriginalParameters(); 00123 //G4PolyhedraHistorical origparam( *origparamMother ); 00124 std::vector<double> localrMaxVec = msol.rMaxVec(); 00125 std::vector<double> localrMinVec = msol.rMinVec(); 00126 std::vector<double> localzVec = msol.zVec(); 00127 std::vector<double> newrMinVec; 00128 std::vector<double> newrMaxVec; 00129 int nZplanes = localzVec.size(); 00130 00131 double width = 0.; 00132 for(int ii = 0; ii < nZplanes; ++ii) 00133 { 00134 // width = CalculateWidth( origparamMother->Rmax[ii] 00135 // - origparamMother->Rmin[ii], compNDiv_, foffset ); 00136 // origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo; 00137 // origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1); 00138 width = calculateWidth(localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset()); 00139 newrMinVec[ii] = localrMinVec[ii] + div_.offset() + width * copyNo; 00140 newrMaxVec[ii] = localrMaxVec[ii] + div_.offset() + width * (copyNo + 1); 00141 } 00142 00143 // phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers 00144 // phedra.Reset(); // reset to new solid parameters 00145 00146 DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo) 00147 , div_.parent().ddname().ns()); 00148 00149 DDSolid dsol = DDSolidFactory::polyhedra(solname 00150 , msol.sides() 00151 , msol.startPhi() 00152 , msol.deltaPhi() 00153 , localzVec 00154 , newrMinVec 00155 , newrMaxVec); 00156 DDLogicalPart ddlp = DDLogicalPart(solname, usemat, dsol); 00157 DCOUT_V ('P', "DDDividedPolyhedraRho:makeDDLogicalPart lp:" << ddlp); 00158 return ddlp; 00159 }
DDRotation DDDividedPolyhedraRho::makeDDRotation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 112 of file DDDividedPolyhedra.cc.
00113 { 00114 return DDRotation(); 00115 }
DDTranslation DDDividedPolyhedraRho::makeDDTranslation | ( | const int | copyNo | ) | const [virtual] |
Reimplemented from DDDividedGeometryObject.
Definition at line 106 of file DDDividedPolyhedra.cc.
00107 { 00108 return DDTranslation(); 00109 }