CMS 3D CMS Logo

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

#include <DDDividedTubs.h>

Inheritance diagram for DDDividedTubsPhi:
DDDividedGeometryObject

Public Member Functions

 DDDividedTubsPhi (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 ~DDDividedTubsPhi ()
 
- 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 DDDividedTubs.h.

Constructor & Destructor Documentation

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

Definition at line 96 of file DDDividedTubs.cc.

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

98 {
100  setType( "DivisionTubsPhi" );
101 
102  DDTubs msol = (DDTubs)(div_.parent().solid());
103  if( divisionType_ == DivWIDTH )
104  {
105  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
106  if( msol.deltaPhi() == 360.*deg ) {
107  compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. );
108  }else {
110  }
111 
112  }
113  else if( divisionType_ == DivNDIV )
114  {
115  if( msol.deltaPhi() == 360.*deg ) {
116  compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. );
117  }else {
119  }
120  }
121 }
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)
double deltaPhi(void) const
Definition: DDSolid.cc:513
double width() const
Definition: DDDivision.cc:95
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDDividedTubsPhi::~DDDividedTubsPhi ( void  )
virtual

Definition at line 123 of file DDDividedTubs.cc.

124 {}

Member Function Documentation

double DDDividedTubsPhi::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 127 of file DDDividedTubs.cc.

References DDTubs::deltaPhi(), DDDividedGeometryObject::div_, DDDivision::parent(), and DDLogicalPart::solid().

128 {
129  DDTubs msol = (DDTubs)(div_.parent().solid());
130  return msol.deltaPhi();
131 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double deltaPhi(void) const
Definition: DDSolid.cc:513
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDLogicalPart DDDividedTubsPhi::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 160 of file DDDividedTubs.cc.

References DDDividedGeometryObject::compWidth_, DCOUT_V, ddtubs, DDDividedGeometryObject::div_, DDLogicalPart::material(), DDBase< N, C >::name(), DDDivision::offset(), DDDivision::parent(), DDLogicalPart::solid(), and DDSolidFactory::tubs().

161 {
162  DDName solname(div_.name());
163  //- DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
164  DDSolid ddtubs(solname);
165  DDMaterial usemat(div_.parent().material());
166  DDTubs msol = (DDTubs) (div_.parent().solid());
167  DDLogicalPart ddlp(solname);
168 
169  if (!ddtubs.isDefined().second) // only if it is not defined, make new dimensions and solid.
170  {
171  double pRMin = msol.rIn();
172  double pRMax = msol.rOut();
173  double pDz = msol.zhalf();
174  double pSPhi = msol.startPhi()+div_.offset();
175  double pDPhi = compWidth_;
176  ddtubs = DDSolidFactory::tubs(DDName(solname), pDz, pRMin, pRMax, pSPhi, pDPhi);
177  ddlp = DDLogicalPart(solname, usemat, ddtubs);
178  }
179 
180  DCOUT_V ('P', " DDDividedTubsPhi::computeDimensions() lp:" << ddlp);
181  return ddlp;
182 }
const N & name() const
Definition: DDBase.h:82
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double offset() const
Definition: DDDivision.cc:100
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 tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:788
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
DDRotation DDDividedTubsPhi::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 134 of file DDDividedTubs.cc.

References DDDividedGeometryObject::changeRotMatrix(), DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDrot(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDName::name(), DDName::ns(), and DDDivision::parent().

135 {
136  DDRotation myddrot; // sets to identity.
137  double posi = ( copyNo - 1 ) * compWidth_; // This should put the first one at the 0 of the parent.
138  DDRotationMatrix * rotMat = changeRotMatrix( posi );
139  // how to name the rotation??
140  // i hate this crap :-)
141  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT"
142  + DDXMLElement::itostr(copyNo)
143  , div_.parent().ddname().ns());
144  myddrot = DDrot(ddrotname, rotMat);
145 
146  return myddrot;
147 }
static std::string itostr(int i)
WARNING: abused by other classes in this system: yet another conversion from int to std::string...
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:101
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
const N & ddname() const
Definition: DDBase.h:84
DDRotationMatrix * changeRotMatrix(double rotZ=0.) const
DDTranslation DDDividedTubsPhi::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 150 of file DDDividedTubs.cc.

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

151 {
152  //----- translation
153  DDTranslation translation;
154 
155  DCOUT_V ('P', " DDDividedTubsPhi " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis()));
156  return translation;
157 }
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