CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyconeZ Class Referencefinal

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeZ:
DDDividedGeometryObject

Public Member Functions

void checkParametersValidity () override
 
 DDDividedPolyconeZ (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 38 of file DDDividedPolycone.h.

Constructor & Destructor Documentation

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

Definition at line 231 of file DDDividedPolycone.cc.

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

233 {
235  DDPolycone msol = (DDPolycone)(div_.parent().solid());
236  std::vector<double> localrMaxVec = msol.rMaxVec();
237  std::vector<double> localrMinVec = msol.rMinVec();
238  std::vector<double> localzVec = msol.zVec();
239 
240  if( divisionType_ == DivWIDTH )
241  {
242  compNDiv_ =
243  calculateNDiv( localzVec[localzVec.size() - 1]
244  - localzVec[0] , div_.width(), div_.offset() );
245  }
246  else if( divisionType_ == DivNDIV )
247  {
248  compWidth_ =
249  calculateNDiv( localzVec[localzVec.size()-1]
250  - localzVec[0] , div_.nReplicas(), div_.offset() );
251  }
252 }
int nReplicas() const
Definition: DDDivision.cc:75
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:379
double offset() const
Definition: DDDivision.cc:87
int calculateNDiv(double motherDim, double width, double offset) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:371
void checkParametersValidity() override
double width() const
Definition: DDDivision.cc:81
const DDLogicalPart & parent() const
Definition: DDDivision.cc:93
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363

Member Function Documentation

void DDDividedPolyconeZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 255 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::div_, Exception, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDDivision::width(), and DDPolycone::zVec().

Referenced by DDDividedPolyconeZ().

256 {
258 
259  DDPolycone msol = (DDPolycone)(div_.parent().solid());
260  std::vector<double> localzVec = msol.zVec();
261  // CHANGE FROM G4 a polycone can be divided in Z by specifying
262  // nReplicas IF they happen to coincide with the number of
263  // z plans.
264  size_t tempNDiv = div_.nReplicas();
265  if (tempNDiv == 0)
266  tempNDiv = calculateNDiv( localzVec[localzVec.size() - 1] - localzVec[0]
267  , div_.width()
268  , div_.offset() );
269  if ((msol.zVec().size() - 1) != tempNDiv)
270  {
271  std::string s = "ERROR - DDDividedPolyconeZ::checkParametersValidity()";
272  s += "\n\tDivision along Z will be done splitting in the defined";
273  s += "\n\tz_planes, i.e, the number of division would be :";
274  s += "\n\t" + std::to_string( msol.zVec().size() - 1 );
275  s += "\n\tinstead of " + std::to_string(tempNDiv) + " !\n";
276 
277  throw cms::Exception("DDException") << s;
278  }
279 }
int nReplicas() const
Definition: DDDivision.cc:75
double offset() const
Definition: DDDivision.cc:87
int calculateNDiv(double motherDim, double width, 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)
double width() const
Definition: DDDivision.cc:81
const DDLogicalPart & parent() const
Definition: DDDivision.cc:93
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363
double DDDividedPolyconeZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 282 of file DDDividedPolycone.cc.

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

283 {
284  DDPolycone msol = (DDPolycone)(div_.parent().solid());
285  std::vector<double> localzVec = msol.zVec();
286 
287  return (localzVec[ localzVec.size() - 1] - localzVec[0]);
288 }
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:93
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363
DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 309 of file DDDividedPolycone.cc.

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

310 {
311  DDSolid ddpolycone;
312  DDMaterial usemat(div_.parent().material());
313 
314  DDPolycone msol = (DDPolycone)(div_.parent().solid());
315  std::vector<double> localrMaxVec = msol.rMaxVec();
316  std::vector<double> localrMinVec = msol.rMinVec();
317  std::vector<double> localzVec = msol.zVec();
318 
319  DDName solname( div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo),
320  div_.parent().ddname().ns());
321  ddpolycone = DDSolidFactory::cons( solname,
322  compWidth_ / 2,
323  localrMinVec[copyNo],
324  localrMaxVec[copyNo],
325  localrMinVec[copyNo+1],
326  localrMaxVec[copyNo+1],
327  msol.startPhi(),
328  msol.deltaPhi());
329 
330  DDLogicalPart ddlp = DDLogicalPart( solname, usemat, ddpolycone );
331 
332  return ddlp;
333 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:379
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:838
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:67
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:39
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const DDLogicalPart & parent() const
Definition: DDDivision.cc:93
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
const N & ddname() const
Definition: DDBase.h:76
DDRotation DDDividedPolyconeZ::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 291 of file DDDividedPolycone.cc.

292 {
293  DDRotation myddrot; // sets to identity.
294  return myddrot;
295 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
DDTranslation DDDividedPolyconeZ::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 298 of file DDDividedPolycone.cc.

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

299 {
300  DDTranslation translation;
301  DDPolycone msol = (DDPolycone)(div_.parent().solid());
302  std::vector<double> localzVec = msol.zVec();
303  double posi = (localzVec[copyNo] + localzVec[copyNo+1]) / 2;
304  translation.SetZ(posi);
305  return translation;
306 }
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:93
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363