CMS 3D CMS Logo

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

#include <DDDividedCons.h>

Inheritance diagram for DDDividedConsRho:
DDDividedGeometryObject

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 20 of file DDDividedCons.cc.

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

22 {
24  setType( "DivisionConsRho" );
25  DDCons msol = (DDCons)(div_.parent().solid());
26 
27  if( msol.rInPlusZ() == 0. )
28  {
29  std::cout << "WARNING - DDDividedConsRho, rOutMinusZ = 0. "
30  << std::endl
31  << " Width is calculated as that of rOutMinusZ !"
32  << std::endl;
33  }
34 
35  if( divisionType_ == DivWIDTH )
36  {
38  - msol.rInMinusZ(), div_.width(), div_.offset() );
39  }
40  else if( divisionType_ == DivNDIV )
41  {
42  DDCons msol = (DDCons)(div_.parent().solid());
44  , div_.nReplicas()
45  , div_.offset() );
46  }
47 
48  DCOUT_V( 'P', " DDDividedConsRho - no divisions " << compNDiv_ << " = " << div_.nReplicas()
49  << "\n Offset " << div_.offset()
50  << "\n Width " << compWidth_ << " = " << div_.width()
51  << "\n DivType " << divisionType_);
52 }
int nReplicas() const
Definition: DDDivision.cc:90
double offset() const
Definition: DDDivision.cc:100
int calculateNDiv(double motherDim, double width, double offset) const
double rOutMinusZ(void) const
Definition: DDSolid.cc:462
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)
double rInMinusZ(void) const
Definition: DDSolid.cc:460
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
double rInPlusZ(void) const
Definition: DDSolid.cc:464
tuple cout
Definition: gather_cfg.py:121
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDDividedConsRho::~DDDividedConsRho ( void  )
virtual

Definition at line 54 of file DDDividedCons.cc.

55 {}

Member Function Documentation

double DDDividedConsRho::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 58 of file DDDividedCons.cc.

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

59 {
60  DDCons msol = (DDCons)(div_.parent().solid());
61  return msol.rOutMinusZ() - msol.rInMinusZ();
62 
63 }
double rOutMinusZ(void) const
Definition: DDSolid.cc:462
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double rInMinusZ(void) const
Definition: DDSolid.cc:460
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDLogicalPart DDDividedConsRho::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 83 of file DDDividedCons.cc.

References DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::compNDiv_, 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(), DDCons::rInMinusZ(), and DDLogicalPart::solid().

84 {
85  DDName solname(div_.parent().ddname().name() + "_DIVCHILD"
86  + DDXMLElement::itostr(copyNo)
87  , div_.parent().ddname().ns());
88  DDSolid ddcons(solname);
89  DDMaterial usemat(div_.parent().material());
90  DDCons msol = (DDCons)(div_.parent().solid());
91 
92  double pRMin1 = msol.rInMinusZ() + div_.offset() + compWidth_ * copyNo;
93  double pRMax1 = msol.rInMinusZ() + div_.offset() + compWidth_ * (copyNo+1);
94 
95  //width at Z Plus
96  //- double compWidth_Plus =
97  // compWidth_ * ( msol.rOutPlusZ()/ msol.rInPlusZ())
98  //- / ( msol.rOutMinusZ() - msol.rInMinusZ());
99  double compWidth_Plus = calculateWidth( msol.rOutPlusZ()
100  - msol.rInPlusZ(), compNDiv_, div_.offset() );
101  double pRMin2 = msol.rInPlusZ()
102  + div_.offset() + compWidth_Plus * copyNo;
103  double pRMax2 = msol.rInPlusZ()
104  + div_.offset() + compWidth_Plus * (copyNo+1);
105  double pDz = msol.zhalf();
106 
107  double pSPhi = msol.phiFrom();
108  double pDPhi = msol.deltaPhi();
109 
110  ddcons = DDSolidFactory::cons(DDName(solname), pDz, pRMin1, pRMax1
111  , pRMin2, pRMax2, pSPhi, pDPhi);
112 
113  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
114  DCOUT_V( 'P', " DDDividedConsRho::makeDDLogicalPart() lp:" << ddlp );
115  return ddlp;
116 }
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
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.
A DDSolid represents the shape of a part.
Definition: DDSolid.h:35
double rInMinusZ(void) const
Definition: DDSolid.cc:460
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 DDDividedConsRho::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 66 of file DDDividedCons.cc.

References DCOUT_V.

67 {
68  DDRotation myddrot; // sets to identity.
69  DCOUT_V ('P', "DDDividedConsRho::makeDDRotation : " << myddrot);
70  return myddrot;
71 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDTranslation DDDividedConsRho::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 74 of file DDDividedCons.cc.

References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, and DDAxesNames::name().

75 {
76  //----- translation
77  DDTranslation translation;
78  DCOUT_V ('P', " DDDividedConsRho " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis()));
79  return translation;
80 }
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
DDAxes axis() const
Definition: DDDivision.cc:85