CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyhedraZ Class Referencefinal

#include <DDDividedPolyhedra.h>

Inheritance diagram for DDDividedPolyhedraZ:
DDDividedGeometryObject

Public Member Functions

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

Detailed Description

Definition at line 54 of file DDDividedPolyhedra.h.

Constructor & Destructor Documentation

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

Definition at line 262 of file DDDividedPolyhedra.cc.

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

263  : DDDividedGeometryObject( div, cpv )
264 {
266  setType( "DivisionPolyhedraZ" );
267 
268  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
269 
270  std::vector<double> zvec = msol.zVec();
271 
272  if ( divisionType_ == DivWIDTH )
273  {
274  compNDiv_ =
275  calculateNDiv( zvec[zvec.size() - 1] - zvec[0], div_.width(), div_.offset() );
276  }
277  else if( divisionType_ == DivNDIV )
278  {
279  compWidth_ = calculateWidth( zvec[zvec.size() - 1] - zvec[0],
280  div_.nReplicas(),
281  div_.offset());
282  // ?what? CalculateNDiv( zvec[zvec.size() - 1] - zvec[0], origparamMother->Z_values[origparamMother->Num_z_planes-1]
283  // - origparamMother->Z_values[0] , nDiv, offset );
284  }
285 }
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() override
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
std::vector< double > zVec(void) const
Definition: DDSolid.cc:433
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

void DDDividedPolyhedraZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 297 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::compNDiv_, gather_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, Exception, DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, and DDPolyhedra::zVec().

Referenced by DDDividedPolyhedraZ().

298 {
300 
301  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
302 
304  {
305  std::cout << "WARNING - "
306  << "DDDividedPolyhedraZ::checkParametersValidity()"
307  << std::endl
308  << " Solid " << msol << std::endl
309  << " Division along Z will be done splitting "
310  << "in the defined z_planes." << std::endl
311  << " WIDTH will not be used !" << std::endl;
312  }
313 
314  if( div_.offset() != 0. )
315  {
316  std::cout << "WARNING - "
317  << "DDDividedPolyhedraZ::checkParametersValidity()"
318  << std::endl
319  << " Solid " << msol << std::endl
320  << " Division along Z will be done splitting "
321  << "in the defined z_planes." << std::endl
322  << " OFFSET will not be used !" << std::endl;
323  }
324 
325  std::vector<double> zvec = msol.zVec();
326 
327  if ( zvec.size() - 1 != size_t(compNDiv_) )
328  {
329  std::cout << "ERROR - "
330  << "DDDividedPolyhedraZ::checkParametersValidity()"
331  << std::endl
332  << " Division along Z can only be done by splitting in the defined"
333  << std::endl
334  << " z_planes, i.e, the number of division would be :"
335  << " " << zvec.size() - 1
336  << " instead of " << compNDiv_ << " !"
337  << std::endl;
338  std::string s = "DDDividedPolyhedraZ::checkParametersValidity()";
339  s += "Illegal Construct. Not a supported configuration.";
340  throw cms::Exception("DDException") << s;
341  }
342 }
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.
virtual void checkParametersValidity(void)
std::vector< double > zVec(void) const
Definition: DDSolid.cc:433
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
double DDDividedPolyhedraZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 288 of file DDDividedPolyhedra.cc.

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

289 {
290  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
291 
292  std::vector<double> zvec = msol.zVec();
293  return (zvec[zvec.size() - 1] - zvec[0]);
294 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > zVec(void) const
Definition: DDSolid.cc:433
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedPolyhedraZ::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 365 of file DDDividedPolyhedra.cc.

References DDBase< N, C >::ddname(), DDPolyhedra::deltaPhi(), DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::parent(), DDSolidFactory::polyhedra(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDPolyhedra::sides(), DDLogicalPart::solid(), DDPolyhedra::startPhi(), and DDPolyhedra::zVec().

366 {
367  // only for mother number of planes = 2!!
368  // mec: what? why? comment above and = 2 below straight from G4 impl.
369  DDPolyhedra msol = (DDPolyhedra)( div_.parent().solid());
370  DDMaterial usemat = div_.parent().material();
371 
372  std::vector<double> zvec = msol.zVec();
373  std::vector<double> rminvec = msol.rMinVec();
374  std::vector<double> rmaxvec = msol.rMaxVec();
375 
376  double posi = ( zvec[ copyNo ] + zvec[ copyNo + 1 ] ) / 2.0;
377 
378  DDName solname( div_.parent().ddname().name() + "_DIVCHILD" + std::to_string( copyNo ),
379  div_.parent().ddname().ns());
380  std::vector<double> newRmin, newRmax, newZ;
381  newZ.push_back( zvec[ copyNo ] - posi );
382  newZ.push_back( zvec[ copyNo + 1 ] - posi );
383  newRmin.push_back( rminvec[ copyNo ]);
384  newRmin.push_back( rminvec[ copyNo + 1 ]);
385  newRmax.push_back( rmaxvec[ copyNo ]);
386  newRmax.push_back( rmaxvec[ copyNo + 1 ]);
387 
388  DDSolid dsol = DDSolidFactory::polyhedra( solname,
389  msol.sides(),
390  msol.startPhi(),
391  msol.deltaPhi(),
392  newZ,
393  newRmin,
394  newRmax );
395  DDLogicalPart lp( solname, usemat, dsol );
396  return lp;
397 }
double startPhi(void) const
Definition: DDSolid.cc:422
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:447
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: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
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:440
int sides(void) const
Definition: DDSolid.cc:420
std::vector< double > zVec(void) const
Definition: DDSolid.cc:433
double deltaPhi(void) const
Definition: DDSolid.cc:424
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
static DDSolid polyhedra(const DDName &name, int sides, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polyhedra (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:708
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 DDDividedPolyhedraZ::makeDDRotation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 359 of file DDDividedPolyhedra.cc.

360 {
361  return DDRotation();
362 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDTranslation DDDividedPolyhedraZ::makeDDTranslation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 345 of file DDDividedPolyhedra.cc.

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

346 {
347  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
348  std::vector<double> zvec = msol.zVec();
349 
350  //----- set translation: along Z axis
351  double posi = (zvec[copyNo] + zvec[copyNo+1])/2;
352 
353  DDTranslation tr(0,0,posi);
354  //----- calculate rotation matrix: unit
355  return tr;
356 }
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
std::vector< double > zVec(void) const
Definition: DDSolid.cc:433
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86