CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyconeRho Class Referencefinal

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeRho:
DDDividedGeometryObject

Public Member Functions

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

Constructor & Destructor Documentation

◆ DDDividedPolyconeRho()

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

Definition at line 23 of file DDDividedPolycone.cc.

26  DDPolycone msol = (DDPolycone)(div_.parent().solid());
27  std::vector<double> localrMaxVec = msol.rMaxVec();
28  std::vector<double> localrMinVec = msol.rMinVec();
29 
30  setType("DivisionPolyconeRho");
31 
32  // in DDD we only have ONE representation
33  // in the case when rMinVec and rMaxVec
34  // are empty rVec and zVec are the r and z std::vectors.
35 
36  if (divisionType_ == DivWIDTH) {
37  compNDiv_ = calculateNDiv(localrMaxVec[0] - localrMinVec[0], div_.width(), div_.offset());
38  } else if (divisionType_ == DivNDIV) {
39  compWidth_ = calculateWidth(localrMaxVec[0] - localrMinVec[0], div_.nReplicas(), div_.offset());
40  }
41 }

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

Member Function Documentation

◆ checkParametersValidity()

void DDDividedPolyconeRho::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 43 of file DDDividedPolycone.cc.

43  {
45 
46  DDPolycone msol = (DDPolycone)(div_.parent().solid());
47 
49  std::cout << "WARNING - "
50  << "DDDividedPolyconeRho::checkParametersValidity()" << std::endl
51  << " Solid " << msol << std::endl
52  << " Division along r will be done with a width "
53  << "different for each solid section." << std::endl
54  << " WIDTH will not be used !" << std::endl;
55  }
56  if (div_.offset() != 0.) {
57  std::cout << "WARNING - "
58  << "DDDividedPolyconeRho::checkParametersValidity()" << std::endl
59  << " Solid " << msol << std::endl
60  << " Division along R will be done with a width "
61  << "different for each solid section." << std::endl
62  << " OFFSET will not be used !" << std::endl;
63  }
64 }

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

Referenced by DDDividedPolyconeRho().

◆ getMaxParameter()

double DDDividedPolyconeRho::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 66 of file DDDividedPolycone.cc.

66  {
67  DDPolycone msol = (DDPolycone)(div_.parent().solid());
68  std::vector<double> localrMaxVec = msol.rMaxVec();
69  std::vector<double> localrMinVec = msol.rMinVec();
70 
71  return localrMaxVec[0] - localrMinVec[0];
72 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedPolyconeRho::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 84 of file DDDividedPolycone.cc.

84  {
86  DDMaterial usemat(div_.parent().material());
87 
88  DDPolycone msol = (DDPolycone)(div_.parent().solid());
89  std::vector<double> localrMaxVec = msol.rMaxVec();
90  std::vector<double> localrMinVec = msol.rMinVec();
91  std::vector<double> localzVec = msol.zVec();
92 
93  int nZplanes = localzVec.size();
94 
95  std::vector<double> newrMinVec;
96  std::vector<double> newrMaxVec;
97 
98  double width = 0.;
99  for (int ii = 0; ii < nZplanes; ++ii) {
100  width = calculateWidth(localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset());
101  newrMinVec.emplace_back(localrMinVec[ii] + div_.offset() + width * copyNo);
102  newrMaxVec.emplace_back(localrMinVec[ii] + div_.offset() + width * (copyNo + 1));
103  }
104  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), div_.parent().ddname().ns());
105 
106  ddpolycone = DDSolidFactory::polycone(solname, msol.startPhi(), msol.deltaPhi(), localzVec, newrMinVec, newrMaxVec);
107 
108  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddpolycone);
109  return ddlp;
110 }

References DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::compNDiv_, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, cuy::ii, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polycone(), DDPolycone::rMaxVec(), DDLogicalPart::solid(), and ApeEstimator_cff::width.

◆ makeDDRotation()

DDRotation DDDividedPolyconeRho::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 74 of file DDDividedPolycone.cc.

74  {
75  DDRotation myddrot; // sets to identity.
76  return myddrot;
77 }

◆ makeDDTranslation()

DDTranslation DDDividedPolyconeRho::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 79 of file DDDividedPolycone.cc.

79  {
80  DDTranslation translation;
81  return translation;
82 }
DDDividedGeometryObject::compWidth_
double compWidth_
Definition: DDDividedGeometryObject.h:56
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
DDDivision::width
double width() const
Definition: DDDivision.cc:53
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DDLogicalPart::material
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
Definition: DDLogicalPart.cc:118
DDDividedGeometryObject::DDDividedGeometryObject
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
Definition: DDDividedGeometryObject.cc:13
DivWIDTH
Definition: DDDividedGeometryObject.h:14
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDDividedGeometryObject::checkParametersValidity
virtual void checkParametersValidity(void)
Definition: DDDividedGeometryObject.cc:41
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DivNDIV
Definition: DDDividedGeometryObject.h:14
DivNDIVandWIDTH
Definition: DDDividedGeometryObject.h:14
DDPolycone::rMaxVec
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:300
DDDividedGeometryObject::calculateNDiv
int calculateNDiv(double motherDim, double width, double offset) const
Definition: DDDividedGeometryObject.cc:33
DDDividedGeometryObject::div_
DDDivision div_
Definition: DDDividedGeometryObject.h:53
DDDividedPolyconeRho::checkParametersValidity
void checkParametersValidity() override
Definition: DDDividedPolycone.cc:43
DDDividedGeometryObject::compNDiv_
int compNDiv_
Definition: DDDividedGeometryObject.h:55
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
cms::DDSolidShape::ddpolycone
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
DDDividedGeometryObject::divisionType_
DivisionType divisionType_
Definition: DDDividedGeometryObject.h:57
DDDividedGeometryObject::setType
virtual void setType(const std::string &type)
Definition: DDDividedGeometryObject.cc:81
DDDivision::offset
double offset() const
Definition: DDDivision.cc:55
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDSolidFactory::polycone
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:551
DDDivision::nReplicas
int nReplicas() const
Definition: DDDivision.cc:51
DDName::ns
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDPolycone
Definition: DDSolid.h:222
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDPolycone::rMinVec
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:293
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
cuy.ii
ii
Definition: cuy.py:589
DDDivision::parent
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
DDDividedGeometryObject::calculateWidth
double calculateWidth(double motherDim, int nDiv, double offset) const
Definition: DDDividedGeometryObject.cc:37