CMS 3D CMS Logo

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

#include <DDDividedCons.h>

Inheritance diagram for DDDividedConsZ:
DDDividedGeometryObject

Public Member Functions

 DDDividedConsZ (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 ~DDDividedConsZ ()
 
- 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 50 of file DDDividedCons.h.

Constructor & Destructor Documentation

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

Definition at line 225 of file DDDividedCons.cc.

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

227 {
229 
230  DDCons msol = (DDCons)(div_.parent().solid());
231  setType( "DivisionConsZ" );
232 
233  if( divisionType_ == DivWIDTH )
234  {
235  DDCons msol = (DDCons)(div_.parent().solid());
236  compNDiv_ = calculateNDiv( 2*msol.zhalf()
237  , div_.width(), div_.offset() );
238  }
239  else if( divisionType_ == DivNDIV )
240  {
241  DDCons msol = (DDCons)(div_.parent().solid());
242  compWidth_ = calculateWidth( 2*msol.zhalf()
243  , div_.nReplicas(), div_.offset() );
244  }
245 
246  DCOUT_V( 'P', " DDDividedConsZ - no divisions " << compNDiv_ << " = " << div_.nReplicas()
247  << "\n Offset " << div_.offset()
248  << "\n Width " << compWidth_ << " = " << div_.width()
249  << "\n DivType " << divisionType_ );
250 }
double zhalf(void) const
Definition: DDSolid.cc:458
int nReplicas() const
Definition: DDDivision.cc:90
double offset() const
Definition: DDDivision.cc:100
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
double width() const
Definition: DDDivision.cc:95
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDDividedConsZ::~DDDividedConsZ ( void  )
virtual

Definition at line 252 of file DDDividedCons.cc.

253 {}

Member Function Documentation

double DDDividedConsZ::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 256 of file DDDividedCons.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDCons::zhalf().

257 {
258  DDCons msol = (DDCons)(div_.parent().solid());
259  return 2*msol.zhalf();
260 }
double zhalf(void) const
Definition: DDSolid.cc:458
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDLogicalPart DDDividedConsZ::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 286 of file DDDividedCons.cc.

References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), DCOUT_V, ddcons, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDCons::zhalf().

287 {
288  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo)
289  , div_.parent().ddname().ns());
290  DDSolid ddcons(solname);
291  DDMaterial usemat(div_.parent().material());
292  DDCons msol = (DDCons)(div_.parent().solid());
293 
294  double mHalfLength = msol.zhalf();
295  double aRInner = (msol.rInPlusZ()
296  - msol.rInMinusZ()) / (2*mHalfLength);
297  double bRInner = (msol.rInPlusZ()
298  + msol.rInMinusZ()) / 2;
299  double aROuter = (msol.rOutPlusZ()
300  - msol.rOutMinusZ()) / (2*mHalfLength);
301  double bROuter = (msol.rOutPlusZ()
302  + msol.rOutMinusZ()) / 2;
303  double xMinusZ = -mHalfLength + div_.offset() + compWidth_*copyNo;
304  double xPlusZ = -mHalfLength + div_.offset() + compWidth_*(copyNo+1);
305 
306  double pDz = compWidth_ / 2.;
307  double pSPhi = msol.phiFrom();
308  double pDPhi = msol.deltaPhi();
309 
311  , pDz
312  , aRInner * xMinusZ + bRInner
313  , aROuter * xMinusZ + bROuter
314  , aRInner * xPlusZ + bRInner
315  , aROuter * xPlusZ + bROuter
316  , pSPhi
317  , pDPhi
318  );
319 
320  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
321  DCOUT_V( 'P', " DDDividedConsZ::makeDDLogicalPart() lp:" << ddlp );
322  return ddlp;
323 }
double zhalf(void) const
Definition: DDSolid.cc:458
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:41
double offset() const
Definition: DDDivision.cc:100
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:763
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
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
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:84
DDRotation DDDividedConsZ::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 263 of file DDDividedCons.cc.

References DCOUT_V.

264 {
265  DDRotation myddrot; // sets to identity.
266  DCOUT_V ('P', "DDDividedConsZ::makeDDRotation : " << myddrot);
267  return myddrot;
268 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDTranslation DDDividedConsZ::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 271 of file DDDividedCons.cc.

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

272 {
273  //----- translation
274  DDTranslation translation;
275 
276  DDCons motherCons = (DDCons)(div_.parent().solid());
277  double posi = - motherCons.zhalf() + div_.offset()
278  + compWidth_/2 + copyNo*compWidth_;
279  translation.SetZ(posi);
280 
281  DCOUT_V ('P', " DDDividedConsZ " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis()));
282  return translation;
283 }
double zhalf(void) const
Definition: DDSolid.cc:458
double offset() const
Definition: DDDivision.cc:100
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
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDAxes axis() const
Definition: DDDivision.cc:85
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
static const std::string name(const DDAxes &s)
Definition: DDAxes.cc:37