CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedBoxZ Class Referencefinal

#include <DDDividedBox.h>

Inheritance diagram for DDDividedBoxZ:
DDDividedGeometryObject

Public Member Functions

 DDDividedBoxZ (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
 
std::unique_ptr< 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 32 of file DDDividedBox.h.

Constructor & Destructor Documentation

◆ DDDividedBoxZ()

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

Definition at line 150 of file DDDividedBox.cc.

153  setType("DivisionBoxZ");
154  DDBox mbox = (DDBox)(div_.parent().solid());
155 
156  if (divisionType_ == DivWIDTH) {
157  compNDiv_ = calculateNDiv(2 * mbox.halfZ(), div_.width(), div_.offset());
158  } else if (divisionType_ == DivNDIV) {
160  }
161 
162  // somehow here, I want to iterate over the nDivs or nReplicas
163  // and make the solid, make the logical part, then position it.
164  // since DDBox is special, I will not make the solid and logical
165  // part but once. We'll see how bad the others go.
166  // ihatethisihatethisihatethis
167  // for (int i = 0; i < compNDiv_; ++i)
168  // {
169  // DDpos(makeDDLogicalPart(i) // child logical part
170  // , div_.parent() // parent logical part
171  // , i // copy number
172  // , makeDDTranslation(i) // translation
173  // , makeDDRotation(i) // rotation. box is default (i.e. identity).
174  // );
175  // }
176 }

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

Member Function Documentation

◆ getMaxParameter()

double DDDividedBoxZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 178 of file DDDividedBox.cc.

178  {
179  DDBox msol = (DDBox)(div_.parent().solid());
180  return 2 * msol.halfZ();
181 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedBoxZ::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 198 of file DDDividedBox.cc.

198  {
199  // in other cases, this solid will have 1, 2, 3, etc. after it.
200  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
201  DDSolid ddbox(solname);
202  DDMaterial usemat(div_.parent().material());
203  DDBox msol = (DDBox)(div_.parent().solid());
204  DDLogicalPart ddlp(solname);
205  if (!ddbox.isDefined().second) //This solid has NOT been defined.
206  {
207  double pDx = msol.halfX();
208  double pDy = msol.halfY();
209  double pDz = compWidth_ / 2.;
210  ddbox = DDSolidFactory::box(solname, pDx, pDy, pDz);
211  ddlp = DDLogicalPart(solname, usemat, ddbox);
212  }
213  return ddlp;
214 }

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

◆ makeDDRotation()

DDRotation DDDividedBoxZ::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 183 of file DDDividedBox.cc.

183 { return DDRotation(); }

◆ makeDDTranslation()

DDTranslation DDDividedBoxZ::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 185 of file DDDividedBox.cc.

185  {
186  DDBox msol = (DDBox)(div_.parent().solid());
187  double mdx = msol.halfZ();
188 
189  //----- translation
190  DDTranslation translation;
191 
192  double posi = -mdx + div_.offset() + (copyNo + 0.5) * compWidth_;
193  translation.SetZ(posi);
194 
195  return translation;
196 }

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

DDDividedGeometryObject::compWidth_
double compWidth_
Definition: DDDividedGeometryObject.h:56
DDDivision::width
double width() const
Definition: DDDivision.cc:53
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDBox::halfZ
double halfZ(void) const
Definition: DDSolid.cc:212
DDLogicalPart::material
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
Definition: DDLogicalPart.cc:118
DDDividedGeometryObject::DDDividedGeometryObject
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
Definition: DDDividedGeometryObject.cc:13
DDBox
dd4hep::Box DDBox
Definition: DD4hep_volumeHandle.cc:27
DivWIDTH
Definition: DDDividedGeometryObject.h:14
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDDividedGeometryObject::checkParametersValidity
virtual void checkParametersValidity(void)
Definition: DDDividedGeometryObject.cc:41
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDBox
Interface to a Box.
Definition: DDSolid.h:156
DivNDIV
Definition: DDDividedGeometryObject.h:14
DDDividedGeometryObject::calculateNDiv
int calculateNDiv(double motherDim, double width, double offset) const
Definition: DDDividedGeometryObject.cc:33
DDDividedGeometryObject::div_
DDDivision div_
Definition: DDDividedGeometryObject.h:53
DDDividedGeometryObject::compNDiv_
int compNDiv_
Definition: DDDividedGeometryObject.h:55
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
DDDividedGeometryObject::divisionType_
DivisionType divisionType_
Definition: DDDividedGeometryObject.h:57
DDDividedGeometryObject::setType
virtual void setType(const std::string &type)
Definition: DDDividedGeometryObject.cc:81
DDDivision::offset
double offset() const
Definition: DDDivision.cc:55
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDBox::halfY
double halfY(void) const
Definition: DDSolid.cc:210
DDDivision::nReplicas
int nReplicas() const
Definition: DDDivision.cc:51
DDSolidShape::ddbox
DDName::ns
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDSolidFactory::box
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:533
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
DDDivision::parent
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:16
DDDividedGeometryObject::calculateWidth
double calculateWidth(double motherDim, int nDiv, double offset) const
Definition: DDDividedGeometryObject.cc:37