CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

DDDividedGeometryObject Class Reference

#include <DDDividedGeometryObject.h>

Inheritance diagram for DDDividedGeometryObject:
DDDividedBoxX DDDividedBoxY DDDividedBoxZ DDDividedConsPhi DDDividedConsRho DDDividedConsZ DDDividedPolyconePhi DDDividedPolyconeRho DDDividedPolyconeZ DDDividedPolyhedraPhi DDDividedPolyhedraRho DDDividedPolyhedraZ DDDividedTrdX DDDividedTrdY DDDividedTrdZ DDDividedTubsPhi DDDividedTubsRho DDDividedTubsZ

List of all members.

Public Member Functions

 DDDividedGeometryObject (const DDDivision &div, DDCompactView *cpv)
virtual void execute (void)
virtual const std::string & getType (void) const
virtual DDLogicalPart makeDDLogicalPart (const int copyNo) const
virtual DDRotation makeDDRotation (const int copyNo) const
virtual DDTranslation makeDDTranslation (const int copyNo) const
virtual void setType (const std::string &type)
int volumeFirstCopyNo (void) const
virtual ~DDDividedGeometryObject (void)

Static Public Member Functions

static const double tolerance (void)

Protected Member Functions

int calculateNDiv (double motherDim, double width, double offset) const
double calculateWidth (double motherDim, int nDiv, double offset) const
DDRotationMatrixchangeRotMatrix (double rotZ=0.) const
void checkNDivAndWidth (double maxPar)
void checkOffset (double maxPar)
virtual void checkParametersValidity (void)
virtual double getMaxParameter (void) const

Protected Attributes

int compNDiv_
double compWidth_
DDCompactViewcpv_
DDDivision div_
DivisionType divisionType_
std::string ftype_
int theVoluFirstCopyNo_

Detailed Description

Definition at line 22 of file DDDividedGeometryObject.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file DDDividedGeometryObject.cc.

References DCOUT_V, div_, divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), tolerance(), and DDDivision::width().

  : div_( div ),
    ftype_(),
    compNDiv_( div.nReplicas()),
    compWidth_( div.width()),
    divisionType_( DivNDIVandWIDTH ),
    theVoluFirstCopyNo_( 1 ),
    cpv_( cpv )
{
  if( div_.nReplicas() == 0 || div_.width() < tolerance())
  {
    if( div_.width() < tolerance())
      divisionType_ = DivNDIV;
    else 
      divisionType_ = DivWIDTH;
  } 
  DCOUT_V( 'P', " DDDividedGeometryObject Divisions " << div_ << std::endl );
}
DDDividedGeometryObject::~DDDividedGeometryObject ( void  ) [virtual]

Definition at line 35 of file DDDividedGeometryObject.cc.

{}

Member Function Documentation

int DDDividedGeometryObject::calculateNDiv ( double  motherDim,
double  width,
double  offset 
) const [protected]
double DDDividedGeometryObject::calculateWidth ( double  motherDim,
int  nDiv,
double  offset 
) const [protected]
DDRotationMatrix * DDDividedGeometryObject::changeRotMatrix ( double  rotZ = 0.) const [protected]
void DDDividedGeometryObject::checkNDivAndWidth ( double  maxPar) [protected]

Definition at line 90 of file DDDividedGeometryObject.cc.

References compNDiv_, compWidth_, gather_cfg::cout, DCOUT_V, div_, divisionType_, DivNDIVandWIDTH, DDDivision::offset(), DDDivision::parent(), asciidump::s, and tolerance().

Referenced by checkParametersValidity().

{
  if( (divisionType_ == DivNDIVandWIDTH)
      && (div_.offset() + compWidth_*compNDiv_ - maxPar > tolerance() ) )
  {
    std::string s = "ERROR - DDDividedGeometryObject::checkNDivAndWidth()";
    s+= "\n        Division of LogicalPart " + div_.parent();
    s+= " has too big an offset.";
    DCOUT_V('P', "DDDividedGeometryObject::checkNDivAndWidth has computed div_.offset() + compWidth_*compNDiv_ - maxPar =" << div_.offset() + compWidth_*compNDiv_ - maxPar << " and tolerance()=" << tolerance());
    std::cout << compWidth_ << std::endl;
    throw DDException(s);
  }
}
void DDDividedGeometryObject::checkOffset ( double  maxPar) [protected]

Definition at line 76 of file DDDividedGeometryObject.cc.

References DCOUT_V, div_, DDDivision::offset(), DDDivision::parent(), and asciidump::s.

Referenced by checkParametersValidity().

{
  if( div_.offset() >= maxPar )
  {
    DCOUT_V('P', "DDDividedGeometryObject::checkOffset() Division of LogicalPart " << div_.parent() << " offset=" << div_.offset() << " maxPar=" << maxPar << "\n");
    std::string s = "DDDividedGeometryObject::checkOffset() IllegalConstruct";
    s += "\nERROR - DDDividedGeometryObject::checkOffset()";
    s += "\n        failed.";
    s += "  Too big an offset.";
    throw DDException(s);
  }
}
void DDDividedGeometryObject::checkParametersValidity ( void  ) [protected, virtual]
void DDDividedGeometryObject::execute ( void  ) [virtual]

Definition at line 125 of file DDDividedGeometryObject.cc.

References compNDiv_, cpv_, DCOUT_V, div_, i, makeDDLogicalPart(), makeDDRotation(), makeDDTranslation(), DDDivision::parent(), DDCompactView::position(), and theVoluFirstCopyNo_.

Referenced by DDLDivision::processElement().

{
  DCOUT_V( 'D', "about to make " <<  compNDiv_ << " divisions." << std::endl );
  for( int i = theVoluFirstCopyNo_; i < compNDiv_+theVoluFirstCopyNo_; ++i )
  {
    DCOUT_V( 'D',  "Parent Volume: " << div_.parent() << std::endl );
    DCOUT_V( 'D',  "Child Volume: " << makeDDLogicalPart(i) << std::endl );
    DCOUT_V( 'D',  "   copyNo:" << i << std::endl );
    DCOUT_V( 'D',  "   Translation: " << makeDDTranslation(i) << std::endl );
    DCOUT_V( 'D',  "   rotation=" << makeDDRotation(i) << std::endl );

    cpv_->position( makeDDLogicalPart( i ),
                    div_.parent(),
                    i,
                    makeDDTranslation( i ),
                    makeDDRotation( i ),
                    &div_ );
  }
}
double DDDividedGeometryObject::getMaxParameter ( void  ) const [protected, virtual]
const std::string & DDDividedGeometryObject::getType ( void  ) const [virtual]

Definition at line 119 of file DDDividedGeometryObject.cc.

References ftype_.

{
  return ftype_;
}
DDLogicalPart DDDividedGeometryObject::makeDDLogicalPart ( const int  copyNo) const [virtual]
DDRotation DDDividedGeometryObject::makeDDRotation ( const int  copyNo) const [virtual]
DDTranslation DDDividedGeometryObject::makeDDTranslation ( const int  copyNo) const [virtual]
void DDDividedGeometryObject::setType ( const std::string &  type) [virtual]
const double DDDividedGeometryObject::tolerance ( void  ) [static]

Definition at line 105 of file DDDividedGeometryObject.cc.

Referenced by checkNDivAndWidth(), DDDividedTrdX::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), and DDDividedGeometryObject().

{
  // this can come from some global tolerance if you want.
  static const double tol = 1.0/1000.00;
  return tol;
}
int DDDividedGeometryObject::volumeFirstCopyNo ( void  ) const

Member Data Documentation

Definition at line 63 of file DDDividedGeometryObject.h.

Referenced by checkNDivAndWidth(), DDDividedBoxX::DDDividedBoxX(), DDDividedBoxY::DDDividedBoxY(), DDDividedBoxZ::DDDividedBoxZ(), DDDividedConsPhi::DDDividedConsPhi(), DDDividedConsRho::DDDividedConsRho(), DDDividedConsZ::DDDividedConsZ(), DDDividedPolyconePhi::DDDividedPolyconePhi(), DDDividedPolyconeRho::DDDividedPolyconeRho(), DDDividedPolyconeZ::DDDividedPolyconeZ(), DDDividedPolyhedraPhi::DDDividedPolyhedraPhi(), DDDividedPolyhedraRho::DDDividedPolyhedraRho(), DDDividedPolyhedraZ::DDDividedPolyhedraZ(), DDDividedTrdX::DDDividedTrdX(), DDDividedTrdY::DDDividedTrdY(), DDDividedTrdZ::DDDividedTrdZ(), DDDividedTubsPhi::DDDividedTubsPhi(), DDDividedTubsRho::DDDividedTubsRho(), DDDividedTubsZ::DDDividedTubsZ(), DDDividedConsRho::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedTrdX::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDRotation(), DDDividedConsPhi::makeDDRotation(), DDDividedTubsPhi::makeDDRotation(), DDDividedPolyhedraPhi::makeDDRotation(), DDDividedTubsRho::makeDDTranslation(), DDDividedTrdZ::makeDDTranslation(), DDDividedTrdY::makeDDTranslation(), DDDividedConsZ::makeDDTranslation(), DDDividedBoxX::makeDDTranslation(), DDDividedTubsZ::makeDDTranslation(), DDDividedConsRho::makeDDTranslation(), DDDividedBoxZ::makeDDTranslation(), DDDividedPolyhedraZ::makeDDTranslation(), DDDividedTrdX::makeDDTranslation(), DDDividedBoxY::makeDDTranslation(), DDDividedConsPhi::makeDDTranslation(), and DDDividedTubsPhi::makeDDTranslation().

Definition at line 66 of file DDDividedGeometryObject.h.

Referenced by execute().

Definition at line 60 of file DDDividedGeometryObject.h.

Referenced by checkNDivAndWidth(), checkOffset(), DDDividedPolyhedraZ::checkParametersValidity(), DDDividedPolyconeZ::checkParametersValidity(), checkParametersValidity(), DDDividedTrdZ::checkParametersValidity(), DDDividedPolyhedraRho::checkParametersValidity(), DDDividedTrdX::checkParametersValidity(), DDDividedPolyhedraPhi::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), DDDividedPolyconeRho::checkParametersValidity(), DDDividedBoxX::DDDividedBoxX(), DDDividedBoxY::DDDividedBoxY(), DDDividedBoxZ::DDDividedBoxZ(), DDDividedConsPhi::DDDividedConsPhi(), DDDividedConsRho::DDDividedConsRho(), DDDividedConsZ::DDDividedConsZ(), DDDividedGeometryObject(), DDDividedPolyconePhi::DDDividedPolyconePhi(), DDDividedPolyconeRho::DDDividedPolyconeRho(), DDDividedPolyconeZ::DDDividedPolyconeZ(), DDDividedPolyhedraPhi::DDDividedPolyhedraPhi(), DDDividedPolyhedraRho::DDDividedPolyhedraRho(), DDDividedPolyhedraZ::DDDividedPolyhedraZ(), DDDividedTrdX::DDDividedTrdX(), DDDividedTrdY::DDDividedTrdY(), DDDividedTrdZ::DDDividedTrdZ(), DDDividedTubsPhi::DDDividedTubsPhi(), DDDividedTubsRho::DDDividedTubsRho(), DDDividedTubsZ::DDDividedTubsZ(), execute(), DDDividedConsPhi::getMaxParameter(), DDDividedPolyconeZ::getMaxParameter(), DDDividedPolyhedraRho::getMaxParameter(), DDDividedTubsZ::getMaxParameter(), DDDividedPolyconeRho::getMaxParameter(), DDDividedTrdY::getMaxParameter(), DDDividedTrdZ::getMaxParameter(), DDDividedPolyconePhi::getMaxParameter(), DDDividedTrdX::getMaxParameter(), DDDividedTubsRho::getMaxParameter(), DDDividedBoxY::getMaxParameter(), DDDividedTubsPhi::getMaxParameter(), DDDividedBoxZ::getMaxParameter(), DDDividedPolyhedraPhi::getMaxParameter(), DDDividedBoxX::getMaxParameter(), DDDividedConsRho::getMaxParameter(), DDDividedConsZ::getMaxParameter(), DDDividedPolyhedraZ::getMaxParameter(), DDDividedConsRho::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedPolyhedraRho::makeDDLogicalPart(), DDDividedTrdX::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedPolyhedraZ::makeDDLogicalPart(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedPolyconeRho::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDRotation(), DDDividedConsPhi::makeDDRotation(), DDDividedTubsPhi::makeDDRotation(), DDDividedPolyhedraPhi::makeDDRotation(), DDDividedTubsRho::makeDDTranslation(), DDDividedTrdZ::makeDDTranslation(), DDDividedTrdY::makeDDTranslation(), DDDividedConsZ::makeDDTranslation(), DDDividedBoxX::makeDDTranslation(), DDDividedTubsZ::makeDDTranslation(), DDDividedPolyconeZ::makeDDTranslation(), DDDividedConsRho::makeDDTranslation(), DDDividedBoxZ::makeDDTranslation(), DDDividedPolyhedraZ::makeDDTranslation(), DDDividedTrdX::makeDDTranslation(), DDDividedBoxY::makeDDTranslation(), DDDividedConsPhi::makeDDTranslation(), and DDDividedTubsPhi::makeDDTranslation().

std::string DDDividedGeometryObject::ftype_ [protected]

Definition at line 61 of file DDDividedGeometryObject.h.

Referenced by getType(), and setType().

Definition at line 65 of file DDDividedGeometryObject.h.

Referenced by execute().