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 19 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().

20  : DDDividedGeometryObject( div, cpv )
21 {
23  setType( "DivisionPolyhedraRho" );
24 
25  DDPolyhedra msol = (DDPolyhedra)( div_.parent().solid() );
26 
27  if( divisionType_ == DivWIDTH )
28  {
29  compNDiv_ = calculateNDiv( msol.rMaxVec()[0] - msol.rMinVec()[0]
30  , div_.width()
31  , div_.offset() );
32  }
33  else if( divisionType_ == DivNDIV )
34  {
35  compWidth_ = calculateWidth( msol.rMaxVec()[0] - msol.rMinVec()[0]
36  , div_.nReplicas()
37  , div_.offset() );
38  }
39 
40  // for (int i = 0; i < compNDiv_; ++i)
41  // {
42  // DDpos( makeDDLogicalPart(i)
43  // , div_.parent()
44  // , i
45  // , makeDDTranslation(i)
46  // , makeDDRotation(i)
47  // , &div_
48  // );
49  // }
50 
51  DCOUT_V ('P', " DDDividedPolyhedraRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n");
52 
53 }
const int nReplicas() const
Definition: DDDivision.cc:90
std::vector< double > rMinVec() const
Definition: DDSolid.cc:436
int calculateNDiv(double motherDim, double width, double offset) const
double calculateWidth(double motherDim, int nDiv, double offset) const
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
virtual void checkParametersValidity()
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const double width() const
Definition: DDDivision.cc:95
std::vector< double > rMaxVec() const
Definition: DDSolid.cc:443
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const double offset() const
Definition: DDDivision.cc:100
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDDividedPolyhedraRho::~DDDividedPolyhedraRho ( void  )
virtual

Definition at line 55 of file DDDividedPolyhedra.cc.

56 {}

Member Function Documentation

void DDDividedPolyhedraRho::checkParametersValidity ( void  )
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 59 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().

60 {
62 
63  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
64 
66  {
67  std::cout << "WARNING - "
68  << "DDDividedPolyhedraRho::checkParametersValidity()"
69  << std::endl
70  << " Solid " << msol << std::endl
71  << " Division along R will be done with a width "
72  << "different for each solid section." << std::endl
73  << " WIDTH will not be used !" << std::endl;
74  }
75  if( div_.offset() != 0. )
76  {
77  std::cout << "WARNING - "
78  << "DDDividedPolyhedraRho::checkParametersValidity()"
79  << std::endl
80  << " Solid " << msol << std::endl
81  << " Division along R will be done with a width "
82  << "different for each solid section." << std::endl
83  << " OFFSET will not be used !" << std::endl;
84  }
85 }
virtual void checkParametersValidity(void)
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const double offset() const
Definition: DDDivision.cc:100
tuple cout
Definition: gather_cfg.py:41
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
double DDDividedPolyhedraRho::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 88 of file DDDividedPolyhedra.cc.

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

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

Reimplemented from DDDividedGeometryObject.

Definition at line 107 of file DDDividedPolyhedra.cc.

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

108 {
109  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
110  DDMaterial usemat = div_.parent().material();
111 
112  std::vector<double> localrMaxVec = msol.rMaxVec();
113  std::vector<double> localrMinVec = msol.rMinVec();
114  std::vector<double> localzVec = msol.zVec();
115  std::vector<double> newrMinVec;
116  std::vector<double> newrMaxVec;
117  int nZplanes = localzVec.size();
118 
119  double width = 0.;
120  for(int ii = 0; ii < nZplanes; ++ii)
121  {
122  // width = CalculateWidth( origparamMother->Rmax[ii]
123  // - origparamMother->Rmin[ii], compNDiv_, foffset );
124  // origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
125  // origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
126  width = calculateWidth(localrMaxVec[ii] - localrMinVec[ii], compNDiv_, div_.offset());
127  newrMinVec[ii] = localrMinVec[ii] + div_.offset() + width * copyNo;
128  newrMaxVec[ii] = localrMaxVec[ii] + div_.offset() + width * (copyNo + 1);
129  }
130 
131  // phedra.SetOriginalParameters(&origparam); // copy values & transfer pointers
132  // phedra.Reset(); // reset to new solid parameters
133 
134  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo)
135  , div_.parent().ddname().ns());
136 
137  DDSolid dsol = DDSolidFactory::polyhedra(solname
138  , msol.sides()
139  , msol.startPhi()
140  , msol.deltaPhi()
141  , localzVec
142  , newrMinVec
143  , newrMaxVec);
144  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, dsol);
145  DCOUT_V ('P', "DDDividedPolyhedraRho:makeDDLogicalPart lp:" << ddlp);
146  return ddlp;
147 }
std::vector< double > zVec() const
Definition: DDSolid.cc:429
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:45
double deltaPhi() const
Definition: DDSolid.cc:420
std::vector< double > rMinVec() const
Definition: DDSolid.cc:436
int sides() const
Definition: DDSolid.cc:416
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 DDMaterial & material() const
Returns a reference object of the material this LogicalPart is made of.
double startPhi() const
Definition: DDSolid.cc:418
A DDSolid represents the shape of a part.
Definition: DDSolid.h:42
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:95
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
std::vector< double > rMaxVec() const
Definition: DDSolid.cc:443
const DDSolid & solid() const
Returns a reference object of the solid being the shape of this LogicalPart.
const double offset() const
Definition: DDDivision.cc:100
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
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) //! Creates a polycone (refere to Gean...
Definition: DDSolid.cc:676
const N & ddname() const
Definition: DDBase.h:90
DDRotation DDDividedPolyhedraRho::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 101 of file DDDividedPolyhedra.cc.

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

Reimplemented from DDDividedGeometryObject.

Definition at line 95 of file DDDividedPolyhedra.cc.

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