CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyhedraRho Class Referencefinal

#include <DDDividedPolyhedra.h>

Inheritance diagram for DDDividedPolyhedraRho:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity () override
 
 DDDividedPolyhedraRho (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 20 of file DDDividedPolyhedra.h.

Constructor & Destructor Documentation

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

Definition at line 23 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(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().

24  : DDDividedGeometryObject( div, cpv )
25 {
27  setType( "DivisionPolyhedraRho" );
28 
29  DDPolyhedra msol = (DDPolyhedra)( div_.parent().solid() );
30 
31  if( divisionType_ == DivWIDTH )
32  {
33  compNDiv_ = calculateNDiv( msol.rMaxVec()[0] - msol.rMinVec()[0]
34  , div_.width()
35  , div_.offset() );
36  }
37  else if( divisionType_ == DivNDIV )
38  {
39  compWidth_ = calculateWidth( msol.rMaxVec()[0] - msol.rMinVec()[0]
40  , div_.nReplicas()
41  , div_.offset() );
42  }
43 }
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:454
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.
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void checkParametersValidity() override
virtual void setType(const std::string &type)
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:446
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

void DDDividedPolyhedraRho::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 46 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::checkParametersValidity(), gather_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, DDDivision::offset(), DDDivision::parent(), and DDLogicalPart::solid().

Referenced by DDDividedPolyhedraRho().

47 {
49 
50  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
51 
53  {
54  std::cout << "WARNING - "
55  << "DDDividedPolyhedraRho::checkParametersValidity()"
56  << std::endl
57  << " Solid " << msol << std::endl
58  << " Division along R will be done with a width "
59  << "different for each solid section." << std::endl
60  << " WIDTH will not be used !" << std::endl;
61  }
62  if( div_.offset() != 0. )
63  {
64  std::cout << "WARNING - "
65  << "DDDividedPolyhedraRho::checkParametersValidity()"
66  << std::endl
67  << " Solid " << msol << std::endl
68  << " Division along R will be done with a width "
69  << "different for each solid section." << std::endl
70  << " OFFSET will not be used !" << std::endl;
71  }
72 }
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)
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
double DDDividedPolyhedraRho::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 75 of file DDDividedPolyhedra.cc.

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

76 {
77  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
78  return msol.rMaxVec()[0] - msol.rMinVec()[0];
79 }
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:454
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:446
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedPolyhedraRho::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 94 of file DDDividedPolyhedra.cc.

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

95 {
96  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
97  DDMaterial usemat = div_.parent().material();
98 
99  std::vector<double> localrMaxVec = msol.rMaxVec();
100  std::vector<double> localrMinVec = msol.rMinVec();
101  std::vector<double> localzVec = msol.zVec();
102  std::vector<double> newrMinVec;
103  std::vector<double> newrMaxVec;
104  int nZplanes = localzVec.size();
105 
106  double width = 0.;
107  for(int ii = 0; ii < nZplanes; ++ii)
108  {
109  // width = CalculateWidth( origparamMother->Rmax[ii]
110  // - origparamMother->Rmin[ii], compNDiv_, foffset );
111  // origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
112  // origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
113  width = calculateWidth(localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset());
114  newrMinVec[ii] = localrMinVec[ii] + div_.offset() + width * copyNo;
115  newrMaxVec[ii] = localrMaxVec[ii] + div_.offset() + width * (copyNo + 1);
116  }
117 
118  // phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
119  // phedra.Reset(); // reset to new solid parameters
120 
121  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo),
122  div_.parent().ddname().ns());
123 
124  DDSolid dsol = DDSolidFactory::polyhedra(solname
125  , msol.sides()
126  , msol.startPhi()
127  , msol.deltaPhi()
128  , localzVec
129  , newrMinVec
130  , newrMaxVec);
131  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, dsol);
132  return ddlp;
133 }
double startPhi(void) const
Definition: DDSolid.cc:424
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:454
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double offset() const
Definition: DDDivision.cc:81
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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.
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
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:446
ii
Definition: cuy.py:588
int sides(void) const
Definition: DDSolid.cc:421
std::vector< double > zVec(void) const
Definition: DDSolid.cc:438
double deltaPhi(void) const
Definition: DDSolid.cc:427
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:843
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 DDDividedPolyhedraRho::makeDDRotation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 88 of file DDDividedPolyhedra.cc.

89 {
90  return DDRotation();
91 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
DDTranslation DDDividedPolyhedraRho::makeDDTranslation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 82 of file DDDividedPolyhedra.cc.

83 {
84  return DDTranslation();
85 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7