CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedConsZ Class Referencefinal

#include <DDDividedCons.h>

Inheritance diagram for DDDividedConsZ:
DDDividedGeometryObject

Public Member Functions

 DDDividedConsZ (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 DDDividedCons.h.

Constructor & Destructor Documentation

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

Definition at line 198 of file DDDividedCons.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 DDCons::zhalf().

200 {
202 
203  DDCons msol = (DDCons)(div_.parent().solid());
204  setType( "DivisionConsZ" );
205 
206  if( divisionType_ == DivWIDTH )
207  {
208  DDCons msol = (DDCons)(div_.parent().solid());
209  compNDiv_ = calculateNDiv( 2*msol.zhalf()
210  , div_.width(), div_.offset() );
211  }
212  else if( divisionType_ == DivNDIV )
213  {
214  DDCons msol = (DDCons)(div_.parent().solid());
215  compWidth_ = calculateWidth( 2*msol.zhalf()
216  , div_.nReplicas(), div_.offset() );
217  }
218 }
double zhalf(void) const
Definition: DDSolid.cc:465
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 width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

double DDDividedConsZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 221 of file DDDividedCons.cc.

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

222 {
223  DDCons msol = (DDCons)(div_.parent().solid());
224  return 2*msol.zhalf();
225 }
double zhalf(void) const
Definition: DDSolid.cc:465
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedConsZ::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 248 of file DDDividedCons.cc.

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

249 {
250  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo),
251  div_.parent().ddname().ns());
252  DDSolid ddcons(solname);
253  DDMaterial usemat(div_.parent().material());
254  DDCons msol = (DDCons)(div_.parent().solid());
255 
256  double mHalfLength = msol.zhalf();
257  double aRInner = (msol.rInPlusZ()
258  - msol.rInMinusZ()) / (2*mHalfLength);
259  double bRInner = (msol.rInPlusZ()
260  + msol.rInMinusZ()) / 2;
261  double aROuter = (msol.rOutPlusZ()
262  - msol.rOutMinusZ()) / (2*mHalfLength);
263  double bROuter = (msol.rOutPlusZ()
264  + msol.rOutMinusZ()) / 2;
265  double xMinusZ = -mHalfLength + div_.offset() + compWidth_*copyNo;
266  double xPlusZ = -mHalfLength + div_.offset() + compWidth_*(copyNo+1);
267 
268  double pDz = compWidth_ / 2.;
269  double pSPhi = msol.phiFrom();
270  double pDPhi = msol.deltaPhi();
271 
273  , pDz
274  , aRInner * xMinusZ + bRInner
275  , aROuter * xMinusZ + bROuter
276  , aRInner * xPlusZ + bRInner
277  , aROuter * xPlusZ + bROuter
278  , pSPhi
279  , pDPhi
280  );
281 
282  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
283 
284  return ddlp;
285 }
double zhalf(void) const
Definition: DDSolid.cc:465
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double offset() const
Definition: DDDivision.cc:81
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:798
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
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:37
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
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 DDDividedConsZ::makeDDRotation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 228 of file DDDividedCons.cc.

229 {
230  DDRotation myddrot; // sets to identity.
231  return myddrot;
232 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDTranslation DDDividedConsZ::makeDDTranslation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 235 of file DDDividedCons.cc.

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

236 {
237  DDTranslation translation;
238 
239  DDCons motherCons = (DDCons)(div_.parent().solid());
240  double posi = - motherCons.zhalf() + div_.offset()
241  + compWidth_/2 + copyNo*compWidth_;
242  translation.SetZ(posi);
243 
244  return translation;
245 }
double zhalf(void) const
Definition: DDSolid.cc:465
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
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86