CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedConsPhi Class Referencefinal

#include <DDDividedCons.h>

Inheritance diagram for DDDividedConsPhi:
DDDividedGeometryObject

Public Member Functions

 DDDividedConsPhi (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 22 of file DDDividedCons.h.

Constructor & Destructor Documentation

◆ DDDividedConsPhi()

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

Definition at line 82 of file DDDividedCons.cc.

85  setType("DivisionConsPhi");
86  DDCons msol = (DDCons)(div_.parent().solid());
87 
88  if (divisionType_ == DivWIDTH) {
89  DDCons msol = (DDCons)(div_.parent().solid());
90  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
91  if (msol.deltaPhi() == 360._deg) {
92  compNDiv_ = calculateNDiv(msol.deltaPhi(), div_.width(), 0.);
93  } else {
95  }
96  } else if (divisionType_ == DivNDIV) {
97  DDCons msol = (DDCons)(div_.parent().solid());
98  if (msol.deltaPhi() == 360._deg) {
100  } else {
102  }
103  }
104 }

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

Member Function Documentation

◆ getMaxParameter()

double DDDividedConsPhi::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 106 of file DDDividedCons.cc.

106  {
107  DDCons msol = (DDCons)(div_.parent().solid());
108  return msol.deltaPhi();
109 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedConsPhi::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 128 of file DDDividedCons.cc.

128  {
129  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
130  DDSolid ddcons(solname);
131  DDMaterial usemat(div_.parent().material());
132  DDCons msol = (DDCons)(div_.parent().solid());
133 
134  if (!ddcons.isDefined().second) {
135  double pRMin1 = msol.rInMinusZ();
136  double pRMax1 = msol.rOutMinusZ();
137  double pRMin2 = msol.rInPlusZ();
138  double pRMax2 = msol.rOutPlusZ();
139  double pDz = msol.zhalf();
140 
141  //- already rotated double pSPhi = div_.offset() + copyNo*compWidth_;
142  double pSPhi = div_.offset() + msol.phiFrom();
143  double pDPhi = compWidth_;
144  ddcons = DDSolidFactory::cons(DDName(solname), pDz, pRMin1, pRMax1, pRMin2, pRMax2, pSPhi, pDPhi);
145  }
146 
147  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
148 
149  return ddlp;
150 }

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

◆ makeDDRotation()

DDRotation DDDividedConsPhi::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 111 of file DDDividedCons.cc.

111  {
112  DDRotation myddrot; // sets to identity.
113  double posi = (copyNo - 1) * compWidth_;
114  // how to name the rotation??
115  // i hate this crap :-)
116  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + std::to_string(copyNo),
117  div_.parent().ddname().ns());
118  myddrot = DDrot(ddrotname, changeRotMatrix(posi));
119 
120  return myddrot;
121 }

References DDDividedGeometryObject::changeRotMatrix(), DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDrot(), DDDividedGeometryObject::div_, DDName::name(), DDName::ns(), and DDDivision::parent().

◆ makeDDTranslation()

DDTranslation DDDividedConsPhi::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 123 of file DDDividedCons.cc.

123  {
124  DDTranslation translation;
125  return translation;
126 }
DDDividedGeometryObject::compWidth_
double compWidth_
Definition: DDDividedGeometryObject.h:56
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
DDCons
Definition: DDSolid.h:281
DDCons::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:422
DDDivision::width
double width() const
Definition: DDDivision.cc:53
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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
DDSolidFactory::cons
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:636
DDCons::rInMinusZ
double rInMinusZ(void) const
Definition: DDSolid.cc:412
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
DDCons
dd4hep::ConeSegment DDCons
Definition: DD4hep_volumeHandle.cc:30
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::changeRotMatrix
std::unique_ptr< DDRotationMatrix > changeRotMatrix(double rotZ=0.) const
Definition: DDDividedGeometryObject.cc:29
DDDividedGeometryObject::compNDiv_
int compNDiv_
Definition: DDDividedGeometryObject.h:55
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
DDSolidShape::ddcons
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
DDDivision::nReplicas
int nReplicas() const
Definition: DDDivision.cc:51
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
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
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
DDDividedGeometryObject::calculateWidth
double calculateWidth(double motherDim, int nDiv, double offset) const
Definition: DDDividedGeometryObject.cc:37