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

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

Constructor & Destructor Documentation

◆ DDDividedPolyhedraZ()

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

Member Function Documentation

◆ checkParametersValidity()

void DDDividedPolyhedraZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 215 of file DDDividedPolyhedra.cc.

215  {
217 
218  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
219 
221  std::cout << "WARNING - "
222  << "DDDividedPolyhedraZ::checkParametersValidity()" << std::endl
223  << " Solid " << msol << std::endl
224  << " Division along Z will be done splitting "
225  << "in the defined z_planes." << std::endl
226  << " WIDTH will not be used !" << std::endl;
227  }
228 
229  if (div_.offset() != 0.) {
230  std::cout << "WARNING - "
231  << "DDDividedPolyhedraZ::checkParametersValidity()" << std::endl
232  << " Solid " << msol << std::endl
233  << " Division along Z will be done splitting "
234  << "in the defined z_planes." << std::endl
235  << " OFFSET will not be used !" << std::endl;
236  }
237 
238  std::vector<double> zvec = msol.zVec();
239 
240  if (zvec.size() - 1 != size_t(compNDiv_)) {
241  std::cout << "ERROR - "
242  << "DDDividedPolyhedraZ::checkParametersValidity()" << std::endl
243  << " Division along Z can only be done by splitting in the defined" << std::endl
244  << " z_planes, i.e, the number of division would be :"
245  << " " << zvec.size() - 1 << " instead of " << compNDiv_ << " !" << std::endl;
246  std::string s = "DDDividedPolyhedraZ::checkParametersValidity()";
247  s += "Illegal Construct. Not a supported configuration.";
248  throw cms::Exception("DDException") << s;
249  }
250 }

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().

◆ getMaxParameter()

double DDDividedPolyhedraZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 208 of file DDDividedPolyhedra.cc.

208  {
209  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
210 
211  std::vector<double> zvec = msol.zVec();
212  return (zvec[zvec.size() - 1] - zvec[0]);
213 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedPolyhedraZ::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 266 of file DDDividedPolyhedra.cc.

266  {
267  // only for mother number of planes = 2!!
268  // mec: what? why? comment above and = 2 below straight from G4 impl.
269  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
270  DDMaterial usemat = div_.parent().material();
271 
272  std::vector<double> zvec = msol.zVec();
273  std::vector<double> rminvec = msol.rMinVec();
274  std::vector<double> rmaxvec = msol.rMaxVec();
275 
276  double posi = (zvec[copyNo] + zvec[copyNo + 1]) / 2.0;
277 
278  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), div_.parent().ddname().ns());
279  std::vector<double> newRmin, newRmax, newZ;
280  newZ.emplace_back(zvec[copyNo] - posi);
281  newZ.emplace_back(zvec[copyNo + 1] - posi);
282  newRmin.emplace_back(rminvec[copyNo]);
283  newRmin.emplace_back(rminvec[copyNo + 1]);
284  newRmax.emplace_back(rmaxvec[copyNo]);
285  newRmax.emplace_back(rmaxvec[copyNo + 1]);
286 
287  DDSolid dsol =
288  DDSolidFactory::polyhedra(solname, msol.sides(), msol.startPhi(), msol.deltaPhi(), newZ, newRmin, newRmax);
289  DDLogicalPart lp(solname, usemat, dsol);
290  return lp;
291 }

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().

◆ makeDDRotation()

DDRotation DDDividedPolyhedraZ::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 264 of file DDDividedPolyhedra.cc.

264 { return DDRotation(); }

◆ makeDDTranslation()

DDTranslation DDDividedPolyhedraZ::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 252 of file DDDividedPolyhedra.cc.

252  {
253  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
254  std::vector<double> zvec = msol.zVec();
255 
256  //----- set translation: along Z axis
257  double posi = (zvec[copyNo] + zvec[copyNo + 1]) / 2;
258 
259  DDTranslation tr(0, 0, posi);
260  //----- calculate rotation matrix: unit
261  return tr;
262 }

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

DDDividedGeometryObject::compWidth_
double compWidth_
Definition: DDDividedGeometryObject.h:56
DDPolyhedra::rMaxVec
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:338
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
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::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
DDDividedPolyhedraZ::checkParametersValidity
void checkParametersValidity() override
Definition: DDDividedPolyhedra.cc:215
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:246
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
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
DDRotation
ROOT::Math::Rotation3D DDRotation
Definition: DDEcalEndcapAlgo.cc:18
DDDividedGeometryObject::calculateWidth
double calculateWidth(double motherDim, int nDiv, double offset) const
Definition: DDDividedGeometryObject.cc:37