CMS 3D CMS Logo

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

#include <DDDividedBox.h>

Inheritance diagram for DDDividedBoxY:
DDDividedGeometryObject

Public Member Functions

 DDDividedBoxY (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 ~DDDividedBoxY ()
 
- 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)
 
virtual void checkParametersValidity (void)
 
- Protected Attributes inherited from DDDividedGeometryObject
int compNDiv_
 
double compWidth_
 
DDCompactViewcpv_
 
DDDivision div_
 
DivisionType divisionType_
 
std::string ftype_
 
int theVoluFirstCopyNo_
 

Detailed Description

Definition at line 32 of file DDDividedBox.h.

Constructor & Destructor Documentation

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

Definition at line 103 of file DDDividedBox.cc.

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

105 {
107  setType( "DivisionBoxY" );
108  DDBox mbox = (DDBox)(div_.parent().solid());
109 
110  if( divisionType_ == DivWIDTH ) {
111  compNDiv_ = calculateNDiv( 2*mbox.halfY(), div_.width(), div_.offset() );
112  } else if( divisionType_ == DivNDIV ) {
114  }
115 
116 
117  // somehow here, I want to iterate over the nDivs or nReplicas
118  // and make the solid, make the logical part, then position it.
119  // since DDBox is special, I will not make the solid and logical
120  // part but once. We'll see how bad the others go.
121  // ihatethisihatethisihatethis
122  // for (int i = 0; i < compNDiv_; ++i)
123  // {
124  // DDpos(makeDDLogicalPart(i) // child logical part
125  // , div_.parent() // parent logical part
126  // , i // copy number
127  // , makeDDTranslation(i) // translation
128  // , makeDDRotation(i) // rotation. box is default (i.e. identity).
129  // );
130  // }
131 
132  DCOUT_V ('P', " DDDividedBoxY:DDDividedBoxY" << std::endl);
133 }
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(void)
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
double halfY() const
Definition: DDSolid.cc:259
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
Definition: DDSolid.h:185
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
DDDividedBoxY::~DDDividedBoxY ( void  )
virtual

Definition at line 135 of file DDDividedBox.cc.

136 {}

Member Function Documentation

double DDDividedBoxY::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 139 of file DDDividedBox.cc.

References DDDividedGeometryObject::div_, DDBox::halfY(), DDDivision::parent(), and DDLogicalPart::solid().

140 {
141  DDBox msol = (DDBox)(div_.parent().solid());
142  return 2*msol.halfY();
143 }
double halfY() const
Definition: DDSolid.cc:259
Definition: DDSolid.h:185
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 DDDividedBoxY::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 168 of file DDDividedBox.cc.

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

169 {
170  // in other cases, this solid will have 1, 2, 3, etc. after it.
171  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
172  DDSolid ddbox(solname);
173  DDMaterial usemat(div_.parent().material());
174  DDBox msol = (DDBox) (div_.parent().solid());
175  DDLogicalPart ddlp(solname);
176  if (!ddbox.isDefined().second) //This solid has NOT been defined.
177  {
178  double pDx = msol.halfX();
179  double pDy = compWidth_/2.;
180  double pDz = msol.halfZ();
181  ddbox = DDSolidFactory::box(solname, pDx, pDy, pDz);
182  ddlp = DDLogicalPart(solname, usemat, ddbox);
183  }
184  DCOUT_V ('P', " DDDividedBoxY::computeDimensions() lp:\n" << ddlp);
185  return ddlp;
186 }
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
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:95
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Definition: DDSolid.cc:522
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
Definition: DDSolid.h:185
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
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
const N & ddname() const
Definition: DDBase.h:90
DDRotation DDDividedBoxY::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 146 of file DDDividedBox.cc.

147 {
148  return DDRotation();
149 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDTranslation DDDividedBoxY::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 152 of file DDDividedBox.cc.

References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDBox::halfY(), DDAxesNames::name(), DDDivision::offset(), DDDivision::parent(), and DDLogicalPart::solid().

153 {
154  DDBox msol = (DDBox)(div_.parent().solid());
155  double mdx = msol.halfY();
156 
157  //----- translation
158  DDTranslation translation;
159 
160  double posi = -mdx + div_.offset() + (copyNo+0.5) * compWidth_;
161  translation.SetY( posi );
162 
163  DCOUT_V ('P', " DDDividedBoxY: " << copyNo << "\n Position " << translation << " Axis " << DDAxesNames::name(div_.axis()) << "\n");
164  return translation;
165 }
const DDAxes axis() const
Definition: DDDivision.cc:85
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
double halfY() const
Definition: DDSolid.cc:259
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
Definition: DDSolid.h:185
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
static const std::string name(const DDAxes &s)
Definition: DDAxes.cc:37