CMS 3D CMS Logo

Public Member Functions

DDDividedConsZ Class Reference

#include <DDDividedCons.h>

Inheritance diagram for DDDividedConsZ:
DDDividedGeometryObject

List of all members.

Public Member Functions

 DDDividedConsZ (const DDDivision &div, DDCompactView *cpv)
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,
DDCompactView cpv 
)
DDDividedConsZ::~DDDividedConsZ ( void  ) [virtual]

Definition at line 252 of file DDDividedCons.cc.

{}

Member Function Documentation

double DDDividedConsZ::getMaxParameter ( void  ) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 256 of file DDDividedCons.cc.

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

{
  DDCons msol = (DDCons)(div_.parent().solid());
  return 2*msol.zhalf();
}
DDLogicalPart DDDividedConsZ::makeDDLogicalPart ( const int  copyNo) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 286 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(), DDLogicalPart::solid(), and DDCons::zhalf().

{ 
  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo) 
                 , div_.parent().ddname().ns());
  DDSolid ddcons(solname);
  DDMaterial usemat(div_.parent().material());
  DDCons msol = (DDCons)(div_.parent().solid());

  double mHalfLength = msol.zhalf();
  double aRInner = (msol.rInPlusZ()
                    - msol.rInMinusZ()) / (2*mHalfLength);
  double bRInner = (msol.rInPlusZ()
                    + msol.rInMinusZ()) / 2;
  double aROuter = (msol.rOutPlusZ()
                    - msol.rOutMinusZ()) / (2*mHalfLength);
  double bROuter = (msol.rOutPlusZ()
                    + msol.rOutMinusZ()) / 2;
  double xMinusZ = -mHalfLength + div_.offset() + compWidth_*copyNo;
  double xPlusZ  = -mHalfLength + div_.offset() + compWidth_*(copyNo+1);

  double pDz = compWidth_ / 2.;
  double pSPhi = msol.phiFrom();
  double pDPhi = msol.deltaPhi();

  ddcons = DDSolidFactory::cons(DDName(solname)
                                , pDz
                                , aRInner * xMinusZ + bRInner
                                , aROuter * xMinusZ + bROuter
                                , aRInner * xPlusZ + bRInner
                                , aROuter * xPlusZ + bROuter
                                , pSPhi
                                , pDPhi
    );
  
  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
  DCOUT_V( 'P', " DDDividedConsZ::makeDDLogicalPart() lp:" << ddlp );
  return ddlp;
}
DDRotation DDDividedConsZ::makeDDRotation ( const int  copyNo) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 263 of file DDDividedCons.cc.

References DCOUT_V.

{
  DDRotation myddrot; // sets to identity.
  DCOUT_V ('P', "DDDividedConsZ::makeDDRotation : " << myddrot);
  return myddrot;
}
DDTranslation DDDividedConsZ::makeDDTranslation ( const int  copyNo) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 271 of file DDDividedCons.cc.

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

{
  //----- translation 
  DDTranslation translation;

  DDCons motherCons = (DDCons)(div_.parent().solid());
  double posi = - motherCons.zhalf() + div_.offset() 
                + compWidth_/2 + copyNo*compWidth_;
  translation.SetZ(posi); 
  
  DCOUT_V ('P', " DDDividedConsZ " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis()));
  return translation;
}