CMS 3D CMS Logo

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

#include <DDDividedPolyhedra.h>

Inheritance diagram for DDDividedPolyhedraRho:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity ()
 
 DDDividedPolyhedraRho (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 ~DDDividedPolyhedraRho ()
 
- 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 18 of file DDDividedPolyhedra.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file DDDividedPolyhedra.cc.

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

19  : DDDividedGeometryObject( div, cpv )
20 {
22  setType( "DivisionPolyhedraRho" );
23 
24  DDPolyhedra msol = (DDPolyhedra)( div_.parent().solid() );
25 
26  if( divisionType_ == DivWIDTH )
27  {
28  compNDiv_ = calculateNDiv( msol.rMaxVec()[0] - msol.rMinVec()[0]
29  , div_.width()
30  , div_.offset() );
31  }
32  else if( divisionType_ == DivNDIV )
33  {
34  compWidth_ = calculateWidth( msol.rMaxVec()[0] - msol.rMinVec()[0]
35  , div_.nReplicas()
36  , div_.offset() );
37  }
38 
39  // for (int i = 0; i < compNDiv_; ++i)
40  // {
41  // DDpos( makeDDLogicalPart(i)
42  // , div_.parent()
43  // , i
44  // , makeDDTranslation(i)
45  // , makeDDRotation(i)
46  // , &div_
47  // );
48  // }
49 
50  DCOUT_V ('P', " DDDividedPolyhedraRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n");
51 
52 }
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:440
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.
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:433
virtual void checkParametersValidity()
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
double width() const
Definition: DDDivision.cc:76
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDDividedPolyhedraRho::~DDDividedPolyhedraRho ( void  )
virtual

Definition at line 54 of file DDDividedPolyhedra.cc.

55 {}

Member Function Documentation

void DDDividedPolyhedraRho::checkParametersValidity ( void  )
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 58 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::checkParametersValidity(), gather_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, DDDivision::offset(), DDDivision::parent(), and DDLogicalPart::solid().

Referenced by DDDividedPolyhedraRho().

59 {
61 
62  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
63 
65  {
66  std::cout << "WARNING - "
67  << "DDDividedPolyhedraRho::checkParametersValidity()"
68  << std::endl
69  << " Solid " << msol << std::endl
70  << " Division along R will be done with a width "
71  << "different for each solid section." << std::endl
72  << " WIDTH will not be used !" << std::endl;
73  }
74  if( div_.offset() != 0. )
75  {
76  std::cout << "WARNING - "
77  << "DDDividedPolyhedraRho::checkParametersValidity()"
78  << std::endl
79  << " Solid " << msol << std::endl
80  << " Division along R will be done with a width "
81  << "different for each solid section." << std::endl
82  << " OFFSET will not be used !" << std::endl;
83  }
84 }
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.
virtual void checkParametersValidity(void)
tuple cout
Definition: gather_cfg.py:121
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
double DDDividedPolyhedraRho::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 87 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::div_, DDDivision::parent(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), and DDLogicalPart::solid().

88 {
89  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
90  return msol.rMaxVec()[0] - msol.rMinVec()[0];
91 }
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:440
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:433
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedPolyhedraRho::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 106 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::compNDiv_, DCOUT_V, DDBase< N, C >::ddname(), DDPolyhedra::deltaPhi(), DDDividedGeometryObject::div_, cuy::ii, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polyhedra(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDPolyhedra::sides(), DDLogicalPart::solid(), DDPolyhedra::startPhi(), create_public_lumi_plots::width, and DDPolyhedra::zVec().

107 {
108  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
109  DDMaterial usemat = div_.parent().material();
110 
111  std::vector<double> localrMaxVec = msol.rMaxVec();
112  std::vector<double> localrMinVec = msol.rMinVec();
113  std::vector<double> localzVec = msol.zVec();
114  std::vector<double> newrMinVec;
115  std::vector<double> newrMaxVec;
116  int nZplanes = localzVec.size();
117 
118  double width = 0.;
119  for(int ii = 0; ii < nZplanes; ++ii)
120  {
121  // width = CalculateWidth( origparamMother->Rmax[ii]
122  // - origparamMother->Rmin[ii], compNDiv_, foffset );
123  // origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
124  // origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
125  width = calculateWidth(localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset());
126  newrMinVec[ii] = localrMinVec[ii] + div_.offset() + width * copyNo;
127  newrMaxVec[ii] = localrMaxVec[ii] + div_.offset() + width * (copyNo + 1);
128  }
129 
130  // phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
131  // phedra.Reset(); // reset to new solid parameters
132 
133  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo)
134  , div_.parent().ddname().ns());
135 
136  DDSolid dsol = DDSolidFactory::polyhedra(solname
137  , msol.sides()
138  , msol.startPhi()
139  , msol.deltaPhi()
140  , localzVec
141  , newrMinVec
142  , newrMaxVec);
143  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, dsol);
144  DCOUT_V ('P', "DDDividedPolyhedraRho:makeDDLogicalPart lp:" << ddlp);
145  return ddlp;
146 }
double startPhi(void) const
Definition: DDSolid.cc:415
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:440
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:81
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.
int ii
Definition: cuy.py:588
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
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:433
int sides(void) const
Definition: DDSolid.cc:413
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
std::vector< double > zVec(void) const
Definition: DDSolid.cc:426
double deltaPhi(void) const
Definition: DDSolid.cc:417
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
static DDSolid polyhedra(const DDName &name, int sides, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polyhedra (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:673
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 DDDividedPolyhedraRho::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 100 of file DDDividedPolyhedra.cc.

101 {
102  return DDRotation();
103 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDTranslation DDDividedPolyhedraRho::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 94 of file DDDividedPolyhedra.cc.

95 {
96  return DDTranslation();
97 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7