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

virtual void checkParametersValidity () override
 
 DDDividedPolyhedraPhi (const DDDivision &div, DDCompactView *cpv)
 
virtual double getMaxParameter () const override
 
virtual DDLogicalPart makeDDLogicalPart (const int copyNo) const override
 
virtual DDRotation makeDDRotation (const int copyNo) const override
 
virtual DDTranslation makeDDTranslation (const 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 37 of file DDDividedPolyhedra.h.

Constructor & Destructor Documentation

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

Definition at line 135 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().

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

Member Function Documentation

void DDDividedPolyhedraPhi::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 172 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().

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

Reimplemented from DDDividedGeometryObject.

Definition at line 165 of file DDDividedPolyhedra.cc.

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

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

Reimplemented from DDDividedGeometryObject.

Definition at line 238 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().

239 {
240  DDPolyhedra msol = (DDPolyhedra)(div_.parent().solid());
241  DDMaterial usemat = div_.parent().material();
242 
243  DDName solname( div_.parent().ddname().name() + "_DIVCHILD",
244  div_.parent().ddname().ns());
245  DDSolid dsol(solname);
246  if (!dsol.isDefined().second)
247  {
248  dsol = DDSolidFactory::polyhedra( solname,
249  msol.sides(),
250  msol.startPhi()+div_.offset(),
251  compWidth_,
252  msol.zVec(),
253  msol.rMinVec(),
254  msol.rMaxVec());
255  }
256  DDLogicalPart ddlp(solname);
257  if (!ddlp.isDefined().second)
258  DDLogicalPart ddlp2 = DDLogicalPart(solname, usemat, dsol);
259  return ddlp;
260 }
double startPhi(void) const
Definition: DDSolid.cc:422
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:447
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:16
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:37
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:440
int sides(void) const
Definition: DDSolid.cc:420
std::vector< double > zVec(void) const
Definition: DDSolid.cc:433
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:708
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 ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 222 of file DDDividedPolyhedra.cc.

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

223 {
224 
225  double posi = ( copyNo - 1 ) * compWidth_;
226 
227  // ChangeRotMatrix( physVol, -posi );
228  DDRotationMatrix* rotMat = changeRotMatrix( posi);
229  // how to name the rotation??
230  // i do not like this...
231  DDName ddrotname(div_.parent().ddname().name() + "_DIVCHILD_ROT" + std::to_string(copyNo),
232  div_.parent().ddname().ns());
233  DDRotation myddrot = DDrot(ddrotname, rotMat);
234  return myddrot;
235 }
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:104
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
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
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 ( const int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 216 of file DDDividedPolyhedra.cc.

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