CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedTrdZ Class Referencefinal

#include <DDDividedTrd.h>

Inheritance diagram for DDDividedTrdZ:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity () override
 
 DDDividedTrdZ (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 41 of file DDDividedTrd.h.

Constructor & Destructor Documentation

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

Definition at line 298 of file DDDividedTrd.cc.

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

299  : DDDividedGeometryObject( div, cpv )
300 {
302  setType( "DivTrdZ" );
303  DDTrap mtrd = (DDTrap)(div_.parent().solid());
304 
305  if ( divisionType_ == DivWIDTH )
306  {
307  compNDiv_ = calculateNDiv( 2*mtrd.halfZ(), div_.width(), div_.offset() );
308  }
309  else if( divisionType_ == DivNDIV )
310  {
312  }
313 }
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:161
int nReplicas() const
Definition: DDDivision.cc:71
double offset() const
Definition: DDDivision.cc:81
int calculateNDiv(double motherDim, double width, double offset) const
double calculateWidth(double motherDim, int nDiv, 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)
virtual void checkParametersValidity() override
Interface to a Trapezoid.
Definition: DDSolid.h:79
virtual void setType(const std::string &type)
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

void DDDividedTrdZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 399 of file DDDividedTrd.cc.

References DDTrap::alpha1(), DDTrap::alpha2(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::div_, Exception, DDDivision::parent(), DDTrap::phi(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, and DDTrap::theta().

Referenced by DDDividedTrdZ().

400 {
402 
403  DDTrap mtrd = (DDTrap)(div_.parent().solid());
404 
405  double mpTheta = mtrd.theta();
406  double mpPhi = mtrd.phi();
407  double mpAlpha1 = mtrd.alpha1();
408  double mpAlpha2 = mtrd.alpha2();
409 
410  // mec: we only have traps, not trds in DDD, so I added this check
411  // to make sure it is only a trd (I think! :-))
412  if (mpAlpha1 != 0.*deg || mpAlpha2 != 0.*deg || mpTheta != 0.*deg || mpPhi != 0.*deg)
413  {
414  std::string s = "ERROR - DDDividedTrdZ::checkParametersValidity()";
415  s+= "\n Making a division of a TRD along axis X,";
416  s+= "\n while the theta, phi and aplhpa2 are not zero,";
417  s+= "\n is not (yet) supported. It will result";
418  s+= "\n in non-equal division solids.";
419  throw cms::Exception("DDException") << s;
420  }
421 }
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:167
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
virtual void checkParametersValidity(void)
Interface to a Trapezoid.
Definition: DDSolid.h:79
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
Definition: DDSolid.cc:179
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
Definition: DDSolid.cc:191
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:164
double DDDividedTrdZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 316 of file DDDividedTrd.cc.

References DDDividedGeometryObject::div_, DDTrap::halfZ(), DDDivision::parent(), and DDLogicalPart::solid().

317 {
318  DDTrap mtrd = (DDTrap)(div_.parent().solid());
319  return 2 * mtrd.halfZ();
320 }
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:161
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Interface to a Trapezoid.
Definition: DDSolid.h:79
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedTrdZ::makeDDLogicalPart ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 356 of file DDDividedTrd.cc.

References DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDTrap::halfZ(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), DDSolidFactory::trap(), DDTrap::x1(), DDTrap::x2(), DDTrap::y1(), and DDTrap::y2().

357 {
358  //---- The division along Z of a Trd will result a Trd
359  DDTrap mtrd = (DDTrap)(div_.parent().solid());
360  DDMaterial usemat = div_.parent().material();
361 
362  double pDx1 = mtrd.x1(); //->GetXHalfLength1();
363  //(mtrd->GetXHalfLength2() - mtrd->GetXHalfLength1() );
364  double DDx = (mtrd.x2() - mtrd.x1() );
365  double pDy1 = mtrd.y1(); // ->GetYHalfLength1();
366  //(mtrd->GetYHalfLength2() - mtrd->GetYHalfLength1() );
367  double DDy = (mtrd.y2() - mtrd.y1() );
368  double pDz = compWidth_/2.;
369  double zLength = 2*mtrd.halfZ(); //->GetZHalfLength();
370 
371  // trd.SetAllParameters ( pDx1+DDx*(div_.offset()+copyNo*compWidth_)/zLength,
372  // pDx1+DDx*(div_.offset()+(copyNo+1)*compWidth_)/zLength,
373  // pDy1+DDy*(div_.offset()+copyNo*compWidth_)/zLength,
374  // pDy1+DDy*(div_.offset()+(copyNo+1)*compWidth_)/zLength, pDz );
375 
376  DDName solname(div_.parent().ddname().name() + "_DIVCHILD"
377  + std::to_string(copyNo),
378  div_.parent().ddname().ns());
379  DDSolid dsol =
380  DDSolidFactory::trap(solname
381  , pDz
382  , 0.*deg
383  , 0.*deg
384  , pDy1+DDy*(div_.offset()+copyNo*compWidth_)/zLength
385  , pDx1+DDx*(div_.offset()+copyNo*compWidth_)/zLength
386  , pDx1+DDx*(div_.offset()+copyNo*compWidth_)/zLength
387  , 0.*deg
388  , pDy1+DDy*(div_.offset()+(copyNo+1)*compWidth_)/zLength
389  , pDx1+DDx*(div_.offset()+(copyNo+1)*compWidth_)/zLength
390  , pDx1+DDx*(div_.offset()+(copyNo+1)*compWidth_)/zLength
391  , 0*deg
392  );
393 
394  DDLogicalPart ddlp(solname, usemat, dsol);
395  return ddlp;
396 }
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:161
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:173
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double offset() const
Definition: DDDivision.cc:81
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
Interface to a Trapezoid.
Definition: DDSolid.h:79
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:170
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:794
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:176
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:182
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 DDDividedTrdZ::makeDDRotation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 350 of file DDDividedTrd.cc.

351 {
352  return DDRotation();
353 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:64
DDTranslation DDDividedTrdZ::makeDDTranslation ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 323 of file DDDividedTrd.cc.

References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DDDividedGeometryObject::div_, Exception, DDTrap::halfZ(), DDAxesNames::name(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, and z.

324 {
325  DDTrap mtrd = (DDTrap)(div_.parent().solid() );
326  double mdz = mtrd.halfZ();
327 
328  //----- translation
329  double posi = -mdz + div_.offset() + (copyNo+0.5)*compWidth_;
330 
331  if( div_.axis() == DDAxes::z )
332  {
333  return DDTranslation(0.0, 0.0, posi);
334  }
335  else
336  {
337  std::string s = "ERROR - DDDividedTrdZ::makeDDTranslation()";
338  s += "\n Axis is along ";
339  s += DDAxesNames::name(div_.axis());
340  s += " !\n" ;
341  s += "DDDividedTrdY::makeDDTranslation()";
342  s += " IllegalConstruct: Only axes along z are allowed !";
343  throw cms::Exception("DDException") << s;
344 
345  }
346  return DDTranslation();
347 }
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:161
double offset() const
Definition: DDDivision.cc:81
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
Interface to a Trapezoid.
Definition: DDSolid.h:79
DDAxes axis() const
Definition: DDDivision.cc:66
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
static const std::string name(const DDAxes &s)
Definition: DDAxes.cc:23