CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
DDDividedPolyconeZ Class Referencefinal

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeZ:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity () override
 
 DDDividedPolyconeZ (const DDDivision &div, DDCompactView *cpv)
 
virtual double getMaxParameter () const override
 
virtual DDLogicalPart makeDDLogicalPart (const int copyNo) const override
 
virtual DDRotation makeDDRotation (const int copyNo) const override
 
virtual DDTranslation makeDDTranslation (const 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 46 of file DDDividedPolycone.h.

Constructor & Destructor Documentation

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

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

240 {
242  DDPolycone msol = (DDPolycone)(div_.parent().solid());
243  std::vector<double> localrMaxVec = msol.rMaxVec();
244  std::vector<double> localrMinVec = msol.rMinVec();
245  std::vector<double> localzVec = msol.zVec();
246 
247  if( divisionType_ == DivWIDTH )
248  {
249  compNDiv_ =
250  calculateNDiv( localzVec[localzVec.size() - 1]
251  - localzVec[0] , div_.width(), div_.offset() );
252  }
253  else if( divisionType_ == DivNDIV )
254  {
255  compWidth_ =
256  calculateNDiv( localzVec[localzVec.size()-1]
257  - localzVec[0] , div_.nReplicas(), div_.offset() );
258  }
259 }
int nReplicas() const
Definition: DDDivision.cc:71
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:400
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:393
virtual 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:386

Member Function Documentation

void DDDividedPolyconeZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

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

263 {
265 
266  DDPolycone msol = (DDPolycone)(div_.parent().solid());
267  std::vector<double> localzVec = msol.zVec();
268  // CHANGE FROM G4 a polycone can be divided in Z by specifying
269  // nReplicas IF they happen to coincide with the number of
270  // z plans.
271  size_t tempNDiv = div_.nReplicas();
272  if (tempNDiv == 0)
273  tempNDiv = calculateNDiv( localzVec[localzVec.size() - 1] - localzVec[0]
274  , div_.width()
275  , div_.offset() );
276  if ((msol.zVec().size() - 1) != tempNDiv)
277  {
278  std::string s = "ERROR - DDDividedPolyconeZ::checkParametersValidity()";
279  s += "\n\tDivision along Z will be done splitting in the defined";
280  s += "\n\tz_planes, i.e, the number of division would be :";
281  s += "\n\t" + std::to_string( msol.zVec().size() - 1 );
282  s += "\n\tinstead of " + std::to_string(tempNDiv) + " !\n";
283 
284  throw cms::Exception("DDException") << s;
285  }
286 }
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:386
double DDDividedPolyconeZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 289 of file DDDividedPolycone.cc.

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

290 {
291  DDPolycone msol = (DDPolycone)(div_.parent().solid());
292  std::vector<double> localzVec = msol.zVec();
293 
294  return (localzVec[ localzVec.size() - 1] - localzVec[0]);
295 }
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:386
DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

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

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

Reimplemented from DDDividedGeometryObject.

Definition at line 298 of file DDDividedPolycone.cc.

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

Reimplemented from DDDividedGeometryObject.

Definition at line 305 of file DDDividedPolycone.cc.

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

306 {
307  DDTranslation translation;
308  DDPolycone msol = (DDPolycone)(div_.parent().solid());
309  std::vector<double> localzVec = msol.zVec();
310  double posi = (localzVec[copyNo] + localzVec[copyNo+1]) / 2;
311  translation.SetZ(posi);
312  return translation;
313 }
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:386