CMS 3D CMS Logo

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

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeZ:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity ()
 
 DDDividedPolyconeZ (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 ~DDDividedPolyconeZ ()
 
- 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)
 
- Protected Attributes inherited from DDDividedGeometryObject
int compNDiv_
 
double compWidth_
 
DDCompactViewcpv_
 
DDDivision div_
 
DivisionType divisionType_
 
std::string ftype_
 
int theVoluFirstCopyNo_
 

Detailed Description

Definition at line 56 of file DDDividedPolycone.h.

Constructor & Destructor Documentation

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

Definition at line 246 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDPolycone::rMaxVec(), DDPolycone::rMinVec(), DDLogicalPart::solid(), DDDivision::width(), and DDPolycone::zVec().

248 {
250  DDPolycone msol = (DDPolycone)(div_.parent().solid());
251  std::vector<double> localrMaxVec = msol.rMaxVec();
252  std::vector<double> localrMinVec = msol.rMinVec();
253  std::vector<double> localzVec = msol.zVec();
254 
255  if( divisionType_ == DivWIDTH )
256  {
257  compNDiv_ =
258  calculateNDiv( localzVec[localzVec.size() - 1]
259  - localzVec[0] , div_.width(), div_.offset() );
260  }
261  else if( divisionType_ == DivNDIV )
262  {
263  compWidth_ =
264  calculateNDiv( localzVec[localzVec.size()-1]
265  - localzVec[0] , div_.nReplicas(), div_.offset() );
266  }
267 
268  DCOUT_V ('P', " DDDividedPolyconeZ - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "/n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n");
269 }
int nReplicas() const
Definition: DDDivision.cc:90
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:393
double offset() const
Definition: DDDivision.cc:100
int calculateNDiv(double motherDim, double width, double offset) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:386
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
virtual void checkParametersValidity()
double width() const
Definition: DDDivision.cc:95
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
std::vector< double > zVec(void) const
Definition: DDSolid.cc:379
DDDividedPolyconeZ::~DDDividedPolyconeZ ( void  )
virtual

Definition at line 271 of file DDDividedPolycone.cc.

272 {}

Member Function Documentation

void DDDividedPolyconeZ::checkParametersValidity ( void  )
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 275 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::div_, edm::hlt::Exception, DDXMLElement::itostr(), DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), DDDivision::width(), and DDPolycone::zVec().

Referenced by DDDividedPolyconeZ().

276 {
278 
279  DDPolycone msol = (DDPolycone)(div_.parent().solid());
280  std::vector<double> localzVec = msol.zVec();
281  // CHANGE FROM G4 a polycone can be divided in Z by specifying
282  // nReplicas IF they happen to coincide with the number of
283  // z plans.
284  size_t tempNDiv = div_.nReplicas();
285  if (tempNDiv == 0)
286  tempNDiv = calculateNDiv( localzVec[localzVec.size() - 1] - localzVec[0]
287  , div_.width()
288  , div_.offset() );
289  if ((msol.zVec().size() - 1) != tempNDiv)
290  {
291  std::string s = "ERROR - DDDividedPolyconeZ::checkParametersValidity()";
292  s += "\n\tDivision along Z will be done splitting in the defined";
293  s += "\n\tz_planes, i.e, the number of division would be :";
294  s += "\n\t" + DDXMLElement::itostr( msol.zVec().size() - 1 );
295  s += "\n\tinstead of " + DDXMLElement::itostr(tempNDiv) + " !\n";
296 
297  throw cms::Exception("DDException") << s;
298  }
299 }
static std::string itostr(int i)
WARNING: abused by other classes in this system: yet another conversion from int to std::string...
int nReplicas() const
Definition: DDDivision.cc:90
double offset() const
Definition: DDDivision.cc:100
int calculateNDiv(double motherDim, double width, 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)
double width() const
Definition: DDDivision.cc:95
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
std::vector< double > zVec(void) const
Definition: DDSolid.cc:379
double DDDividedPolyconeZ::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 302 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDPolycone::zVec().

303 {
304  DDPolycone msol = (DDPolycone)(div_.parent().solid());
305  std::vector<double> localzVec = msol.zVec();
306 
307  return (localzVec[ localzVec.size() - 1] - localzVec[0]);
308 }
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
std::vector< double > zVec(void) const
Definition: DDSolid.cc:379
DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 330 of file DDDividedPolycone.cc.

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

331 {
332  DDName solname;
333  DDSolid ddpolycone;
334  DDMaterial usemat(div_.parent().material());
335 
336  DDPolycone msol = (DDPolycone)(div_.parent().solid());
337  std::vector<double> localrMaxVec = msol.rMaxVec();
338  std::vector<double> localrMinVec = msol.rMinVec();
339  std::vector<double> localzVec = msol.zVec();
340 
341  solname = DDName( div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo),
342  div_.parent().ddname().ns());
343  ddpolycone = DDSolidFactory::cons( solname,
344  compWidth_ / 2,
345  localrMinVec[copyNo],
346  localrMaxVec[copyNo],
347  localrMinVec[copyNo+1],
348  localrMaxVec[copyNo+1],
349  msol.startPhi(),
350  msol.deltaPhi());
351 
352  DDLogicalPart ddlp = DDLogicalPart( solname, usemat, ddpolycone );
353 
354  DCOUT_V( 'P', " DDDividedPolyconeZ::makeDDLogicalPart() lp:" << ddlp );
355 
356  return ddlp;
357 }
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
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:393
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 DDDividedPolyconeZ::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 311 of file DDDividedPolycone.cc.

References DCOUT_V.

312 {
313  DDRotation myddrot; // sets to identity.
314  DCOUT_V ('P', "DDDividedPolyconeZ::makeDDRotation : " << myddrot);
315  return myddrot;
316 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDTranslation DDDividedPolyconeZ::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 319 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDLogicalPart::solid(), and DDPolycone::zVec().

320 {
321  DDTranslation translation;
322  DDPolycone msol = (DDPolycone)(div_.parent().solid());
323  std::vector<double> localzVec = msol.zVec();
324  double posi = (localzVec[copyNo] + localzVec[copyNo+1]) / 2;
325  translation.SetZ(posi);
326  return translation;
327 }
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
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
std::vector< double > zVec(void) const
Definition: DDSolid.cc:379