CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyconeZ Class Referencefinal

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeZ:
DDDividedGeometryObject

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 237 of file DDDividedPolycone.cc.

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

239 {
241  DDPolycone msol = (DDPolycone)(div_.parent().solid());
242  std::vector<double> localrMaxVec = msol.rMaxVec();
243  std::vector<double> localrMinVec = msol.rMinVec();
244  std::vector<double> localzVec = msol.zVec();
245 
246  if( divisionType_ == DivWIDTH )
247  {
248  compNDiv_ =
249  calculateNDiv( localzVec[localzVec.size() - 1]
250  - localzVec[0] , div_.width(), div_.offset() );
251  }
252  else if( divisionType_ == DivNDIV )
253  {
254  compWidth_ =
255  calculateNDiv( localzVec[localzVec.size()-1]
256  - localzVec[0] , div_.nReplicas(), div_.offset() );
257  }
258 }
int nReplicas() const
Definition: DDDivision.cc:71
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:379
double offset() const
Definition: DDDivision.cc:81
int calculateNDiv(double motherDim, double width, 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)
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:371
void checkParametersValidity() override
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363

Member Function Documentation

void DDDividedPolyconeZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 261 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::div_, Exception, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDDivision::width(), and DDPolycone::zVec().

Referenced by DDDividedPolyconeZ().

262 {
264 
265  DDPolycone msol = (DDPolycone)(div_.parent().solid());
266  std::vector<double> localzVec = msol.zVec();
267  // CHANGE FROM G4 a polycone can be divided in Z by specifying
268  // nReplicas IF they happen to coincide with the number of
269  // z plans.
270  size_t tempNDiv = div_.nReplicas();
271  if (tempNDiv == 0)
272  tempNDiv = calculateNDiv( localzVec[localzVec.size() - 1] - localzVec[0]
273  , div_.width()
274  , div_.offset() );
275  if ((msol.zVec().size() - 1) != tempNDiv)
276  {
277  std::string s = "ERROR - DDDividedPolyconeZ::checkParametersValidity()";
278  s += "\n\tDivision along Z will be done splitting in the defined";
279  s += "\n\tz_planes, i.e, the number of division would be :";
280  s += "\n\t" + std::to_string( msol.zVec().size() - 1 );
281  s += "\n\tinstead of " + std::to_string(tempNDiv) + " !\n";
282 
283  throw cms::Exception("DDException") << s;
284  }
285 }
int nReplicas() const
Definition: DDDivision.cc:71
double offset() const
Definition: DDDivision.cc:81
int calculateNDiv(double motherDim, double width, double offset) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
virtual void checkParametersValidity(void)
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363
double DDDividedPolyconeZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 288 of file DDDividedPolycone.cc.

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

289 {
290  DDPolycone msol = (DDPolycone)(div_.parent().solid());
291  std::vector<double> localzVec = msol.zVec();
292 
293  return (localzVec[ localzVec.size() - 1] - localzVec[0]);
294 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363
DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 315 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::parent(), DDPolycone::rMaxVec(), and DDLogicalPart::solid().

316 {
317  DDName solname;
318  DDSolid ddpolycone;
319  DDMaterial usemat(div_.parent().material());
320 
321  DDPolycone msol = (DDPolycone)(div_.parent().solid());
322  std::vector<double> localrMaxVec = msol.rMaxVec();
323  std::vector<double> localrMinVec = msol.rMinVec();
324  std::vector<double> localzVec = msol.zVec();
325 
326  solname = DDName( div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo),
327  div_.parent().ddname().ns());
328  ddpolycone = DDSolidFactory::cons( solname,
329  compWidth_ / 2,
330  localrMinVec[copyNo],
331  localrMaxVec[copyNo],
332  localrMinVec[copyNo+1],
333  localrMaxVec[copyNo+1],
334  msol.startPhi(),
335  msol.deltaPhi());
336 
337  DDLogicalPart ddlp = DDLogicalPart( solname, usemat, ddpolycone );
338 
339  return ddlp;
340 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:379
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:836
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:102
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:88
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 DDDividedPolyconeZ::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 297 of file DDDividedPolycone.cc.

298 {
299  DDRotation myddrot; // sets to identity.
300  return myddrot;
301 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
DDTranslation DDDividedPolyconeZ::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 304 of file DDDividedPolycone.cc.

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

305 {
306  DDTranslation translation;
307  DDPolycone msol = (DDPolycone)(div_.parent().solid());
308  std::vector<double> localzVec = msol.zVec();
309  double posi = (localzVec[copyNo] + localzVec[copyNo+1]) / 2;
310  translation.SetZ(posi);
311  return translation;
312 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
std::vector< double > zVec(void) const
Definition: DDSolid.cc:363