CMS 3D CMS Logo

DDDividedBoxX Class Reference

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

Inheritance diagram for DDDividedBoxX:

DDDividedGeometryObject

List of all members.

Public Member Functions

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


Detailed Description

Definition at line 15 of file DDDividedBox.h.


Constructor & Destructor Documentation

DDDividedBoxX::DDDividedBoxX ( const DDDivision div  ) 

Definition at line 25 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::halfX(), DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().

00025                                                     : 
00026   DDDividedGeometryObject::DDDividedGeometryObject(div)
00027 {
00028   checkParametersValidity();
00029   setType( "DivisionBoxX" );
00030   DDBox mbox = (DDBox)(div_.parent().solid());
00031 
00032   if( divisionType_ == DivWIDTH ) {
00033     compNDiv_ = calculateNDiv( 2*mbox.halfX(), div_.width(), div_.offset() );
00034   } else if( divisionType_ == DivNDIV ) {
00035     compWidth_ = calculateWidth( 2*mbox.halfX(), div_.nReplicas(), div_.offset() );
00036   }
00037   
00038   // somehow here, I want to iterate over the nDivs or nReplicas 
00039   // and make the solid, make the logical part, then position it.
00040   // since DDBox is special, I will not make the solid and logical
00041   // part but once.  We'll see how bad the others go.
00042   // ihatethisihatethisihatethis
00043   //    for (int i = 0; i < compNDiv_; ++i)
00044   //      {
00045   //         DDpos(makeDDLogicalPart(i)  // child logical part
00046   //        , div_.parent()        // parent logical part
00047   //        , i                    // copy number
00048   //        , makeDDTranslation(i) // translation
00049   //        , makeDDRotation(i)    // rotation.  box is default (i.e. identity).
00050   //        );
00051   //      }
00052 
00053   DCOUT_V ('P', " DDDividedBoxX:DDDividedBoxX"  << std::endl);
00054 }

DDDividedBoxX::~DDDividedBoxX (  )  [virtual]

Definition at line 57 of file DDDividedBox.cc.

00058 {
00059 }


Member Function Documentation

double DDDividedBoxX::getMaxParameter (  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 62 of file DDDividedBox.cc.

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

00063 {
00064   DDBox msol = (DDBox)(div_.parent().solid());
00065   return 2*msol.halfX();
00066 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 90 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().

00091 {
00092   // in other cases, this solid will have 1, 2, 3, etc. after it.
00093   DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
00094   DDSolid ddbox(solname);
00095   DDMaterial usemat(div_.parent().material());
00096   DDBox msol = (DDBox) (div_.parent().solid());
00097   DDLogicalPart ddlp(solname);
00098   if (!ddbox.isDefined().second) //This solid has NOT been defined. 
00099     {
00100       double pDx = msol.halfX();
00101       double pDy = compWidth_/2.;
00102       double pDz = msol.halfZ();
00103     
00104       ddbox = DDSolidFactory::box(solname, pDx, pDy, pDz);
00105       ddlp =  DDLogicalPart(solname, usemat, ddbox);
00106     }
00107   DCOUT_V ('P', " DDDividedBoxX::computeDimensions() lp:\n" << ddlp); 
00108   return ddlp;
00109 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 69 of file DDDividedBox.cc.

00070 {
00071   return DDRotation();
00072 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 75 of file DDDividedBox.cc.

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

00076 {
00077   DDBox msol = (DDBox)(div_.parent().solid());
00078   double mdx = msol.halfX();
00079 
00080   //----- translation 
00081   DDTranslation translation;
00082   double posi = -mdx + div_.offset() + (copyNo+0.5) * compWidth_;
00083   translation.SetX( posi );
00084 
00085   DCOUT_V ('P', " DDDividedBoxX: " << copyNo << "\n Position " << translation << " Axis " << DDAxesNames::name(div_.axis()) << "\n");
00086   return translation;
00087 }


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