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

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

Constructor & Destructor Documentation

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

Definition at line 22 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().

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

46 {
48 
49  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
50 
52  {
53  std::cout << "WARNING - "
54  << "DDDividedPolyhedraRho::checkParametersValidity()"
55  << std::endl
56  << " Solid " << msol << std::endl
57  << " Division along R will be done with a width "
58  << "different for each solid section." << std::endl
59  << " WIDTH will not be used !" << std::endl;
60  }
61  if( div_.offset() != 0. )
62  {
63  std::cout << "WARNING - "
64  << "DDDividedPolyhedraRho::checkParametersValidity()"
65  << std::endl
66  << " Solid " << msol << std::endl
67  << " Division along R will be done with a width "
68  << "different for each solid section." << std::endl
69  << " OFFSET will not be used !" << std::endl;
70  }
71 }
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 74 of file DDDividedPolyhedra.cc.

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

75 {
76  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
77  return msol.rMaxVec()[0] - msol.rMinVec()[0];
78 }
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:430
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:422
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedPolyhedraRho::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 93 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().

94 {
95  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
96  DDMaterial usemat = div_.parent().material();
97 
98  std::vector<double> localrMaxVec = msol.rMaxVec();
99  std::vector<double> localrMinVec = msol.rMinVec();
100  std::vector<double> localzVec = msol.zVec();
101  std::vector<double> newrMinVec;
102  std::vector<double> newrMaxVec;
103  int nZplanes = localzVec.size();
104 
105  double width = 0.;
106  for(int ii = 0; ii < nZplanes; ++ii)
107  {
108  // width = CalculateWidth( origparamMother->Rmax[ii]
109  // - origparamMother->Rmin[ii], compNDiv_, foffset );
110  // origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
111  // origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
112  width = calculateWidth(localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset());
113  newrMinVec[ii] = localrMinVec[ii] + div_.offset() + width * copyNo;
114  newrMaxVec[ii] = localrMaxVec[ii] + div_.offset() + width * (copyNo + 1);
115  }
116 
117  // phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
118  // phedra.Reset(); // reset to new solid parameters
119 
120  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo),
121  div_.parent().ddname().ns());
122 
123  DDSolid dsol = DDSolidFactory::polyhedra(solname
124  , msol.sides()
125  , msol.startPhi()
126  , msol.deltaPhi()
127  , localzVec
128  , newrMinVec
129  , newrMaxVec);
130  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, dsol);
131  return ddlp;
132 }
double startPhi(void) const
Definition: DDSolid.cc:400
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:430
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:102
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:422
ii
Definition: cuy.py:589
int sides(void) const
Definition: DDSolid.cc:397
std::vector< double > zVec(void) const
Definition: DDSolid.cc:414
double deltaPhi(void) const
Definition: DDSolid.cc:403
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:88
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:732
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 ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 87 of file DDDividedPolyhedra.cc.

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

Reimplemented from DDDividedGeometryObject.

Definition at line 81 of file DDDividedPolyhedra.cc.

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