CMS 3D CMS Logo

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

#include <DDDividedPolyhedra.h>

Inheritance diagram for DDDividedPolyhedraPhi:
DDDividedGeometryObject

Public Member Functions

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

Constructor & Destructor Documentation

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

Definition at line 148 of file DDDividedPolyhedra.cc.

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

149  : DDDividedGeometryObject( div, cpv )
150 {
152  setType( "DivisionPolyhedraPhi" );
153 
154  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
155  // double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
156 
157  if( divisionType_ == DivWIDTH )
158  {
159  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
160  if( msol.deltaPhi() == 360.*deg ) {
161  compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. );
162  }else {
164  }
165  }
166  else if( divisionType_ == DivNDIV )
167  {
168  if( msol.deltaPhi() == 360.*deg ) {
169  compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. );
170  }else {
171  // original line looks wrong!
173  }
174  }
175 
176  DCOUT_V ('P', " DDDividedPolyhedraRho - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "\n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n");
177 }
int nReplicas() const
Definition: DDDivision.cc:90
double offset() const
Definition: DDDivision.cc:100
virtual void checkParametersValidity()
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)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
double width() const
Definition: DDDivision.cc:95
double deltaPhi(void) const
Definition: DDSolid.cc:417
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDDividedPolyhedraPhi::~DDDividedPolyhedraPhi ( void  )
virtual

Definition at line 179 of file DDDividedPolyhedra.cc.

180 {}

Member Function Documentation

void DDDividedPolyhedraPhi::checkParametersValidity ( void  )
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 190 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::compNDiv_, gather_cfg::cout, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIVandWIDTH, DivWIDTH, edm::hlt::Exception, DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDPolyhedra::sides(), and DDLogicalPart::solid().

Referenced by DDDividedPolyhedraPhi().

191 {
193 
194  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
195 
197  {
198  std::cout << "WARNING - "
199  << "DDDividedPolyhedraPhi::checkParametersValidity()"
200  << std::endl
201  << " Solid " << msol << std::endl
202  << " Division along PHI will be done splitting "
203  << "in the defined numSide." << std::endl
204  << " WIDTH will not be used !" << std::endl;
205  }
206  if( div_.offset() != 0. )
207  {
208  std::cout << "WARNING - "
209  << "DDDividedPolyhedraPhi::checkParametersValidity()"
210  << std::endl
211  << " Solid " << msol << std::endl
212  << " Division along PHI will be done splitting "
213  << "in the defined numSide." << std::endl
214  << " OFFSET will not be used !" << std::endl;
215  }
216 
217  if ( msol.sides() != compNDiv_ )
218  {
219  std::cout << "ERROR - "
220  << "DDDividedPolyhedraPhi::checkParametersValidity()"
221  << std::endl
222  << " Division along PHI will be done splitting in the defined"
223  << std::endl
224  << " numSide, i.e, the number of division would be :"
225  << " " << msol.sides()
226  << " instead of " << compNDiv_ << " !"
227  << std::endl;
228  std::string s = "DDDividedPolyhedraPhi::checkParametersValidity() Not supported configuration.";
229  throw cms::Exception("DDException") << s;
230  }
231 }
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)
int sides(void) const
Definition: DDSolid.cc:413
tuple cout
Definition: gather_cfg.py:121
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
double DDDividedPolyhedraPhi::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 183 of file DDDividedPolyhedra.cc.

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

184 {
185  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
186  return msol.deltaPhi(); //msol->GetEndPhi() - msol->GetStartPhi();
187 }
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double deltaPhi(void) const
Definition: DDSolid.cc:417
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
DDLogicalPart DDDividedPolyhedraPhi::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 260 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::compWidth_, DCOUT_V, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDBase< N, C >::isDefined(), DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDSolidFactory::polyhedra(), DDPolyhedra::rMaxVec(), DDPolyhedra::rMinVec(), DDPolyhedra::sides(), DDLogicalPart::solid(), DDPolyhedra::startPhi(), and DDPolyhedra::zVec().

261 {
262  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
263  DDMaterial usemat = div_.parent().material();
264 
265  DDName solname( div_.parent().ddname().name() + "_DIVCHILD",
266  div_.parent().ddname().ns());
267  DDSolid dsol(solname);
268  if (!dsol.isDefined().second)
269  {
270  dsol = DDSolidFactory::polyhedra( solname,
271  msol.sides(),
272  msol.startPhi()+div_.offset(),
273  compWidth_,
274  msol.zVec(),
275  msol.rMinVec(),
276  msol.rMaxVec());
277  }
278  DDLogicalPart ddlp(solname);
279  if (!ddlp.isDefined().second)
280  DDLogicalPart ddlp2 = DDLogicalPart(solname, usemat, dsol);
281  DCOUT_V ('P', "DDDividedPolyhedraPhi::makeDDLogicalPart() ddlp = " << ddlp);
282  return ddlp;
283 }
double startPhi(void) const
Definition: DDSolid.cc:415
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:440
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double offset() const
Definition: DDDivision.cc:100
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
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
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)
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:84
DDRotation DDDividedPolyhedraPhi::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 240 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::changeRotMatrix(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDBase< N, C >::ddname(), DDrot(), DDDividedGeometryObject::div_, DDXMLElement::itostr(), DDName::name(), DDName::ns(), and DDDivision::parent().

241 {
242 
243  double posi = ( copyNo - 1 ) * compWidth_;
244 
245  DCOUT_V ('P', " DDDividedPolyhedraPhi - position: " << posi/deg << "\n copyNo: " << copyNo << " - compWidth_: " << compWidth_/deg << "\n");
246 
247  // ChangeRotMatrix( physVol, -posi );
248  DDRotationMatrix* rotMat = changeRotMatrix( posi);
249  // how to name the rotation??
250  // i do not like this...
251  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + DDXMLElement::itostr(copyNo)
252  , div_.parent().ddname().ns());
253  DDRotation myddrot = DDrot(ddrotname, rotMat);
254  DCOUT_V ('P', "DDDividedPolyhedra::makeDDRotation: copyNo = " << copyNo << " rotation = " << myddrot);
255  return myddrot;
256 
257 }
static std::string itostr(int i)
WARNING: abused by other classes in this system: yet another conversion from int to std::string...
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:101
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:18
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:93
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
const N & ddname() const
Definition: DDBase.h:84
DDRotationMatrix * changeRotMatrix(double rotZ=0.) const
DDTranslation DDDividedPolyhedraPhi::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 234 of file DDDividedPolyhedra.cc.

235 {
236  return DDTranslation();
237 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7