CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions
DDDividedConsZ Class Referencefinal

#include <DDDividedCons.h>

Inheritance diagram for DDDividedConsZ:
DDDividedGeometryObject

Public Member Functions

 DDDividedConsZ (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 DDDividedCons.h.

Constructor & Destructor Documentation

◆ DDDividedConsZ()

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

Definition at line 152 of file DDDividedCons.cc.

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

155 
156  DDCons msol = (DDCons)(div_.parent().solid());
157  setType("DivisionConsZ");
158 
159  if (divisionType_ == DivWIDTH) {
160  DDCons msol = (DDCons)(div_.parent().solid());
161  compNDiv_ = calculateNDiv(2 * msol.zhalf(), div_.width(), div_.offset());
162  } else if (divisionType_ == DivNDIV) {
163  DDCons msol = (DDCons)(div_.parent().solid());
165  }
166 }
int nReplicas() const
Definition: DDDivision.cc:51
double offset() const
Definition: DDDivision.cc:55
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
virtual void checkParametersValidity(void)
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
int calculateNDiv(double motherDim, double width, double offset) const
virtual void setType(const std::string &type)
dd4hep::ConeSegment DDCons
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double width() const
Definition: DDDivision.cc:53
double calculateWidth(double motherDim, int nDiv, double offset) const
double zhalf(void) const
Definition: DDSolid.cc:414

Member Function Documentation

◆ getMaxParameter()

double DDDividedConsZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 168 of file DDDividedCons.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDCons::zhalf().

168  {
169  DDCons msol = (DDCons)(div_.parent().solid());
170  return 2 * msol.zhalf();
171 }
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
dd4hep::ConeSegment DDCons
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double zhalf(void) const
Definition: DDSolid.cc:414

◆ makeDDLogicalPart()

DDLogicalPart DDDividedConsZ::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 188 of file DDDividedCons.cc.

References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), ddcons, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), to_string(), and DDCons::zhalf().

188  {
189  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), div_.parent().ddname().ns());
190  DDSolid ddcons(solname);
191  DDMaterial usemat(div_.parent().material());
192  DDCons msol = (DDCons)(div_.parent().solid());
193 
194  double mHalfLength = msol.zhalf();
195  double aRInner = (msol.rInPlusZ() - msol.rInMinusZ()) / (2 * mHalfLength);
196  double bRInner = (msol.rInPlusZ() + msol.rInMinusZ()) / 2;
197  double aROuter = (msol.rOutPlusZ() - msol.rOutMinusZ()) / (2 * mHalfLength);
198  double bROuter = (msol.rOutPlusZ() + msol.rOutMinusZ()) / 2;
199  double xMinusZ = -mHalfLength + div_.offset() + compWidth_ * copyNo;
200  double xPlusZ = -mHalfLength + div_.offset() + compWidth_ * (copyNo + 1);
201 
202  double pDz = compWidth_ / 2.;
203  double pSPhi = msol.phiFrom();
204  double pDPhi = msol.deltaPhi();
205 
207  pDz,
208  aRInner * xMinusZ + bRInner,
209  aROuter * xMinusZ + bROuter,
210  aRInner * xPlusZ + bRInner,
211  aROuter * xPlusZ + bROuter,
212  pSPhi,
213  pDPhi);
214 
215  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
216 
217  return ddlp;
218 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:650
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
double offset() const
Definition: DDDivision.cc:55
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
static std::string to_string(const XMLCh *ch)
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
dd4hep::ConeSegment DDCons
const N & ddname() const
Definition: DDBase.h:61
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double zhalf(void) const
Definition: DDSolid.cc:414
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52

◆ makeDDRotation()

DDRotation DDDividedConsZ::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 173 of file DDDividedCons.cc.

173  {
174  DDRotation myddrot; // sets to identity.
175  return myddrot;
176 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57

◆ makeDDTranslation()

DDTranslation DDDividedConsZ::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 178 of file DDDividedCons.cc.

References DDDividedGeometryObject::compWidth_, DDDividedGeometryObject::div_, DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDCons::zhalf().

178  {
179  DDTranslation translation;
180 
181  DDCons motherCons = (DDCons)(div_.parent().solid());
182  double posi = -motherCons.zhalf() + div_.offset() + compWidth_ / 2 + copyNo * compWidth_;
183  translation.SetZ(posi);
184 
185  return translation;
186 }
double offset() const
Definition: DDDivision.cc:55
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
dd4hep::ConeSegment DDCons
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
double zhalf(void) const
Definition: DDSolid.cc:414