CMS 3D CMS Logo

DDDividedBoxY Class Reference

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

Inheritance diagram for DDDividedBoxY:

DDDividedGeometryObject

List of all members.

Public Member Functions

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


Detailed Description

Definition at line 32 of file DDDividedBox.h.


Constructor & Destructor Documentation

DDDividedBoxY::DDDividedBoxY ( const DDDivision div  ) 

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

00112                                                     : 
00113   DDDividedGeometryObject::DDDividedGeometryObject(div)
00114 {
00115   checkParametersValidity();
00116   setType( "DivisionBoxY" );
00117   DDBox mbox = (DDBox)(div_.parent().solid());
00118 
00119   if( divisionType_ == DivWIDTH ) {
00120     compNDiv_ = calculateNDiv( 2*mbox.halfY(), div_.width(), div_.offset() );
00121   } else if( divisionType_ == DivNDIV ) {
00122     compWidth_ = calculateWidth( 2*mbox.halfY(), div_.nReplicas(), div_.offset() );
00123   } 
00124 
00125   
00126   // somehow here, I want to iterate over the nDivs or nReplicas 
00127   // and make the solid, make the logical part, then position it.
00128   // since DDBox is special, I will not make the solid and logical
00129   // part but once.  We'll see how bad the others go.
00130   // ihatethisihatethisihatethis
00131   //    for (int i = 0; i < compNDiv_; ++i)
00132   //      {
00133   //         DDpos(makeDDLogicalPart(i)  // child logical part
00134   //        , div_.parent()        // parent logical part
00135   //        , i                    // copy number
00136   //        , makeDDTranslation(i) // translation
00137   //        , makeDDRotation(i)    // rotation.  box is default (i.e. identity).
00138   //        );
00139   //      }
00140 
00141   DCOUT_V ('P', " DDDividedBoxY:DDDividedBoxY"  << std::endl);
00142 }

DDDividedBoxY::~DDDividedBoxY (  )  [virtual]

Definition at line 145 of file DDDividedBox.cc.

00146 {
00147 }


Member Function Documentation

double DDDividedBoxY::getMaxParameter (  )  const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 150 of file DDDividedBox.cc.

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

00151 {
00152   DDBox msol = (DDBox)(div_.parent().solid());
00153   return 2*msol.halfY();
00154 }

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

Reimplemented from DDDividedGeometryObject.

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

00180 {
00181   // in other cases, this solid will have 1, 2, 3, etc. after it.
00182   DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
00183   DDSolid ddbox(solname);
00184   DDMaterial usemat(div_.parent().material());
00185   DDBox msol = (DDBox) (div_.parent().solid());
00186   DDLogicalPart ddlp(solname);
00187   if (!ddbox.isDefined().second) //This solid has NOT been defined. 
00188     {
00189       double pDx = msol.halfX();
00190       double pDy = compWidth_/2.;
00191       double pDz = msol.halfZ();
00192       ddbox = DDSolidFactory::box(solname, pDx, pDy, pDz);
00193       ddlp =  DDLogicalPart(solname, usemat, ddbox);
00194     }
00195   DCOUT_V ('P', " DDDividedBoxY::computeDimensions() lp:\n" << ddlp); 
00196   return ddlp;
00197 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 157 of file DDDividedBox.cc.

00158 {
00159   return DDRotation();
00160 }

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

Reimplemented from DDDividedGeometryObject.

Definition at line 163 of file DDDividedBox.cc.

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

00164 {
00165   DDBox msol = (DDBox)(div_.parent().solid());
00166   double mdx = msol.halfY();
00167 
00168   //----- translation 
00169   DDTranslation translation;
00170 
00171   double posi = -mdx + div_.offset() + (copyNo+0.5) * compWidth_;
00172   translation.SetY( posi );
00173 
00174   DCOUT_V ('P', " DDDividedBoxY: " << copyNo << "\n Position " << translation << " Axis " << DDAxesNames::name(div_.axis()) << "\n");
00175   return translation;
00176 }


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