CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedTubsRho Class Referencefinal

#include <DDDividedTubs.h>

Inheritance diagram for DDDividedTubsRho:
DDDividedGeometryObject

Public Member Functions

 DDDividedTubsRho (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 12 of file DDDividedTubs.h.

Constructor & Destructor Documentation

◆ DDDividedTubsRho()

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

Definition at line 19 of file DDDividedTubs.cc.

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

22  setType("DivisionTubsRho");
23  DDTubs msol = (DDTubs)(div_.parent().solid());
24 
25  if (divisionType_ == DivWIDTH) {
26  compNDiv_ = calculateNDiv(msol.rIn() - msol.rOut(), div_.width(), div_.offset());
27  } else if (divisionType_ == DivNDIV) {
28  compWidth_ = calculateWidth(msol.rIn() - msol.rOut(), div_.nReplicas(), div_.offset());
29  }
30 }
int nReplicas() const
Definition: DDDivision.cc:51
double rIn(void) const
Definition: DDSolid.cc:456
double rOut(void) const
Definition: DDSolid.cc:458
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)
dd4hep::Tube DDTubs
int calculateNDiv(double motherDim, double width, double offset) const
virtual void setType(const std::string &type)
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

Member Function Documentation

◆ getMaxParameter()

double DDDividedTubsRho::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 32 of file DDDividedTubs.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDTubs::rIn(), DDTubs::rOut(), and DDLogicalPart::solid().

32  {
33  DDTubs msol = (DDTubs)(div_.parent().solid());
34  return msol.rOut() - msol.rIn();
35 }
double rIn(void) const
Definition: DDSolid.cc:456
double rOut(void) const
Definition: DDSolid.cc:458
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
dd4hep::Tube DDTubs
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.

◆ makeDDLogicalPart()

DDLogicalPart DDDividedTubsRho::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 47 of file DDDividedTubs.cc.

References DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), ddtubs, DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), cond::impl::to_string(), and DDSolidFactory::tubs().

47  {
48  // must always make new name and new solid
49  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), div_.parent().ddname().ns());
50  DDSolid ddtubs(solname);
51  DDMaterial usemat(div_.parent().material());
52  DDTubs msol = (DDTubs)(div_.parent().solid());
53  DDLogicalPart ddlp;
54 
55  double pRMin = msol.rIn() + div_.offset() + compWidth_ * copyNo;
56  double pRMax = msol.rIn() + div_.offset() + compWidth_ * (copyNo + 1);
57  double pDz = msol.zhalf();
58  double pSPhi = msol.startPhi();
59  double pDPhi = msol.deltaPhi();
60  ddtubs = DDSolidFactory::tubs(DDName(solname), pDz, pRMin, pRMax, pSPhi, pDPhi);
61  ddlp = DDLogicalPart(solname, usemat, ddtubs);
62  return ddlp;
63 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:77
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
dd4hep::Tube DDTubs
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
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:667
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
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.
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52

◆ makeDDRotation()

DDRotation DDDividedTubsRho::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 37 of file DDDividedTubs.cc.

37  {
38  DDRotation myddrot; // sets to identity.
39  return myddrot;
40 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57

◆ makeDDTranslation()

DDTranslation DDDividedTubsRho::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 42 of file DDDividedTubs.cc.

42  {
43  DDTranslation translation;
44  return translation;
45 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7