CMS 3D CMS Logo

Public Member Functions

DDDividedPolyconeRho Class Reference

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeRho:
DDDividedGeometryObject

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 18 of file DDDividedPolycone.h.


Constructor & Destructor Documentation

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

Definition at line 18 of file DDDividedPolycone.cc.

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

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

  setType( "DivisionPolyconeRho" );

  // in DDD we only have ONE representation
  // in the case when rMinVec and rMaxVec
  // are empty rVec and zVec are the r and z std::vectors.

  if( divisionType_ == DivWIDTH )
  {
    compNDiv_ = calculateNDiv( localrMaxVec[0] - localrMinVec[0], div_.width(), div_.offset());
  }
  else if( divisionType_ == DivNDIV )
  {
    compWidth_ = calculateWidth( localrMaxVec[0] - localrMinVec[0], div_.nReplicas(), div_.offset());
  }

  DCOUT_V( 'P', " DDDividedPolyconeRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "/n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n" );
}
DDDividedPolyconeRho::~DDDividedPolyconeRho ( void  ) [virtual]

Definition at line 44 of file DDDividedPolycone.cc.

{}

Member Function Documentation

void DDDividedPolyconeRho::checkParametersValidity ( void  ) [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 48 of file DDDividedPolycone.cc.

References gather_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, DDDivision::offset(), DDDivision::parent(), and DDLogicalPart::solid().

Referenced by DDDividedPolyconeRho().

{
  DDDividedGeometryObject::checkParametersValidity();

  DDPolycone msol = (DDPolycone)(div_.parent().solid());

  if( divisionType_ == DivNDIVandWIDTH || divisionType_ == DivWIDTH )
  {
    std::cout << "WARNING - "
              << "DDDividedPolyconeRho::checkParametersValidity()"
              << std::endl
              << "          Solid " << msol << std::endl
              << "          Division along r will be done with a width "
              << "different for each solid section." << std::endl
              << "          WIDTH will not be used !" << std::endl;
  }
  if( div_.offset() != 0. )
  {
    std::cout << "WARNING - "
              << "DDDividedPolyconeRho::checkParametersValidity()"
              << std::endl
              << "          Solid " << msol << std::endl
              << "          Division along  R will be done with a width "
              << "different for each solid section." << std::endl
              << "          OFFSET will not be used !" << std::endl;
  }
}
double DDDividedPolyconeRho::getMaxParameter ( void  ) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 77 of file DDDividedPolycone.cc.

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

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

  return localrMaxVec[0] - localrMinVec[0];
}
DDLogicalPart DDDividedPolyconeRho::makeDDLogicalPart ( const int  copyNo) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 102 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::compNDiv_, DCOUT_V, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polycone(), DDPolycone::rMaxVec(), DDLogicalPart::solid(), and tablePrinter::width.

{
  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();

  int nZplanes = localzVec.size();

  std::vector<double> newrMinVec;
  std::vector<double> newrMaxVec;

  double width = 0.;
  for(int ii = 0; ii < nZplanes; ++ii)
  {
    width = calculateWidth( localrMaxVec[ii]
                            - localrMinVec[ii], compNDiv_, div_.offset() );
    // hmmm different width every time... probably should use width 
    // not compWidth_
    //    newrMinVec[ii] = localrMinVec[ii]+div_.offset()+compWidth_*copyNo;
    //    newrMaxVec[ii] = localrMinVec[ii]+div_.offset()+compWidth_*(copyNo+1);
    newrMinVec.push_back(localrMinVec[ii]+div_.offset()+width*copyNo);
    newrMaxVec.push_back(localrMinVec[ii]+div_.offset()+width*(copyNo+1));
  }
  solname = DDName( div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo),
                    div_.parent().ddname().ns());
      
  ddpolycone = DDSolidFactory::polycone( solname,
                                         msol.startPhi(),
                                         msol.deltaPhi(),
                                         localzVec,
                                         newrMinVec,
                                         newrMaxVec );

  DDLogicalPart ddlp = DDLogicalPart( solname, usemat, ddpolycone );
  DCOUT_V ('P', " DDDividedPolyconeRho::makeDDLogicalPart() lp:" << ddlp);
  return ddlp;
}
DDRotation DDDividedPolyconeRho::makeDDRotation ( const int  copyNo) const [virtual]

Reimplemented from DDDividedGeometryObject.

Definition at line 87 of file DDDividedPolycone.cc.

References DCOUT_V.

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

Reimplemented from DDDividedGeometryObject.

Definition at line 95 of file DDDividedPolycone.cc.

{
  DDTranslation translation;
  return translation;
}