CMS 3D CMS Logo

DDDividedConsZ Class Reference

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

Inheritance diagram for DDDividedConsZ:

DDDividedGeometryObject

List of all members.

Public Member Functions

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


Detailed Description

Definition at line 50 of file DDDividedCons.h.


Constructor & Destructor Documentation

DDDividedConsZ::DDDividedConsZ ( const DDDivision div  ) 

Definition at line 228 of file DDDividedCons.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 DDCons::zhalf().

00229   :  DDDividedGeometryObject::DDDividedGeometryObject (div)
00230 {
00231   checkParametersValidity();
00232 
00233   DDCons msol = (DDCons)(div_.parent().solid());
00234   setType( "DivisionConsZ" );
00235       
00236   if( divisionType_ == DivWIDTH )
00237     {
00238       DDCons msol = (DDCons)(div_.parent().solid());
00239       compNDiv_ = calculateNDiv( 2*msol.zhalf()
00240                                  , div_.width(), div_.offset() );
00241     }
00242   else if( divisionType_ == DivNDIV )
00243     {
00244       DDCons msol = (DDCons)(div_.parent().solid());
00245       compWidth_ = calculateWidth( 2*msol.zhalf()
00246                                    , div_.nReplicas(), div_.offset() );
00247     }
00248 
00249   DCOUT_V ('P', " DDDividedConsZ - no divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << "\n Width " << compWidth_ << " = " << div_.width() << "\n DivType " << divisionType_); 
00250   
00251 }

DDDividedConsZ::~DDDividedConsZ (  )  [virtual]

Definition at line 254 of file DDDividedCons.cc.

00255 {
00256 }


Member Function Documentation

double DDDividedConsZ::getMaxParameter (  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 259 of file DDDividedCons.cc.

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

00260 {
00261   DDCons msol = (DDCons)(div_.parent().solid());
00262   return 2*msol.zhalf();
00263 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 289 of file DDDividedCons.cc.

References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), DCOUT_V, ddcons, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), and DDLogicalPart::solid().

00290 { 
00291   DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo) 
00292                  , div_.parent().ddname().ns());
00293   DDSolid ddcons(solname);
00294   DDMaterial usemat(div_.parent().material());
00295   DDCons msol = (DDCons)(div_.parent().solid());
00296 
00297   double mHalfLength = msol.zhalf();
00298   double aRInner = (msol.rInPlusZ()
00299                     - msol.rInMinusZ()) / (2*mHalfLength);
00300   double bRInner = (msol.rInPlusZ()
00301                     + msol.rInMinusZ()) / 2;
00302   double aROuter = (msol.rOutPlusZ()
00303                     - msol.rOutMinusZ()) / (2*mHalfLength);
00304   double bROuter = (msol.rOutPlusZ()
00305                     + msol.rOutMinusZ()) / 2;
00306   double xMinusZ = -mHalfLength + div_.offset() + compWidth_*copyNo;
00307   double xPlusZ  = -mHalfLength + div_.offset() + compWidth_*(copyNo+1);
00308 
00309   double pDz = compWidth_ / 2.;
00310   double pSPhi = msol.phiFrom();
00311   double pDPhi = msol.deltaPhi();
00312 
00313   ddcons = DDSolidFactory::cons(DDName(solname)
00314                                 , pDz
00315                                 , aRInner * xMinusZ + bRInner
00316                                 , aROuter * xMinusZ + bROuter
00317                                 , aRInner * xPlusZ + bRInner
00318                                 , aROuter * xPlusZ + bROuter
00319                                 , pSPhi
00320                                 , pDPhi
00321                                 );
00322   
00323   DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
00324   DCOUT_V ('P', " DDDividedConsZ::makeDDLogicalPart() lp:" << ddlp);
00325   return ddlp;
00326 
00327 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 266 of file DDDividedCons.cc.

References DCOUT_V.

00267 {
00268   DDRotation myddrot; // sets to identity.
00269   DCOUT_V ('P', "DDDividedConsZ::makeDDRotation : " << myddrot);
00270   return myddrot;
00271 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 274 of file DDDividedCons.cc.

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

00275 {
00276   //----- translation 
00277   DDTranslation translation;
00278 
00279   DDCons motherCons = (DDCons)(div_.parent().solid());
00280   double posi = - motherCons.zhalf() + div_.offset() 
00281     + compWidth_/2 + copyNo*compWidth_;
00282   translation.SetZ(posi); 
00283   
00284   DCOUT_V ('P', " DDDividedConsZ " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis()));
00285   return translation;
00286 }


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