CMS 3D CMS Logo

Public Member Functions

DDDividedPolyconeZ Class Reference

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeZ:
DDDividedGeometryObject

List of all members.

Public Member Functions

virtual void checkParametersValidity ()
 DDDividedPolyconeZ (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 ~DDDividedPolyconeZ ()

Detailed Description

Definition at line 56 of file DDDividedPolycone.h.


Constructor & Destructor Documentation

DDDividedPolyconeZ::DDDividedPolyconeZ ( const DDDivision div,
DDCompactView cpv 
)

Definition at line 246 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDPolycone::rMaxVec(), DDPolycone::rMinVec(), DDLogicalPart::solid(), DDDivision::width(), and DDPolycone::zVec().

  : DDDividedGeometryObject::DDDividedGeometryObject( div, cpv )
{
  checkParametersValidity();
  DDPolycone msol = (DDPolycone)(div_.parent().solid());
  std::vector<double> localrMaxVec = msol.rMaxVec();
  std::vector<double> localrMinVec = msol.rMinVec();
  std::vector<double> localzVec = msol.zVec();

  if( divisionType_ == DivWIDTH )
  {
    compNDiv_ =
      calculateNDiv( localzVec[localzVec.size() - 1]
                     - localzVec[0] , div_.width(), div_.offset() );
  }
  else if( divisionType_ == DivNDIV )
  {
    compWidth_ =
      calculateNDiv( localzVec[localzVec.size()-1]
                     - localzVec[0] , div_.nReplicas(), div_.offset() );
  }
   
  DCOUT_V ('P', " DDDividedPolyconeZ - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "/n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n");
}
DDDividedPolyconeZ::~DDDividedPolyconeZ ( void  ) [virtual]

Definition at line 271 of file DDDividedPolycone.cc.

{}

Member Function Documentation

void DDDividedPolyconeZ::checkParametersValidity ( void  ) [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 275 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::div_, Exception, DDXMLElement::itostr(), DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), DDDivision::width(), and DDPolycone::zVec().

Referenced by DDDividedPolyconeZ().

{
  DDDividedGeometryObject::checkParametersValidity();

  DDPolycone msol = (DDPolycone)(div_.parent().solid());
  std::vector<double> localzVec = msol.zVec();
  // CHANGE FROM G4 a polycone can be divided in Z by specifying
  // nReplicas IF they happen to coincide with the number of 
  // z plans.
  size_t tempNDiv = div_.nReplicas();
  if (tempNDiv == 0)
    tempNDiv = calculateNDiv( localzVec[localzVec.size() - 1] - localzVec[0] 
                              , div_.width()
                              , div_.offset() );
  if ((msol.zVec().size() - 1) != tempNDiv)
  { 
    std::string s = "ERROR - DDDividedPolyconeZ::checkParametersValidity()";
    s += "\n\tDivision along Z will be done splitting in the defined";
    s += "\n\tz_planes, i.e, the number of division would be :";
    s += "\n\t" + DDXMLElement::itostr( msol.zVec().size() - 1 );
    s += "\n\tinstead of " + DDXMLElement::itostr(tempNDiv) + " !\n";

    throw cms::Exception("DDException") << s;
  }
}
double DDDividedPolyconeZ::getMaxParameter ( void  ) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 302 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDPolycone::zVec().

{
  DDPolycone msol = (DDPolycone)(div_.parent().solid());
  std::vector<double> localzVec = msol.zVec();

  return (localzVec[ localzVec.size() - 1] - localzVec[0]);
}
DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( const int  copyNo) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 330 of file DDDividedPolycone.cc.

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

{
  DDName solname;
  DDSolid ddpolycone;
  DDMaterial usemat(div_.parent().material());

  DDPolycone msol = (DDPolycone)(div_.parent().solid());
  std::vector<double> localrMaxVec = msol.rMaxVec();
  std::vector<double> localrMinVec = msol.rMinVec();
  std::vector<double> localzVec = msol.zVec();

  solname = DDName( div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo),
                    div_.parent().ddname().ns());
  ddpolycone = DDSolidFactory::cons( solname,
                                     compWidth_ / 2,
                                     localrMinVec[copyNo],
                                     localrMaxVec[copyNo],
                                     localrMinVec[copyNo+1],
                                     localrMaxVec[copyNo+1],
                                     msol.startPhi(),
                                     msol.deltaPhi());

  DDLogicalPart ddlp = DDLogicalPart( solname, usemat, ddpolycone );

  DCOUT_V( 'P', " DDDividedPolyconeZ::makeDDLogicalPart() lp:" << ddlp );

  return ddlp;
}
DDRotation DDDividedPolyconeZ::makeDDRotation ( const int  copyNo) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 311 of file DDDividedPolycone.cc.

References DCOUT_V.

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

Reimplemented from DDDividedGeometryObject.

Definition at line 319 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDPolycone::zVec().

{
  DDTranslation translation;
  DDPolycone msol = (DDPolycone)(div_.parent().solid());
  std::vector<double> localzVec = msol.zVec();
  double posi = (localzVec[copyNo] + localzVec[copyNo+1]) / 2;
  translation.SetZ(posi);
  return translation;
}