CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedTubsPhi Class Referencefinal

#include <DDDividedTubs.h>

Inheritance diagram for DDDividedTubsPhi:
DDDividedGeometryObject

Public Member Functions

 DDDividedTubsPhi (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 DDDividedTubs.h.

Constructor & Destructor Documentation

◆ DDDividedTubsPhi()

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

Definition at line 65 of file DDDividedTubs.cc.

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

68  setType("DivisionTubsPhi");
69 
70  DDTubs msol = (DDTubs)(div_.parent().solid());
71  if (divisionType_ == DivWIDTH) {
72  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
73  if (msol.deltaPhi() == 360._deg) {
74  compNDiv_ = calculateNDiv(msol.deltaPhi(), div_.width(), 0.);
75  } else {
77  }
78 
79  } else if (divisionType_ == DivNDIV) {
80  if (msol.deltaPhi() == 360._deg) {
82  } else {
84  }
85  }
86 }
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)
dd4hep::Tube DDTubs
int calculateNDiv(double motherDim, double width, double offset) const
virtual void setType(const std::string &type)
double deltaPhi(void) const
Definition: DDSolid.cc:462
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 DDDividedTubsPhi::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 88 of file DDDividedTubs.cc.

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

88  {
89  DDTubs msol = (DDTubs)(div_.parent().solid());
90  return msol.deltaPhi();
91 }
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
dd4hep::Tube DDTubs
double deltaPhi(void) const
Definition: DDSolid.cc:462
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.

◆ makeDDLogicalPart()

DDLogicalPart DDDividedTubsPhi::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 108 of file DDDividedTubs.cc.

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

108  {
109  DDName solname(div_.name());
110  DDSolid ddtubs(solname);
111  DDMaterial usemat(div_.parent().material());
112  DDTubs msol = (DDTubs)(div_.parent().solid());
113  DDLogicalPart ddlp(solname);
114 
115  if (!ddtubs.isDefined().second) // only if it is not defined, make new dimensions and solid.
116  {
117  double pRMin = msol.rIn();
118  double pRMax = msol.rOut();
119  double pDz = msol.zhalf();
120  double pSPhi = msol.startPhi() + div_.offset();
121  double pDPhi = compWidth_;
122  ddtubs = DDSolidFactory::tubs(DDName(solname), pDz, pRMin, pRMax, pSPhi, pDPhi);
123  ddlp = DDLogicalPart(solname, usemat, ddtubs);
124  }
125  return ddlp;
126 }
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
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
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 & name() const
Definition: DDBase.h:59
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.

◆ makeDDRotation()

DDRotation DDDividedTubsPhi::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 93 of file DDDividedTubs.cc.

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

93  {
94  DDRotation myddrot; // sets to identity.
95  double posi = (copyNo - 1) * compWidth_; // This should put the first one at the 0 of the parent.
96  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + std::to_string(copyNo),
97  div_.parent().ddname().ns());
98  myddrot = DDrot(ddrotname, changeRotMatrix(posi));
99 
100  return myddrot;
101 }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
static std::string to_string(const XMLCh *ch)
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
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
std::unique_ptr< DDRotationMatrix > changeRotMatrix(double rotZ=0.) const
const N & ddname() const
Definition: DDBase.h:61
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52

◆ makeDDTranslation()

DDTranslation DDDividedTubsPhi::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 103 of file DDDividedTubs.cc.

103  {
104  DDTranslation translation;
105  return translation;
106 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7