CMS 3D CMS Logo

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

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeRho:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity ()
 
 DDDividedPolyconeRho (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 ~DDDividedPolyconeRho ()
 
- 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 DDDividedPolycone.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file DDDividedPolycone.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(), DDPolycone::rMaxVec(), DDPolycone::rMinVec(), DDDividedGeometryObject::setType(), DDLogicalPart::solid(), and DDDivision::width().

20 {
22  DDPolycone msol = (DDPolycone)(div_.parent().solid());
23  std::vector<double> localrMaxVec = msol.rMaxVec();
24  std::vector<double> localrMinVec = msol.rMinVec();
25 
26  setType( "DivisionPolyconeRho" );
27 
28  // in DDD we only have ONE representation
29  // in the case when rMinVec and rMaxVec
30  // are empty rVec and zVec are the r and z std::vectors.
31 
32  if( divisionType_ == DivWIDTH )
33  {
34  compNDiv_ = calculateNDiv( localrMaxVec[0] - localrMinVec[0], div_.width(), div_.offset());
35  }
36  else if( divisionType_ == DivNDIV )
37  {
38  compWidth_ = calculateWidth( localrMaxVec[0] - localrMinVec[0], div_.nReplicas(), div_.offset());
39  }
40 
41  DCOUT_V( 'P', " DDDividedPolyconeRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "/n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n" );
42 }
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
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)
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:386
virtual void checkParametersValidity()
virtual void setType(const std::string &type)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
double width() const
Definition: DDDivision.cc:95
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDDividedPolyconeRho::~DDDividedPolyconeRho ( void  )
virtual

Definition at line 44 of file DDDividedPolycone.cc.

45 {}

Member Function Documentation

void DDDividedPolyconeRho::checkParametersValidity ( void  )
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 48 of file DDDividedPolycone.cc.

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

Referenced by DDDividedPolyconeRho().

49 {
51 
52  DDPolycone msol = (DDPolycone)(div_.parent().solid());
53 
55  {
56  std::cout << "WARNING - "
57  << "DDDividedPolyconeRho::checkParametersValidity()"
58  << std::endl
59  << " Solid " << msol << std::endl
60  << " Division along r will be done with a width "
61  << "different for each solid section." << std::endl
62  << " WIDTH will not be used !" << std::endl;
63  }
64  if( div_.offset() != 0. )
65  {
66  std::cout << "WARNING - "
67  << "DDDividedPolyconeRho::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  << " OFFSET will not be used !" << std::endl;
73  }
74 }
double offset() const
Definition: DDDivision.cc:100
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:105
double DDDividedPolyconeRho::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 77 of file DDDividedPolycone.cc.

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

78 {
79  DDPolycone msol = (DDPolycone)(div_.parent().solid());
80  std::vector<double> localrMaxVec = msol.rMaxVec();
81  std::vector<double> localrMinVec = msol.rMinVec();
82 
83  return localrMaxVec[0] - localrMinVec[0];
84 }
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:393
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:386
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDLogicalPart DDDividedPolyconeRho::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 102 of file DDDividedPolycone.cc.

References DDDividedGeometryObject::calculateWidth(), DDDividedGeometryObject::compNDiv_, DCOUT_V, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, cuy::ii, DDXMLElement::itostr(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polycone(), DDPolycone::rMaxVec(), DDLogicalPart::solid(), and create_public_lumi_plots::width.

103 {
104  DDName solname;
105  DDSolid ddpolycone;
106  DDMaterial usemat(div_.parent().material());
107 
108  DDPolycone msol = (DDPolycone)(div_.parent().solid());
109  std::vector<double> localrMaxVec = msol.rMaxVec();
110  std::vector<double> localrMinVec = msol.rMinVec();
111  std::vector<double> localzVec = msol.zVec();
112 
113  int nZplanes = localzVec.size();
114 
115  std::vector<double> newrMinVec;
116  std::vector<double> newrMaxVec;
117 
118  double width = 0.;
119  for(int ii = 0; ii < nZplanes; ++ii)
120  {
121  width = calculateWidth( localrMaxVec[ii]
122  - localrMinVec[ii], compNDiv_, div_.offset() );
123  // hmmm different width every time... probably should use width
124  // not compWidth_
125  // newrMinVec[ii] = localrMinVec[ii]+div_.offset()+compWidth_*copyNo;
126  // newrMaxVec[ii] = localrMinVec[ii]+div_.offset()+compWidth_*(copyNo+1);
127  newrMinVec.push_back(localrMinVec[ii]+div_.offset()+width*copyNo);
128  newrMaxVec.push_back(localrMinVec[ii]+div_.offset()+width*(copyNo+1));
129  }
130  solname = DDName( div_.parent().ddname().name() + "_DIVCHILD" + DDXMLElement::itostr(copyNo),
131  div_.parent().ddname().ns());
132 
133  ddpolycone = DDSolidFactory::polycone( solname,
134  msol.startPhi(),
135  msol.deltaPhi(),
136  localzVec,
137  newrMinVec,
138  newrMaxVec );
139 
140  DDLogicalPart ddlp = DDLogicalPart( solname, usemat, ddpolycone );
141  DCOUT_V ('P', " DDDividedPolyconeRho::makeDDLogicalPart() lp:" << ddlp);
142  return ddlp;
143 }
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
double offset() const
Definition: DDDivision.cc:100
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:656
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
#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 DDDividedPolyconeRho::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 87 of file DDDividedPolycone.cc.

References DCOUT_V.

88 {
89  DDRotation myddrot; // sets to identity.
90  DCOUT_V ('P', "DDDividedPolyconeRho::makeDDRotation : " << myddrot);
91  return myddrot;
92 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDTranslation DDDividedPolyconeRho::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 95 of file DDDividedPolycone.cc.

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