CMS 3D CMS Logo

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

#include <DDDividedTrd.h>

Inheritance diagram for DDDividedTrdZ:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity ()
 
 DDDividedTrdZ (const DDDivision &div, DDCompactView *cpv)
 
virtual double getMaxParameter () const
 
virtual DDLogicalPart makeDDLogicalPart (const int copyNo) const
 
virtual DDRotation makeDDRotation (const int copyNo) const
 
virtual DDTranslation makeDDTranslation (const int copyNo) const
 
virtual ~DDDividedTrdZ ()
 
- 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)
 

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 53 of file DDDividedTrd.h.

Constructor & Destructor Documentation

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

Definition at line 315 of file DDDividedTrd.cc.

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

316  : DDDividedGeometryObject( div, cpv )
317 {
319  setType( "DivTrdZ" );
320  DDTrap mtrd = (DDTrap)(div_.parent().solid());
321 
322  if ( divisionType_ == DivWIDTH )
323  {
324  compNDiv_ = calculateNDiv( 2*mtrd.halfZ(), div_.width(), div_.offset() );
325  }
326  else if( divisionType_ == DivNDIV )
327  {
329  }
330  DCOUT_V ('P', " DDDividedTrdY no divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << "\n width " << compWidth_ << " = " << div_.width() << std::endl);
331 }
double halfZ() const
half of the z-Axis
Definition: DDSolid.cc:170
const int nReplicas() const
Definition: DDDivision.cc:90
int calculateNDiv(double motherDim, double width, double offset) const
double calculateWidth(double motherDim, int nDiv, double offset) const
virtual void checkParametersValidity()
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
Interface to a Trapezoid.
Definition: DDSolid.h:115
virtual void setType(const std::string &type)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const double width() const
Definition: DDDivision.cc:95
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const double offset() const
Definition: DDDivision.cc:100
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDDividedTrdZ::~DDDividedTrdZ ( void  )
virtual

Definition at line 333 of file DDDividedTrd.cc.

334 {}

Member Function Documentation

void DDDividedTrdZ::checkParametersValidity ( void  )
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 423 of file DDDividedTrd.cc.

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

Referenced by DDDividedTrdZ().

424 {
426 
427  DDTrap mtrd = (DDTrap)(div_.parent().solid());
428 
429  double mpTheta = mtrd.theta();
430  double mpPhi = mtrd.phi();
431  double mpAlpha1 = mtrd.alpha1();
432  double mpAlpha2 = mtrd.alpha2();
433 
434  // mec: we only have traps, not trds in DDD, so I added this check
435  // to make sure it is only a trd (I think! :-))
436  if (mpAlpha1 != 0.*deg || mpAlpha2 != 0.*deg || mpTheta != 0.*deg || mpPhi != 0.*deg)
437  {
438  std::string s = "ERROR - DDDividedTrdZ::checkParametersValidity()";
439  s+= "\n Making a division of a TRD along axis X,";
440  s+= "\n while the theta, phi and aplhpa2 are not zero,";
441  s+= "\n is not (yet) supported. It will result";
442  s+= "\n in non-equal division solids.";
443  throw DDException(s);
444  }
445 }
double alpha1() 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:182
An exception for DDD errors.
Definition: DDException.h:23
double alpha2() 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:190
virtual void checkParametersValidity(void)
double phi() const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:174
double theta() const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:172
Interface to a Trapezoid.
Definition: DDSolid.h:115
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
string s
Definition: asciidump.py:422
double DDDividedTrdZ::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 337 of file DDDividedTrd.cc.

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

338 {
339  DDTrap mtrd = (DDTrap)(div_.parent().solid());
340  return 2 * mtrd.halfZ();
341 }
double halfZ() const
half of the z-Axis
Definition: DDSolid.cc:170
Interface to a Trapezoid.
Definition: DDSolid.h:115
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDLogicalPart DDDividedTrdZ::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 379 of file DDDividedTrd.cc.

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

380 {
381  //---- The division along Z of a Trd will result a Trd
382  DDTrap mtrd = (DDTrap)(div_.parent().solid());
383  DDMaterial usemat = div_.parent().material();
384 
385  double pDx1 = mtrd.x1(); //->GetXHalfLength1();
386  //(mtrd->GetXHalfLength2() - mtrd->GetXHalfLength1() );
387  double DDx = (mtrd.x2() - mtrd.x1() );
388  double pDy1 = mtrd.y1(); // ->GetYHalfLength1();
389  //(mtrd->GetYHalfLength2() - mtrd->GetYHalfLength1() );
390  double DDy = (mtrd.y2() - mtrd.y1() );
391  double pDz = compWidth_/2.;
392  double zLength = 2*mtrd.halfZ(); //->GetZHalfLength();
393 
394  // trd.SetAllParameters ( pDx1+DDx*(div_.offset()+copyNo*compWidth_)/zLength,
395  // pDx1+DDx*(div_.offset()+(copyNo+1)*compWidth_)/zLength,
396  // pDy1+DDy*(div_.offset()+copyNo*compWidth_)/zLength,
397  // pDy1+DDy*(div_.offset()+(copyNo+1)*compWidth_)/zLength, pDz );
398 
399  DDName solname(div_.parent().ddname().name() + "_DIVCHILD"
400  + DDXMLElement::itostr(copyNo)
401  , div_.parent().ddname().ns());
402  DDSolid dsol =
403  DDSolidFactory::trap(solname
404  , pDz
405  , 0.*deg
406  , 0.*deg
407  , pDy1+DDy*(div_.offset()+copyNo*compWidth_)/zLength
408  , pDx1+DDx*(div_.offset()+copyNo*compWidth_)/zLength
409  , pDx1+DDx*(div_.offset()+copyNo*compWidth_)/zLength
410  , 0.*deg
411  , pDy1+DDy*(div_.offset()+(copyNo+1)*compWidth_)/zLength
412  , pDx1+DDx*(div_.offset()+(copyNo+1)*compWidth_)/zLength
413  , pDx1+DDx*(div_.offset()+(copyNo+1)*compWidth_)/zLength
414  , 0*deg
415  );
416 
417  DDLogicalPart ddlp(solname, usemat, dsol);
418  DCOUT_V ('P', "DDDividedTrdZ::makeDDLogicalPart lp = " << ddlp);
419  return ddlp;
420 }
double halfZ() const
half of the z-Axis
Definition: DDSolid.cc:170
double y2() const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:184
double x2() const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:180
static std::string itostr(int i)
WARNING: abused by other classes in this system: yet another conversion from int to std::string...
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:101
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
const DDMaterial & material() const
Returns a reference object of the material this LogicalPart is made of.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:42
Interface to a Trapezoid.
Definition: DDSolid.h:115
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:95
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:726
double y1() const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:176
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const double offset() const
Definition: DDDivision.cc:100
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
double x1() const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:178
const N & ddname() const
Definition: DDBase.h:90
DDRotation DDDividedTrdZ::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 373 of file DDDividedTrd.cc.

374 {
375  return DDRotation();
376 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDTranslation DDDividedTrdZ::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 344 of file DDDividedTrd.cc.

References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDTrap::halfZ(), DDAxesNames::name(), DDDivision::offset(), DDDivision::parent(), asciidump::s, DDLogicalPart::solid(), and detailsBasic3DVector::z.

345 {
346  DDTrap mtrd = (DDTrap)(div_.parent().solid() );
347  double mdz = mtrd.halfZ();
348 
349  //----- translation
350  double posi = -mdz + div_.offset() + (copyNo+0.5)*compWidth_;
351 
352  DCOUT_V ('P', " DDDividedTrdZ: " << copyNo << "\n Position: z=" << posi << " Axis= " << DDAxesNames::name(div_.axis()) << "\n");
353 
354  if( div_.axis() == z )
355  {
356  return DDTranslation(0.0, 0.0, posi);
357  }
358  else
359  {
360  std::string s = "ERROR - DDDividedTrdZ::makeDDTranslation()";
361  s += "\n Axis is along ";
362  s += DDAxesNames::name(div_.axis());
363  s += " !\n" ;
364  s += "DDDividedTrdY::makeDDTranslation()";
365  s += " IllegalConstruct: Only axes along z are allowed !";
366  throw DDException(s);
367 
368  }
369  return DDTranslation();
370 }
double halfZ() const
half of the z-Axis
Definition: DDSolid.cc:170
const DDAxes axis() const
Definition: DDDivision.cc:85
An exception for DDD errors.
Definition: DDException.h:23
double double double z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Interface to a Trapezoid.
Definition: DDSolid.h:115
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const double offset() const
Definition: DDDivision.cc:100
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
string s
Definition: asciidump.py:422
static const std::string name(const DDAxes &s)
Definition: DDAxes.cc:37