CMS 3D CMS Logo

DDDividedTubsZ Class Reference

#include <DetectorDescription/Parser/src/DDDividedTubs.h>

Inheritance diagram for DDDividedTubsZ:

DDDividedGeometryObject

List of all members.

Public Member Functions

 DDDividedTubsZ (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 ~DDDividedTubsZ ()


Detailed Description

Definition at line 50 of file DDDividedTubs.h.


Constructor & Destructor Documentation

DDDividedTubsZ::DDDividedTubsZ ( const DDDivision div  ) 

Definition at line 199 of file DDDividedTubs.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 DDTubs::zhalf().

00200   :  DDDividedGeometryObject::DDDividedGeometryObject( div )
00201 {
00202   checkParametersValidity();
00203 
00204   DDTubs msol = (DDTubs)(div_.parent().solid());
00205 
00206   setType( "DivisionTubsZ" );
00207   if( divisionType_ == DivWIDTH )
00208     {
00209       compNDiv_ = calculateNDiv( 2*msol.zhalf(), div_.width(), div_.offset() );
00210     }
00211   else if( divisionType_ == DivNDIV )
00212     {
00213       compWidth_ = calculateWidth( 2*msol.zhalf(), div_.nReplicas(), div_.offset() );
00214     }
00215 
00216   DCOUT_V ('P', " DDDividedTubsZ - no divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << "\n Width " << compWidth_ << " = " << div_.width() << "\n DivType " << divisionType_);
00217  
00218 }

DDDividedTubsZ::~DDDividedTubsZ (  )  [virtual]

Definition at line 221 of file DDDividedTubs.cc.

00222 {
00223 }


Member Function Documentation

double DDDividedTubsZ::getMaxParameter (  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 226 of file DDDividedTubs.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDTubs::zhalf().

00227 {
00228   DDTubs msol = (DDTubs)(div_.parent().solid());
00229   return 2*msol.zhalf();
00230 
00231 }

DDLogicalPart DDDividedTubsZ::makeDDLogicalPart ( const int  copyNo  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 255 of file DDDividedTubs.cc.

References DDDividedGeometryObject::compWidth_, DCOUT_V, DDBase< N, C >::ddname(), ddtubs, DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::parent(), DDLogicalPart::solid(), and DDSolidFactory::tubs().

00256 {
00257 
00258   DDMaterial usemat(div_.parent().material());
00259   DDTubs msol = (DDTubs) (div_.parent().solid());
00260   DDLogicalPart ddlp;
00261 
00262   DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
00263   DDSolid ddtubs(solname);
00264 
00265   if (!ddtubs.isDefined().second)  // only if it is not defined, make new dimensions and solid.
00266     {
00267       double pRMin = msol.rIn();
00268       double pRMax = msol.rOut();
00269       double pDz = compWidth_/2.;
00270       double pSPhi = msol.startPhi();
00271       double pDPhi = msol.deltaPhi();
00272       ddtubs = DDSolidFactory::tubs(DDName(solname), pDz, pRMin, pRMax, pSPhi, pDPhi);
00273       ddlp = DDLogicalPart(solname, usemat, ddtubs);
00274     }
00275   else {
00276     ddlp = DDLogicalPart(solname);
00277   }
00278 
00279   DCOUT_V ('P', " DDDividedTubsZ::computeDimensions() lp:" << ddlp);
00280   return ddlp;
00281 
00282 }

DDRotation DDDividedTubsZ::makeDDRotation ( const int  copyNo  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 233 of file DDDividedTubs.cc.

References DCOUT_V.

00234 {
00235   DDRotation myddrot; // sets to identity.
00236   DCOUT_V ('P', "DDDividedTubsZ::makeDDRotation made a rotation: " << myddrot);
00237   return myddrot;
00238 }

DDTranslation DDDividedTubsZ::makeDDTranslation ( const int  copyNo  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 241 of file DDDividedTubs.cc.

References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDAxesNames::name(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDTubs::zhalf().

00242 {
00243   //----- translation 
00244   DDTranslation translation;
00245 
00246   DDTubs msol = (DDTubs)(div_.parent().solid());
00247   double posi = - msol.zhalf() + div_.offset() + compWidth_/2 + copyNo*compWidth_;
00248   translation.SetZ(posi);
00249   
00250   DCOUT_V ('P', " DDDividedTubsZ " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis()));
00251   return translation;
00252 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:50 2009 for CMSSW by  doxygen 1.5.4