CMS 3D CMS Logo

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

#include <DDDividedCons.h>

Inheritance diagram for DDDividedConsPhi:
DDDividedGeometryObject

Public Member Functions

 DDDividedConsPhi (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 ~DDDividedConsPhi ()
 
- 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)
 
virtual void checkParametersValidity (void)
 
- Protected Attributes inherited from DDDividedGeometryObject
int compNDiv_
 
double compWidth_
 
DDCompactViewcpv_
 
DDDivision div_
 
DivisionType divisionType_
 
std::string ftype_
 
int theVoluFirstCopyNo_
 

Detailed Description

Definition at line 32 of file DDDividedCons.h.

Constructor & Destructor Documentation

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

Definition at line 120 of file DDDividedCons.cc.

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

122 {
124  setType( "DivisionConsPhi" );
125  DDCons msol = (DDCons)(div_.parent().solid());
126 
127  if( divisionType_ == DivWIDTH )
128  {
129  DDCons msol = (DDCons)(div_.parent().solid());
130  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
131  if( msol.deltaPhi() == 360.*deg )
132  {
133  compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. );
134  }
135  else
136  {
138  }
139  }
140  else if( divisionType_ == DivNDIV )
141  {
142  DDCons msol = (DDCons)(div_.parent().solid());
143  if( msol.deltaPhi() == 360.*deg )
144  {
145  compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. );
146  }
147  else
148  {
150  }
151  }
152 
153  DCOUT_V( 'P', " DDDividedConsPhi - no divisions " << compNDiv_ << " = " << div_.nReplicas()
154  << "\n Offset " << div_.offset()
155  << "\n Width " << compWidth_ << " = " << div_.width()
156  << "\n DivType " << divisionType_);
157 }
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.
virtual void checkParametersValidity(void)
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
double deltaPhi(void) const
Definition: DDSolid.cc:470
#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
DDDividedConsPhi::~DDDividedConsPhi ( void  )
virtual

Definition at line 159 of file DDDividedCons.cc.

160 {}

Member Function Documentation

double DDDividedConsPhi::getMaxParameter ( void  ) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 163 of file DDDividedCons.cc.

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

164 {
165  DDCons msol = (DDCons)(div_.parent().solid());
166  return msol.deltaPhi();
167 }
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:470
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedConsPhi::makeDDLogicalPart ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 197 of file DDDividedCons.cc.

References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), DCOUT_V, ddcons, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::offset(), DDDivision::parent(), DDCons::rInMinusZ(), and DDLogicalPart::solid().

198 {
199  DDName solname(div_.parent().ddname().name() + "_DIVCHILD"
200  , div_.parent().ddname().ns());
201  DDSolid ddcons(solname);
202  DDMaterial usemat(div_.parent().material());
203  DDCons msol = (DDCons)(div_.parent().solid());
204 
205  if (!ddcons.isDefined().second)
206  {
207  double pRMin1 = msol.rInMinusZ();
208  double pRMax1 = msol.rOutMinusZ();
209  double pRMin2 = msol.rInPlusZ();
210  double pRMax2 = msol.rOutPlusZ();
211  double pDz = msol.zhalf();
212 
213  //- already rotated double pSPhi = div_.offset() + copyNo*compWidth_;
214  double pSPhi = div_.offset() + msol.phiFrom();
215  double pDPhi = compWidth_;
216  ddcons = DDSolidFactory::cons(DDName(solname), pDz, pRMin1, pRMax1
217  , pRMin2, pRMax2, pSPhi, pDPhi);
218  }
219 
220  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddcons);
221  DCOUT_V ('P', " DDDividedConsPhi::makeDDLogicalPart() lp:" << ddlp);
222  return ddlp;
223 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double offset() const
Definition: DDDivision.cc:81
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:763
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
double rInMinusZ(void) const
Definition: DDSolid.cc:460
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:86
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:80
DDRotation DDDividedConsPhi::makeDDRotation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 170 of file DDDividedCons.cc.

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

171 {
172  DDRotation myddrot; // sets to identity.
173  double posi = ( copyNo - 1 ) * compWidth_;
174  DDRotationMatrix* rotMat = changeRotMatrix( posi );
175  // how to name the rotation??
176  // i hate this crap :-)
177  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + DDXMLElement::itostr(copyNo)
178  , div_.parent().ddname().ns());
179  myddrot = DDrot(ddrotname, rotMat);
180 
181  DCOUT_V ('P', "DDDividedConsPhi::makeDDRotation : " << myddrot);
182  return myddrot;
183 }
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:90
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
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:80
DDRotationMatrix * changeRotMatrix(double rotZ=0.) const
DDTranslation DDDividedConsPhi::makeDDTranslation ( const int  copyNo) const
virtual

Reimplemented from DDDividedGeometryObject.

Definition at line 186 of file DDDividedCons.cc.

References DDDivision::axis(), DDDividedGeometryObject::compWidth_, DCOUT_V, DDDividedGeometryObject::div_, and DDAxesNames::name().

187 {
188  //----- translation
189  DDTranslation translation;
190  DCOUT_V( 'P', " DDDividedConsPhi " << "\n\t Position: " << translation
191  << " - Width: " << compWidth_
192  << " - Axis " << DDAxesNames::name(div_.axis()));
193  return translation;
194 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
static const std::string name(const DDAxes &s)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
DDAxes axis() const
Definition: DDDivision.cc:66