CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedBoxY Class Referencefinal

#include <DDDividedBox.h>

Inheritance diagram for DDDividedBoxY:
DDDividedGeometryObject

Public Member Functions

 DDDividedBoxY (const DDDivision &div, DDCompactView *cpv)
 
double getMaxParameter () const override
 
DDLogicalPart makeDDLogicalPart (int copyNo) const override
 
DDRotation makeDDRotation (int copyNo) const override
 
DDTranslation makeDDTranslation (int copyNo) const override
 
- Public Member Functions inherited from DDDividedGeometryObject
 DDDividedGeometryObject (const DDDivision &div, DDCompactView *cpv)
 
virtual void execute (void)
 
virtual const std::string & getType (void) const
 
virtual void setType (const std::string &type)
 
int volumeFirstCopyNo (void) const
 
virtual ~DDDividedGeometryObject (void)=default
 

Additional Inherited Members

- Static Public Member Functions inherited from DDDividedGeometryObject
static const double tolerance (void)
 
- Protected Member Functions inherited from DDDividedGeometryObject
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)
 
- Protected Attributes inherited from DDDividedGeometryObject
int compNDiv_
 
double compWidth_
 
DDCompactViewcpv_
 
DDDivision div_
 
DivisionType divisionType_
 
std::string ftype_
 
int theVoluFirstCopyNo_
 

Detailed Description

Definition at line 24 of file DDDividedBox.h.

Constructor & Destructor Documentation

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

Definition at line 95 of file DDDividedBox.cc.

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

97 {
99  setType( "DivisionBoxY" );
100  DDBox mbox = (DDBox)(div_.parent().solid());
101 
102  if( divisionType_ == DivWIDTH ) {
103  compNDiv_ = calculateNDiv( 2*mbox.halfY(), div_.width(), div_.offset() );
104  } else if( divisionType_ == DivNDIV ) {
106  }
107 
108 
109  // somehow here, I want to iterate over the nDivs or nReplicas
110  // and make the solid, make the logical part, then position it.
111  // since DDBox is special, I will not make the solid and logical
112  // part but once. We'll see how bad the others go.
113  // ihatethisihatethisihatethis
114  // for (int i = 0; i < compNDiv_; ++i)
115  // {
116  // DDpos(makeDDLogicalPart(i) // child logical part
117  // , div_.parent() // parent logical part
118  // , i // copy number
119  // , makeDDTranslation(i) // translation
120  // , makeDDRotation(i) // rotation. box is default (i.e. identity).
121  // );
122  // }
123 }
double halfY(void) const
Definition: DDSolid.cc:276
int nReplicas() const
Definition: DDDivision.cc:71
double offset() const
Definition: DDDivision.cc:81
int calculateNDiv(double motherDim, double width, double offset) const
double calculateWidth(double motherDim, int nDiv, double offset) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
virtual void checkParametersValidity(void)
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
Interface to a Box.
Definition: DDSolid.h:164
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

double DDDividedBoxY::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 126 of file DDDividedBox.cc.

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

127 {
128  DDBox msol = (DDBox)(div_.parent().solid());
129  return 2*msol.halfY();
130 }
double halfY(void) const
Definition: DDSolid.cc:276
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Interface to a Box.
Definition: DDSolid.h:164
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedBoxY::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 154 of file DDDividedBox.cc.

References DDSolidFactory::box(), DDDividedGeometryObject::compWidth_, ddbox, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::parent(), and DDLogicalPart::solid().

155 {
156  // in other cases, this solid will have 1, 2, 3, etc. after it.
157  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
158  DDSolid ddbox(solname);
159  DDMaterial usemat(div_.parent().material());
160  DDBox msol = (DDBox) (div_.parent().solid());
161  DDLogicalPart ddlp(solname);
162  if (!ddbox.isDefined().second) //This solid has NOT been defined.
163  {
164  double pDx = msol.halfX();
165  double pDy = compWidth_/2.;
166  double pDz = msol.halfZ();
167  ddbox = DDSolidFactory::box(solname, pDx, pDy, pDz);
168  ddlp = DDLogicalPart(solname, usemat, ddbox);
169  }
170  return ddlp;
171 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
Definition: DDSolid.cc:819
Interface to a Box.
Definition: DDSolid.h:164
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
const N & ddname() const
Definition: DDBase.h:80
DDRotation DDDividedBoxY::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 133 of file DDDividedBox.cc.

134 {
135  return DDRotation();
136 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
DDTranslation DDDividedBoxY::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 139 of file DDDividedBox.cc.

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

140 {
141  DDBox msol = (DDBox)(div_.parent().solid());
142  double mdx = msol.halfY();
143 
144  //----- translation
145  DDTranslation translation;
146 
147  double posi = -mdx + div_.offset() + (copyNo+0.5) * compWidth_;
148  translation.SetY( posi );
149 
150  return translation;
151 }
double halfY(void) const
Definition: DDSolid.cc:276
double offset() const
Definition: DDDivision.cc:81
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Interface to a Box.
Definition: DDSolid.h:164
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86