CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyhedraPhi Class Referencefinal

#include <DDDividedPolyhedra.h>

Inheritance diagram for DDDividedPolyhedraPhi:
DDDividedGeometryObject

Public Member Functions

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

Constructor & Destructor Documentation

◆ DDDividedPolyhedraPhi()

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

Definition at line 102 of file DDDividedPolyhedra.cc.

103  : DDDividedGeometryObject(div, cpv) {
105  setType("DivisionPolyhedraPhi");
106 
107  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
108 
109  if (divisionType_ == DivWIDTH) {
110  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
111  if (msol.deltaPhi() == 360._deg) {
112  compNDiv_ = calculateNDiv(msol.deltaPhi(), div_.width(), 0.);
113  } else {
115  }
116  } else if (divisionType_ == DivNDIV) {
117  if (msol.deltaPhi() == 360._deg) {
119  } else {
120  // original line looks wrong!
122  }
123  }
124 }

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

Member Function Documentation

◆ checkParametersValidity()

void DDDividedPolyhedraPhi::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 131 of file DDDividedPolyhedra.cc.

131  {
133 
134  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
135 
137  std::cout << "WARNING - "
138  << "DDDividedPolyhedraPhi::checkParametersValidity()" << std::endl
139  << " Solid " << msol << std::endl
140  << " Division along PHI will be done splitting "
141  << "in the defined numSide." << std::endl
142  << " WIDTH will not be used !" << std::endl;
143  }
144  if (div_.offset() != 0.) {
145  std::cout << "WARNING - "
146  << "DDDividedPolyhedraPhi::checkParametersValidity()" << std::endl
147  << " Solid " << msol << std::endl
148  << " Division along PHI will be done splitting "
149  << "in the defined numSide." << std::endl
150  << " OFFSET will not be used !" << std::endl;
151  }
152 
153  if (msol.sides() != compNDiv_) {
154  std::cout << "ERROR - "
155  << "DDDividedPolyhedraPhi::checkParametersValidity()" << std::endl
156  << " Division along PHI will be done splitting in the defined" << std::endl
157  << " numSide, i.e, the number of division would be :"
158  << " " << msol.sides() << " instead of " << compNDiv_ << " !" << std::endl;
159  std::string s = "DDDividedPolyhedraPhi::checkParametersValidity() Not supported configuration.";
160  throw cms::Exception("DDException") << s;
161  }
162 }

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

Referenced by DDDividedPolyhedraPhi().

◆ getMaxParameter()

double DDDividedPolyhedraPhi::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 126 of file DDDividedPolyhedra.cc.

126  {
127  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
128  return msol.deltaPhi(); //msol->GetEndPhi() - msol->GetStartPhi();
129 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedPolyhedraPhi::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 176 of file DDDividedPolyhedra.cc.

176  {
177  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
178  DDMaterial usemat = div_.parent().material();
179 
180  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
181  DDSolid dsol(solname);
182  if (!dsol.isDefined().second) {
184  solname, msol.sides(), msol.startPhi() + div_.offset(), compWidth_, msol.zVec(), msol.rMinVec(), msol.rMaxVec());
185  }
186  DDLogicalPart ddlp(solname);
187  if (!ddlp.isDefined().second)
188  DDLogicalPart ddlp2 = DDLogicalPart(solname, usemat, dsol);
189  return ddlp;
190 }

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

◆ makeDDRotation()

DDRotation DDDividedPolyhedraPhi::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 166 of file DDDividedPolyhedra.cc.

166  {
167  DDRotation myddrot; // sets to identity.
168  double posi = (copyNo - 1) * compWidth_;
169  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + std::to_string(copyNo),
170  div_.parent().ddname().ns());
171  myddrot = DDrot(ddrotname, changeRotMatrix(posi));
172 
173  return myddrot;
174 }

References DDDividedGeometryObject::changeRotMatrix(), DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDrot(), DDDividedGeometryObject::div_, DDName::name(), DDName::ns(), and DDDivision::parent().

◆ makeDDTranslation()

DDTranslation DDDividedPolyhedraPhi::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 164 of file DDDividedPolyhedra.cc.

164 { return DDTranslation(); }
DDDividedGeometryObject::compWidth_
double compWidth_
Definition: DDDividedGeometryObject.h:56
DDPolyhedra::rMaxVec
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:338
DDrot
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
DDDivision::width
double width() const
Definition: DDDivision.cc:53
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDPolyhedra::zVec
std::vector< double > zVec(void) const
Definition: DDSolid.cc:324
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
DDPolyhedra::rMinVec
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:331
DivWIDTH
Definition: DDDividedGeometryObject.h:14
DDDividedPolyhedraPhi::checkParametersValidity
void checkParametersValidity() override
Definition: DDDividedPolyhedra.cc:131
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDDividedGeometryObject::checkParametersValidity
virtual void checkParametersValidity(void)
Definition: DDDividedGeometryObject.cc:41
DDPolyhedra::sides
int sides(void) const
Definition: DDSolid.cc:311
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDSolidFactory::polyhedra
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:551
DivNDIV
Definition: DDDividedGeometryObject.h:14
DivNDIVandWIDTH
Definition: DDDividedGeometryObject.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDDividedGeometryObject::calculateNDiv
int calculateNDiv(double motherDim, double width, double offset) const
Definition: DDDividedGeometryObject.cc:33
DDDividedGeometryObject::div_
DDDivision div_
Definition: DDDividedGeometryObject.h:53
DDDividedGeometryObject::changeRotMatrix
std::unique_ptr< DDRotationMatrix > changeRotMatrix(double rotZ=0.) const
Definition: DDDividedGeometryObject.cc:29
DDDividedGeometryObject::compNDiv_
int compNDiv_
Definition: DDDividedGeometryObject.h:55
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
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
DDDivision::nReplicas
int nReplicas() const
Definition: DDDivision.cc:51
DDPolyhedra
Definition: DDSolid.h:224
DDPolyhedra::deltaPhi
double deltaPhi(void) const
Definition: DDSolid.cc:315
DDName::ns
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52
Exception
Definition: hltDiff.cc:245
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDPolyhedra::startPhi
double startPhi(void) const
Definition: DDSolid.cc:313
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
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