CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedTubsZ Class Referencefinal

#include <DDDividedTubs.h>

Inheritance diagram for DDDividedTubsZ:
DDDividedGeometryObject

Public Member Functions

 DDDividedTubsZ (const DDDivision &div, DDCompactView *cpv)
 
virtual double getMaxParameter () const override
 
virtual DDLogicalPart makeDDLogicalPart (const int copyNo) const override
 
virtual DDRotation makeDDRotation (const int copyNo) const override
 
virtual DDTranslation makeDDTranslation (const 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
 
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 40 of file DDDividedTubs.h.

Constructor & Destructor Documentation

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

Definition at line 163 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(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), DDDivision::width(), and DDTubs::zhalf().

165 {
167 
168  DDTubs msol = (DDTubs)(div_.parent().solid());
169 
170  setType( "DivisionTubsZ" );
171  if( divisionType_ == DivWIDTH )
172  {
173  compNDiv_ = calculateNDiv( 2*msol.zhalf(), div_.width(), div_.offset() );
174  }
175  else if( divisionType_ == DivNDIV )
176  {
178  }
179 }
int nReplicas() const
Definition: DDDivision.cc:71
double offset() const
Definition: DDDivision.cc:81
int calculateNDiv(double motherDim, double width, double offset) const
double calculateWidth(double motherDim, int nDiv, double offset) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
virtual void checkParametersValidity(void)
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
double zhalf(void) const
Definition: DDSolid.cc:602
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

double DDDividedTubsZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 182 of file DDDividedTubs.cc.

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

183 {
184  DDTubs msol = (DDTubs)(div_.parent().solid());
185  return 2*msol.zhalf();
186 
187 }
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:602
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedTubsZ::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 209 of file DDDividedTubs.cc.

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

210 {
211  DDMaterial usemat(div_.parent().material());
212  DDTubs msol = (DDTubs) (div_.parent().solid());
213  DDLogicalPart ddlp;
214 
215  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
216  DDSolid ddtubs(solname);
217 
218  if (!ddtubs.isDefined().second) // only if it is not defined, make new dimensions and solid.
219  {
220  double pRMin = msol.rIn();
221  double pRMax = msol.rOut();
222  double pDz = compWidth_/2.;
223  double pSPhi = msol.startPhi();
224  double pDPhi = msol.deltaPhi();
225  ddtubs = DDSolidFactory::tubs(DDName(solname), pDz, pRMin, pRMax, pSPhi, pDPhi);
226  ddlp = DDLogicalPart(solname, usemat, ddtubs);
227  }
228  else {
229  ddlp = DDLogicalPart(solname);
230  }
231  return ddlp;
232 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:983
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
const N & ddname() const
Definition: DDBase.h:80
DDRotation DDDividedTubsZ::makeDDRotation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 190 of file DDDividedTubs.cc.

191 {
192  DDRotation myddrot; // sets to identity.
193  return myddrot;
194 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
DDTranslation DDDividedTubsZ::makeDDTranslation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 197 of file DDDividedTubs.cc.

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

198 {
199  DDTranslation translation;
200 
201  DDTubs msol = (DDTubs)(div_.parent().solid());
202  double posi = - msol.zhalf() + div_.offset() + compWidth_/2 + copyNo*compWidth_;
203  translation.SetZ(posi);
204 
205  return translation;
206 }
double offset() const
Definition: DDDivision.cc:81
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:602
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86