CMS 3D CMS Logo

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

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconePhi:
DDDividedGeometryObject

Public Member Functions

virtual void checkParametersValidity ()
 
 DDDividedPolyconePhi (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 ~DDDividedPolyconePhi ()
 
- 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 37 of file DDDividedPolycone.h.

Constructor & Destructor Documentation

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

Definition at line 146 of file DDDividedPolycone.cc.

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

148 {
150  DDPolycone msol = (DDPolycone)(div_.parent().solid());
151  setType( "DivisionPolyconePhi" );
152  // this is the g4. what do we keep??? I think it is deltaPhi
153  // double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
154  if( divisionType_ == DivWIDTH )
155  {
156  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
157  if( msol.deltaPhi() == 360.*deg ) {
158  compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. );
159  }else {
161  }
162  }
163  else if( divisionType_ == DivNDIV )
164  {
165  if( msol.deltaPhi() == 360.*deg ) {
166  compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. );
167  }else {
169  }
170  }
171 
172  DCOUT_V ('P', " DDDividedPolyconePhi - # divisions " << compNDiv_ << " = " << div_.nReplicas() << "/n Offset " << div_.offset() << " Width " << compWidth_ << " = " << div_.width() << "\n");
173 }
const int nReplicas() const
Definition: DDDivision.cc:90
int calculateNDiv(double motherDim, double width, double offset) const
double calculateWidth(double motherDim, int nDiv, double offset) const
virtual void checkParametersValidity()
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
const double width() const
Definition: DDDivision.cc:95
double deltaPhi() const
Definition: DDSolid.cc:373
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
DDDividedPolyconePhi::~DDDividedPolyconePhi ( void  )
virtual

Definition at line 175 of file DDDividedPolycone.cc.

176 {}

Member Function Documentation

void DDDividedPolyconePhi::checkParametersValidity ( void  )
virtual
double DDDividedPolyconePhi::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 185 of file DDDividedPolycone.cc.

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

186 {
187  DDPolycone msol = (DDPolycone)(div_.parent().solid());
188  return msol.deltaPhi();
189 }
double deltaPhi() const
Definition: DDSolid.cc:373
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 DDDividedPolyconePhi::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 215 of file DDDividedPolycone.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::polycone(), DDPolycone::rMaxVec(), and DDLogicalPart::solid().

216 {
217  DDName solname;
218  DDSolid ddpolycone;
219  DDMaterial usemat(div_.parent().material());
220 
221  DDPolycone msol = (DDPolycone)(div_.parent().solid());
222  std::vector<double> localrMaxVec = msol.rMaxVec();
223  std::vector<double> localrMinVec = msol.rMinVec();
224  std::vector<double> localzVec = msol.zVec();
225 
226  solname = DDName(div_.parent().ddname().name() + "_DIVCHILD",
227  div_.parent().ddname().ns());
228  DDSolid sol( solname );
229  if( !sol.isDefined().second )
230  {
231  ddpolycone = DDSolidFactory::polycone( solname,
232  msol.startPhi()+div_.offset(),
233  compWidth_,
234  localzVec,
235  localrMinVec,
236  localrMaxVec );
237  }
238  DDLogicalPart ddlp( solname );
239  if( !ddlp.isDefined().second )
240  {
241  ddlp = DDLogicalPart( solname, usemat, ddpolycone );
242  }
243  DCOUT_V( 'P', " DDDividedPolyconePhi::makeDDLogicalPart() lp:" << ddlp );
244  return ddlp;
245 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
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:659
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 DDMaterial & material() const
Returns a reference object of the material this LogicalPart is made of.
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
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
std::vector< double > rMaxVec() const
Definition: DDSolid.cc:396
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
const N & ddname() const
Definition: DDBase.h:90
DDRotation DDDividedPolyconePhi::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 192 of file DDDividedPolycone.cc.

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

193 {
194  DDRotation myddrot; // sets to identity.
195  double posi = ( copyNo - 1 ) * compWidth_;
196  DDRotationMatrix* rotMat = changeRotMatrix( posi );
197  // how to name the rotation??
198  // i do not like this
199  DDName ddrotname( div_.parent().ddname().name() + "_DIVCHILD_ROT" + DDXMLElement::itostr( copyNo ),
200  div_.parent().ddname().ns());
201  myddrot = DDrot( ddrotname, rotMat );
202 
203  DCOUT_V( 'P', "DDDividedPolyconePhi::makeDDRotation : " << myddrot );
204  return myddrot;
205 }
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:94
#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:90
DDRotationMatrix * changeRotMatrix(double rotZ=0.) const
DDTranslation DDDividedPolyconePhi::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 208 of file DDDividedPolycone.cc.

209 {
210  DDTranslation translation;
211  return translation;
212 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7