CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyconePhi Class Referencefinal

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconePhi:
DDDividedGeometryObject

Public Member Functions

void checkParametersValidity () override
 
 DDDividedPolyconePhi (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)
 
- Protected Attributes inherited from DDDividedGeometryObject
int compNDiv_
 
double compWidth_
 
DDCompactViewcpv_
 
DDDivision div_
 
DivisionType divisionType_
 
std::string ftype_
 
int theVoluFirstCopyNo_
 

Detailed Description

Definition at line 23 of file DDDividedPolycone.h.

Constructor & Destructor Documentation

◆ DDDividedPolyconePhi()

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

Definition at line 112 of file DDDividedPolycone.cc.

115  DDPolycone msol = (DDPolycone)(div_.parent().solid());
116  setType("DivisionPolyconePhi");
117  // this is the g4. what do we keep??? I think it is deltaPhi
118  // double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
119  if (divisionType_ == DivWIDTH) {
120  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
121  if (msol.deltaPhi() == 360._deg) {
122  compNDiv_ = calculateNDiv(msol.deltaPhi(), div_.width(), 0.);
123  } else {
125  }
126  } else if (divisionType_ == DivNDIV) {
127  if (msol.deltaPhi() == 360._deg) {
129  } else {
131  }
132  }
133 }

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

Member Function Documentation

◆ checkParametersValidity()

void DDDividedPolyconePhi::checkParametersValidity ( void  )
overridevirtual

◆ getMaxParameter()

double DDDividedPolyconePhi::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 137 of file DDDividedPolycone.cc.

137  {
138  DDPolycone msol = (DDPolycone)(div_.parent().solid());
139  return msol.deltaPhi();
140 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedPolyconePhi::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 159 of file DDDividedPolycone.cc.

159  {
161  DDMaterial usemat(div_.parent().material());
162 
163  DDPolycone msol = (DDPolycone)(div_.parent().solid());
164  std::vector<double> localrMaxVec = msol.rMaxVec();
165  std::vector<double> localrMinVec = msol.rMinVec();
166  std::vector<double> localzVec = msol.zVec();
167 
168  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
169  DDSolid sol(solname);
170  if (!sol.isDefined().second) {
172  solname, msol.startPhi() + div_.offset(), compWidth_, localzVec, localrMinVec, localrMaxVec);
173  }
174  DDLogicalPart ddlp(solname);
175  if (!ddlp.isDefined().second) {
176  ddlp = DDLogicalPart(solname, usemat, ddpolycone);
177  }
178 
179  return ddlp;
180 }

References DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDBase< N, C >::isDefined(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polycone(), DDPolycone::rMaxVec(), and DDLogicalPart::solid().

◆ makeDDRotation()

DDRotation DDDividedPolyconePhi::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 142 of file DDDividedPolycone.cc.

142  {
143  DDRotation myddrot; // sets to identity.
144  double posi = (copyNo - 1) * compWidth_;
145  // how to name the rotation??
146  // i do not like this
147  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + std::to_string(copyNo),
148  div_.parent().ddname().ns());
149  myddrot = DDrot(ddrotname, changeRotMatrix(posi));
150 
151  return myddrot;
152 }

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

◆ makeDDTranslation()

DDTranslation DDDividedPolyconePhi::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 154 of file DDDividedPolycone.cc.

154  {
155  DDTranslation translation;
156  return translation;
157 }
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
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
DDPolycone::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:273
DDDividedGeometryObject::DDDividedGeometryObject
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
Definition: DDDividedGeometryObject.cc:13
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
DivNDIV
Definition: DDDividedGeometryObject.h:14
DDPolycone::rMaxVec
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:296
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
cms::DDSolidShape::ddpolycone
DDDividedPolyconePhi::checkParametersValidity
void checkParametersValidity() override
Definition: DDDividedPolycone.cc:135
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
DDSolidFactory::polycone
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:537
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
DDPolycone
Definition: DDSolid.h:211
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