CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyhedraPhi Class Referencefinal

#include <DDDividedPolyhedra.h>

Inheritance diagram for DDDividedPolyhedraPhi:
DDDividedGeometryObject

Public Member Functions

void checkParametersValidity () override
 
 DDDividedPolyhedraPhi (const DDDivision &div, DDCompactView *cpv)
 
double getMaxParameter () const override
 
DDLogicalPart makeDDLogicalPart (int copyNo) const override
 
DDRotation makeDDRotation (int copyNo) const override
 
DDTranslation makeDDTranslation (int copyNo) const override
 
- 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)=default
 

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 25 of file DDDividedPolyhedra.h.

Constructor & Destructor Documentation

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

Definition at line 134 of file DDDividedPolyhedra.cc.

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

135  : DDDividedGeometryObject( div, cpv )
136 {
138  setType( "DivisionPolyhedraPhi" );
139 
140  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
141  // double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
142 
143  if( divisionType_ == DivWIDTH )
144  {
145  //If you divide a tube of 360 degrees the offset displaces the starting angle, but you still fill the 360 degrees
146  if( msol.deltaPhi() == 360.*deg ) {
147  compNDiv_ = calculateNDiv( msol.deltaPhi(), div_.width(), 0. );
148  }else {
150  }
151  }
152  else if( divisionType_ == DivNDIV )
153  {
154  if( msol.deltaPhi() == 360.*deg ) {
155  compWidth_ = calculateWidth( msol.deltaPhi(), div_.nReplicas(), 0. );
156  }else {
157  // original line looks wrong!
159  }
160  }
161 }
void checkParametersValidity() override
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.
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
virtual void setType(const std::string &type)
double width() const
Definition: DDDivision.cc:76
double deltaPhi(void) const
Definition: DDSolid.cc:430
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86

Member Function Documentation

void DDDividedPolyhedraPhi::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 171 of file DDDividedPolyhedra.cc.

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

Referenced by DDDividedPolyhedraPhi().

172 {
174 
175  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
176 
178  {
179  std::cout << "WARNING - "
180  << "DDDividedPolyhedraPhi::checkParametersValidity()"
181  << std::endl
182  << " Solid " << msol << std::endl
183  << " Division along PHI will be done splitting "
184  << "in the defined numSide." << std::endl
185  << " WIDTH will not be used !" << std::endl;
186  }
187  if( div_.offset() != 0. )
188  {
189  std::cout << "WARNING - "
190  << "DDDividedPolyhedraPhi::checkParametersValidity()"
191  << std::endl
192  << " Solid " << msol << std::endl
193  << " Division along PHI will be done splitting "
194  << "in the defined numSide." << std::endl
195  << " OFFSET will not be used !" << std::endl;
196  }
197 
198  if ( msol.sides() != compNDiv_ )
199  {
200  std::cout << "ERROR - "
201  << "DDDividedPolyhedraPhi::checkParametersValidity()"
202  << std::endl
203  << " Division along PHI will be done splitting in the defined"
204  << std::endl
205  << " numSide, i.e, the number of division would be :"
206  << " " << msol.sides()
207  << " instead of " << compNDiv_ << " !"
208  << std::endl;
209  std::string s = "DDDividedPolyhedraPhi::checkParametersValidity() Not supported configuration.";
210  throw cms::Exception("DDException") << s;
211  }
212 }
double offset() const
Definition: DDDivision.cc:81
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:424
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
double DDDividedPolyhedraPhi::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 164 of file DDDividedPolyhedra.cc.

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

165 {
166  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
167  return msol.deltaPhi(); //msol->GetEndPhi() - msol->GetStartPhi();
168 }
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:430
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
DDLogicalPart DDDividedPolyhedraPhi::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 237 of file DDDividedPolyhedra.cc.

References DDDividedGeometryObject::compWidth_, DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, 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().

238 {
239  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
240  DDMaterial usemat = div_.parent().material();
241 
242  DDName solname( div_.parent().ddname().name() + "_DIVCHILD",
243  div_.parent().ddname().ns());
244  DDSolid dsol(solname);
245  if (!dsol.isDefined().second)
246  {
247  dsol = DDSolidFactory::polyhedra( solname,
248  msol.sides(),
249  msol.startPhi()+div_.offset(),
250  compWidth_,
251  msol.zVec(),
252  msol.rMinVec(),
253  msol.rMaxVec());
254  }
255  DDLogicalPart ddlp(solname);
256  if (!ddlp.isDefined().second)
257  DDLogicalPart ddlp2 = DDLogicalPart(solname, usemat, dsol);
258  return ddlp;
259 }
double startPhi(void) const
Definition: DDSolid.cc:427
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:457
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
double offset() const
Definition: DDDivision.cc:81
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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:38
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:449
int sides(void) const
Definition: DDSolid.cc:424
std::vector< double > zVec(void) const
Definition: DDSolid.cc:441
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
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:846
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 DDDividedPolyhedraPhi::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 221 of file DDDividedPolyhedra.cc.

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

222 {
223 
224  double posi = ( copyNo - 1 ) * compWidth_;
225 
226  // ChangeRotMatrix( physVol, -posi );
227  DDRotationMatrix* rotMat = changeRotMatrix( posi);
228  // how to name the rotation??
229  // i do not like this...
230  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + std::to_string(copyNo),
231  div_.parent().ddname().ns());
232  DDRotation myddrot = DDrot(ddrotname, rotMat);
233  return myddrot;
234 }
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:67
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
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:90
const N & ddname() const
Definition: DDBase.h:80
DDRotationMatrix * changeRotMatrix(double rotZ=0.) const
DDTranslation DDDividedPolyhedraPhi::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 215 of file DDDividedPolyhedra.cc.

216 {
217  return DDTranslation();
218 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7