CMS 3D CMS Logo

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

#include <DDDividedBox.h>

Inheritance diagram for DDDividedBoxZ:
DDDividedGeometryObject

Public Member Functions

 DDDividedBoxZ (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 ~DDDividedBoxZ ()
 
- 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 49 of file DDDividedBox.h.

Constructor & Destructor Documentation

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

Definition at line 188 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(), DDBox::halfZ(), DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().

190 {
192  setType( "DivisionBoxZ" );
193  DDBox mbox = (DDBox)(div_.parent().solid());
194 
195  if( divisionType_ == DivWIDTH ) {
196  compNDiv_ = calculateNDiv( 2*mbox.halfZ(), div_.width(), div_.offset() );
197  } else if( divisionType_ == DivNDIV ) {
199  }
200 
201  // somehow here, I want to iterate over the nDivs or nReplicas
202  // and make the solid, make the logical part, then position it.
203  // since DDBox is special, I will not make the solid and logical
204  // part but once. We'll see how bad the others go.
205  // ihatethisihatethisihatethis
206  // for (int i = 0; i < compNDiv_; ++i)
207  // {
208  // DDpos(makeDDLogicalPart(i) // child logical part
209  // , div_.parent() // parent logical part
210  // , i // copy number
211  // , makeDDTranslation(i) // translation
212  // , makeDDRotation(i) // rotation. box is default (i.e. identity).
213  // );
214  // }
215 
216  DCOUT_V ('P', " DDDividedBoxZ:DDDividedBoxZ" << std::endl);
217 }
double halfZ(void) const
Definition: DDSolid.cc:258
double halfY(void) const
Definition: DDSolid.cc:256
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.
virtual void checkParametersValidity(void)
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
Interface to a Box.
Definition: DDSolid.h:162
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDDividedBoxZ::~DDDividedBoxZ ( void  )
virtual

Definition at line 219 of file DDDividedBox.cc.

220 {}

Member Function Documentation

double DDDividedBoxZ::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 223 of file DDDividedBox.cc.

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

224 {
225  DDBox msol = (DDBox)(div_.parent().solid());
226  return 2*msol.halfZ();
227 }
double halfZ(void) const
Definition: DDSolid.cc:258
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Interface to a Box.
Definition: DDSolid.h:162
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedBoxZ::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

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

253 {
254  // in other cases, this solid will have 1, 2, 3, etc. after it.
255  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
256  DDSolid ddbox(solname);
257  DDMaterial usemat(div_.parent().material());
258  DDBox msol = (DDBox) (div_.parent().solid());
259  DDLogicalPart ddlp(solname);
260  if (!ddbox.isDefined().second) //This solid has NOT been defined.
261  {
262  double pDx = msol.halfX();
263  double pDy = msol.halfY();
264  double pDz = compWidth_/2.;
265  ddbox = DDSolidFactory::box(solname, pDx, pDy, pDz);
266  ddlp = DDLogicalPart(solname, usemat, ddbox);
267  }
268  DCOUT_V ('P', " DDDividedBoxZ::computeDimensions() lp:\n" << ddlp);
269  return ddlp;
270 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
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 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:35
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
Definition: DDSolid.cc:519
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
Interface to a Box.
Definition: DDSolid.h:162
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
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 DDDividedBoxZ::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 230 of file DDDividedBox.cc.

231 {
232  return DDRotation();
233 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDTranslation DDDividedBoxZ::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 236 of file DDDividedBox.cc.

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

237 {
238  DDBox msol = (DDBox)(div_.parent().solid());
239  double mdx = msol.halfZ();
240 
241  //----- translation
242  DDTranslation translation;
243 
244  double posi = -mdx + div_.offset() + (copyNo+0.5) * compWidth_;
245  translation.SetZ( posi );
246 
247  DCOUT_V ('P', " DDDividedBoxZ: " << copyNo << "\n Position " << translation << " Axis " << DDAxesNames::name(div_.axis()) << "\n");
248  return translation;
249 }
double halfZ(void) const
Definition: DDSolid.cc:258
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
static const std::string name(const DDAxes &s)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
Interface to a Box.
Definition: DDSolid.h:162
DDAxes axis() const
Definition: DDDivision.cc:66
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86