CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedTrdX Class Referencefinal

#include <DDDividedTrd.h>

Inheritance diagram for DDDividedTrdX:
DDDividedGeometryObject

Public Member Functions

void checkParametersValidity () override
 
 DDDividedTrdX (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 12 of file DDDividedTrd.h.

Constructor & Destructor Documentation

◆ DDDividedTrdX()

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

Member Function Documentation

◆ checkParametersValidity()

void DDDividedTrdX::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 82 of file DDDividedTrd.cc.

82  {
84 
85  DDTrap mtrd = (DDTrap)(div_.parent().solid());
86 
87  double mpDx1 = mtrd.x1(); // X half length1
88  double mpDx2 = mtrd.x2(); // X half length2
89  double mpDx3 = mtrd.x3();
90  double mpDx4 = mtrd.x4();
91  double mpTheta = mtrd.theta();
92  double mpPhi = mtrd.phi();
93  double mpAlpha1 = mtrd.alpha1();
94  double mpAlpha2 = mtrd.alpha2();
95 
96  if (fabs(mpDx1 - mpDx2) > tolerance() || fabs(mpDx3 - mpDx4) > tolerance() || fabs(mpDx1 - mpDx4) > tolerance()) {
97  std::string s = "ERROR - DDDividedTrdX::checkParametersValidity()";
98  s += "\n Making a division of a TRD along axis X,";
99  s += "\n while the X half lengths are not equal,";
100  s += "\n is not (yet) supported. It will result";
101  s += "\n in non-equal division solids.";
102  throw cms::Exception("DDException") << s;
103  }
104 
105  // mec: we only have traps, not trds in DDD, so I added this check
106  // to make sure it is only a trd (I think! :-))
107  if (mpAlpha1 != 0._deg || mpAlpha2 != 0._deg || mpTheta != 0._deg || mpPhi != 0._deg) {
108  std::string s = "ERROR - DDDividedTrdX::checkParametersValidity()";
109  s += "\n Making a division of a TRD along axis X,";
110  s += "\n while the theta, phi and aplhpa2 are not zero,";
111  s += "\n is not (yet) supported. It will result";
112  s += "\n in non-equal division solids.";
113  throw cms::Exception("DDException") << s;
114  }
115 }

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

Referenced by DDDividedTrdX().

◆ getMaxParameter()

double DDDividedTrdX::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 34 of file DDDividedTrd.cc.

34  {
35  DDTrap mtrd = (DDTrap)(div_.parent().solid());
36  return 2 * mtrd.x1();
37 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedTrdX::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 63 of file DDDividedTrd.cc.

63  {
64  DDTrap mtrd = (DDTrap)(div_.parent().solid());
65  DDMaterial usemat = div_.parent().material();
66 
67  double pDy1 = mtrd.y1(); // Y half length1
68  double pDy2 = mtrd.y2(); // Y half length2
69  double pDz = mtrd.halfZ(); // Z half length
70  double pDx = compWidth_ / 2.;
71 
72  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
73  DDSolid dsol(solname);
74  DDLogicalPart ddlp(solname);
75  if (!dsol.isDefined().second) {
76  dsol = DDSolidFactory::trap(solname, pDz, 0._deg, 0._deg, pDy1, pDx, pDx, 0._deg, pDy2, pDx, pDx, 0._deg);
77  ddlp = DDLogicalPart(solname, usemat, dsol);
78  }
79  return ddlp;
80 }

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

◆ makeDDRotation()

DDRotation DDDividedTrdX::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 61 of file DDDividedTrd.cc.

61 { return DDRotation(); }

◆ makeDDTranslation()

DDTranslation DDDividedTrdX::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 39 of file DDDividedTrd.cc.

39  {
40  DDTrap mtrd = (DDTrap)(div_.parent().solid());
41  double mdx = mtrd.x1();
42 
43  //----- translation
44  double posi = -mdx + div_.offset() + (copyNo + 0.5) * compWidth_;
45 
46  if (div_.axis() == DDAxes::x) {
47  return DDTranslation(posi, 0.0, 0.0);
48  } else {
49  std::string s = "ERROR - DDDividedTrdX::makeDDTranslation()";
50  s += "\n Axis is along ";
52  s += " !\n";
53  s += "DDDividedTrdX::makeDDTranslation()";
54  s += " IllegalConstruct: Only axes along x are allowed !";
55  throw cms::Exception("DDException") << s;
56  }
57 
58  return DDTranslation();
59 }

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

DDDividedGeometryObject::compWidth_
double compWidth_
Definition: DDDividedGeometryObject.h:56
DDTrap::phi
double phi(void) const
Azimuthal angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:135
DDTrap::halfZ
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:131
DDTrap::x4
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDSolid.cc:149
DDDivision::width
double width() const
Definition: DDDivision.cc:53
DDTrap::x2
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:141
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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
DDDividedGeometryObject::tolerance
static const double tolerance(void)
Definition: DDDividedGeometryObject.cc:75
DDAxes::x
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
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDTrap::y1
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:137
DivNDIV
Definition: DDDividedGeometryObject.h:14
DDTrap::theta
double theta(void) const
Polar angle of the line joining the centres of the faces at -/+pDz.
Definition: DDSolid.cc:133
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
DDTrap
Interface to a Trapezoid.
Definition: DDSolid.h:77
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
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
DDDivision::nReplicas
int nReplicas() const
Definition: DDDivision.cc:51
DDDivision::axis
DDAxes axis() const
Definition: DDDivision.cc:49
DDTrap::y2
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:145
DDName::ns
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:51
Exception
Definition: hltDiff.cc:246
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDTrap::x1
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:139
DDDividedTrdX::checkParametersValidity
void checkParametersValidity() override
Definition: DDDividedTrd.cc:82
DDTrap::alpha1
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:143
DDTrap::alpha2
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:151
DDSolidFactory::trap
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:595
DDAxesNames::name
static const std::string name(const DDAxes &s)
Definition: DDAxes.cc:24
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
DDTrap::x3
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDSolid.cc:147
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