CMS 3D CMS Logo

DDDividedBoxZ Class Reference

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

Inheritance diagram for DDDividedBoxZ:

DDDividedGeometryObject

List of all members.

Public Member Functions

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


Detailed Description

Definition at line 49 of file DDDividedBox.h.


Constructor & Destructor Documentation

DDDividedBoxZ::DDDividedBoxZ ( const DDDivision div  ) 

Definition at line 200 of file DDDividedBox.cc.

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, lat::endl(), DDBox::halfY(), DDBox::halfZ(), DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().

00200                                                     : 
00201   DDDividedGeometryObject::DDDividedGeometryObject(div)
00202 {
00203   checkParametersValidity();
00204   setType( "DivisionBoxZ" );
00205   DDBox mbox = (DDBox)(div_.parent().solid());
00206 
00207   if( divisionType_ == DivWIDTH ) {
00208     compNDiv_ = calculateNDiv( 2*mbox.halfZ(), div_.width(), div_.offset() );
00209   } else if( divisionType_ == DivNDIV ) {
00210     compWidth_ = calculateWidth( 2*mbox.halfY(), div_.nReplicas(), div_.offset() );
00211   }
00212   
00213   // somehow here, I want to iterate over the nDivs or nReplicas 
00214   // and make the solid, make the logical part, then position it.
00215   // since DDBox is special, I will not make the solid and logical
00216   // part but once.  We'll see how bad the others go.
00217   // ihatethisihatethisihatethis
00218   //    for (int i = 0; i < compNDiv_; ++i)
00219   //      {
00220   //         DDpos(makeDDLogicalPart(i)  // child logical part
00221   //        , div_.parent()        // parent logical part
00222   //        , i                    // copy number
00223   //        , makeDDTranslation(i) // translation
00224   //        , makeDDRotation(i)    // rotation.  box is default (i.e. identity).
00225   //        );
00226   //      }
00227 
00228   DCOUT_V ('P', " DDDividedBoxZ:DDDividedBoxZ"  << std::endl);
00229 }

DDDividedBoxZ::~DDDividedBoxZ (  )  [virtual]

Definition at line 232 of file DDDividedBox.cc.

00233 {
00234 }


Member Function Documentation

double DDDividedBoxZ::getMaxParameter (  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 237 of file DDDividedBox.cc.

References DDDividedGeometryObject::div_, DDBox::halfZ(), DDDivision::parent(), and DDLogicalPart::solid().

00238 {
00239   DDBox msol = (DDBox)(div_.parent().solid());
00240   return 2*msol.halfZ();
00241 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 266 of file DDDividedBox.cc.

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

00267 {
00268   // in other cases, this solid will have 1, 2, 3, etc. after it.
00269   DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
00270   DDSolid ddbox(solname);
00271   DDMaterial usemat(div_.parent().material());
00272   DDBox msol = (DDBox) (div_.parent().solid());
00273   DDLogicalPart ddlp(solname);
00274   if (!ddbox.isDefined().second) //This solid has NOT been defined. 
00275     {
00276       double pDx = msol.halfX();
00277       double pDy = msol.halfY();
00278       double pDz = compWidth_/2.;
00279       ddbox = DDSolidFactory::box(solname, pDx, pDy, pDz);
00280       ddlp =  DDLogicalPart(solname, usemat, ddbox);
00281     }
00282   DCOUT_V ('P', " DDDividedBoxZ::computeDimensions() lp:\n" << ddlp); 
00283   return ddlp;
00284 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 244 of file DDDividedBox.cc.

00245 {
00246   return DDRotation();
00247 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 250 of file DDDividedBox.cc.

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

00251 {
00252   DDBox msol = (DDBox)(div_.parent().solid());
00253   double mdx = msol.halfZ();
00254 
00255   //----- translation 
00256   DDTranslation translation;
00257 
00258   double posi = -mdx + div_.offset() + (copyNo+0.5) * compWidth_;
00259   translation.SetZ( posi );
00260 
00261   DCOUT_V ('P', " DDDividedBoxZ: " << copyNo << "\n Position " << translation << " Axis " << DDAxesNames::name(div_.axis()) << "\n");
00262   return translation;
00263 }


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