test
CMS 3D CMS Logo

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

#include <DDDividedTubs.h>

Inheritance diagram for DDDividedTubsZ:
DDDividedGeometryObject

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 184 of file DDDividedTubs.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 DDTubs::zhalf().

186 {
188 
189  DDTubs msol = (DDTubs)(div_.parent().solid());
190 
191  setType( "DivisionTubsZ" );
192  if( divisionType_ == DivWIDTH )
193  {
194  compNDiv_ = calculateNDiv( 2*msol.zhalf(), div_.width(), div_.offset() );
195  }
196  else if( divisionType_ == DivNDIV )
197  {
199  }
200 
201  DCOUT_V ('P', " DDDividedTubsZ - no divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << "\n Width " << compWidth_ << " = " << div_.width() << "\n DivType " << divisionType_);
202 
203 }
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
double zhalf(void) const
Definition: DDSolid.cc:505
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDDividedTubsZ::~DDDividedTubsZ ( void  )
virtual

Definition at line 205 of file DDDividedTubs.cc.

206 {}

Member Function Documentation

double DDDividedTubsZ::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 209 of file DDDividedTubs.cc.

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

210 {
211  DDTubs msol = (DDTubs)(div_.parent().solid());
212  return 2*msol.zhalf();
213 
214 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double zhalf(void) const
Definition: DDSolid.cc:505
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedTubsZ::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 239 of file DDDividedTubs.cc.

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

240 {
241  DDMaterial usemat(div_.parent().material());
242  DDTubs msol = (DDTubs) (div_.parent().solid());
243  DDLogicalPart ddlp;
244 
245  DDName solname(div_.parent().ddname().name() + "_DIVCHILD", div_.parent().ddname().ns());
246  DDSolid ddtubs(solname);
247 
248  if (!ddtubs.isDefined().second) // only if it is not defined, make new dimensions and solid.
249  {
250  double pRMin = msol.rIn();
251  double pRMax = msol.rOut();
252  double pDz = compWidth_/2.;
253  double pSPhi = msol.startPhi();
254  double pDPhi = msol.deltaPhi();
255  ddtubs = DDSolidFactory::tubs(DDName(solname), pDz, pRMin, pRMax, pSPhi, pDPhi);
256  ddlp = DDLogicalPart(solname, usemat, ddtubs);
257  }
258  else {
259  ddlp = DDLogicalPart(solname);
260  }
261 
262  DCOUT_V ('P', " DDDividedTubsZ::computeDimensions() lp:" << ddlp);
263  return ddlp;
264 }
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:14
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: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 DDDividedTubsZ::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 217 of file DDDividedTubs.cc.

References DCOUT_V.

218 {
219  DDRotation myddrot; // sets to identity.
220  DCOUT_V ('P', "DDDividedTubsZ::makeDDRotation made a rotation: " << myddrot);
221  return myddrot;
222 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDTranslation DDDividedTubsZ::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 225 of file DDDividedTubs.cc.

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

226 {
227  //----- translation
228  DDTranslation translation;
229 
230  DDTubs msol = (DDTubs)(div_.parent().solid());
231  double posi = - msol.zhalf() + div_.offset() + compWidth_/2 + copyNo*compWidth_;
232  translation.SetZ(posi);
233 
234  DCOUT_V ('P', " DDDividedTubsZ " << "\n\t Position: " << translation << " - Width: " << compWidth_ << " - Axis " << DDAxesNames::name(div_.axis()));
235  return translation;
236 }
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
double zhalf(void) const
Definition: DDSolid.cc:505
DDAxes axis() const
Definition: DDDivision.cc:66
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86