CMS 3D CMS Logo

List of all members | Public Member Functions
DDDividedPolyconeZ Class Referencefinal

#include <DDDividedPolycone.h>

Inheritance diagram for DDDividedPolyconeZ:
DDDividedGeometryObject

Public Member Functions

void checkParametersValidity () override
 
 DDDividedPolyconeZ (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
 
std::unique_ptr< 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 34 of file DDDividedPolycone.h.

Constructor & Destructor Documentation

◆ DDDividedPolyconeZ()

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

Definition at line 182 of file DDDividedPolycone.cc.

185  DDPolycone msol = (DDPolycone)(div_.parent().solid());
186  std::vector<double> localrMaxVec = msol.rMaxVec();
187  std::vector<double> localrMinVec = msol.rMinVec();
188  std::vector<double> localzVec = msol.zVec();
189 
190  if (divisionType_ == DivWIDTH) {
191  compNDiv_ = calculateNDiv(localzVec[localzVec.size() - 1] - localzVec[0], div_.width(), div_.offset());
192  } else if (divisionType_ == DivNDIV) {
193  compWidth_ = calculateNDiv(localzVec[localzVec.size() - 1] - localzVec[0], div_.nReplicas(), div_.offset());
194  }
195 }

References DDDividedGeometryObject::calculateNDiv(), checkParametersValidity(), DDDividedGeometryObject::compNDiv_, DDDividedGeometryObject::compWidth_, DDDividedGeometryObject::div_, DDDividedGeometryObject::divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), DDPolycone::rMaxVec(), DDPolycone::rMinVec(), DDLogicalPart::solid(), DDDivision::width(), and DDPolycone::zVec().

Member Function Documentation

◆ checkParametersValidity()

void DDDividedPolyconeZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 197 of file DDDividedPolycone.cc.

197  {
199 
200  DDPolycone msol = (DDPolycone)(div_.parent().solid());
201  std::vector<double> localzVec = msol.zVec();
202  // CHANGE FROM G4 a polycone can be divided in Z by specifying
203  // nReplicas IF they happen to coincide with the number of
204  // z plans.
205  size_t tempNDiv = div_.nReplicas();
206  if (tempNDiv == 0)
207  tempNDiv = calculateNDiv(localzVec[localzVec.size() - 1] - localzVec[0], div_.width(), div_.offset());
208  if ((msol.zVec().size() - 1) != tempNDiv) {
209  std::string s = "ERROR - DDDividedPolyconeZ::checkParametersValidity()";
210  s += "\n\tDivision along Z will be done splitting in the defined";
211  s += "\n\tz_planes, i.e, the number of division would be :";
212  s += "\n\t" + std::to_string(msol.zVec().size() - 1);
213  s += "\n\tinstead of " + std::to_string(tempNDiv) + " !\n";
214 
215  throw cms::Exception("DDException") << s;
216  }
217 }

References DDDividedGeometryObject::calculateNDiv(), DDDividedGeometryObject::checkParametersValidity(), DDDividedGeometryObject::div_, Exception, DDDivision::nReplicas(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, DDLogicalPart::solid(), AlCaHLTBitMon_QueryRunRegistry::string, DDDivision::width(), and DDPolycone::zVec().

Referenced by DDDividedPolyconeZ().

◆ getMaxParameter()

double DDDividedPolyconeZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 219 of file DDDividedPolycone.cc.

219  {
220  DDPolycone msol = (DDPolycone)(div_.parent().solid());
221  std::vector<double> localzVec = msol.zVec();
222 
223  return (localzVec[localzVec.size() - 1] - localzVec[0]);
224 }

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

◆ makeDDLogicalPart()

DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 240 of file DDDividedPolycone.cc.

240  {
242  DDMaterial usemat(div_.parent().material());
243 
244  DDPolycone msol = (DDPolycone)(div_.parent().solid());
245  std::vector<double> localrMaxVec = msol.rMaxVec();
246  std::vector<double> localrMinVec = msol.rMinVec();
247  std::vector<double> localzVec = msol.zVec();
248 
249  DDName solname(div_.parent().ddname().name() + "_DIVCHILD" + std::to_string(copyNo), div_.parent().ddname().ns());
251  compWidth_ / 2,
252  localrMinVec[copyNo],
253  localrMaxVec[copyNo],
254  localrMinVec[copyNo + 1],
255  localrMaxVec[copyNo + 1],
256  msol.startPhi(),
257  msol.deltaPhi());
258 
259  DDLogicalPart ddlp = DDLogicalPart(solname, usemat, ddpolycone);
260 
261  return ddlp;
262 }

References DDDividedGeometryObject::compWidth_, DDSolidFactory::cons(), DDBase< N, C >::ddname(), DDDividedGeometryObject::div_, DDLogicalPart::material(), DDName::name(), DDName::ns(), DDDivision::parent(), DDPolycone::rMaxVec(), and DDLogicalPart::solid().

◆ makeDDRotation()

DDRotation DDDividedPolyconeZ::makeDDRotation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 226 of file DDDividedPolycone.cc.

226  {
227  DDRotation myddrot; // sets to identity.
228  return myddrot;
229 }

◆ makeDDTranslation()

DDTranslation DDDividedPolyconeZ::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 231 of file DDDividedPolycone.cc.

231  {
232  DDTranslation translation;
233  DDPolycone msol = (DDPolycone)(div_.parent().solid());
234  std::vector<double> localzVec = msol.zVec();
235  double posi = (localzVec[copyNo] + localzVec[copyNo + 1]) / 2;
236  translation.SetZ(posi);
237  return translation;
238 }

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

DDDividedGeometryObject::compWidth_
double compWidth_
Definition: DDDividedGeometryObject.h:56
DDDivision::width
double width() const
Definition: DDDivision.cc:53
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDLogicalPart::material
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
Definition: DDLogicalPart.cc:118
DDDividedGeometryObject::DDDividedGeometryObject
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
Definition: DDDividedGeometryObject.cc:13
DDSolidFactory::cons
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:636
DivWIDTH
Definition: DDDividedGeometryObject.h:14
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDDividedGeometryObject::checkParametersValidity
virtual void checkParametersValidity(void)
Definition: DDDividedGeometryObject.cc:41
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DivNDIV
Definition: DDDividedGeometryObject.h:14
DDPolycone::zVec
std::vector< double > zVec(void) const
Definition: DDSolid.cc:282
DDPolycone::rMaxVec
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:296
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDDividedGeometryObject::calculateNDiv
int calculateNDiv(double motherDim, double width, double offset) const
Definition: DDDividedGeometryObject.cc:33
DDDividedGeometryObject::div_
DDDivision div_
Definition: DDDividedGeometryObject.h:53
DDDividedGeometryObject::compNDiv_
int compNDiv_
Definition: DDDividedGeometryObject.h:55
DDBase::ddname
const N & ddname() const
Definition: DDBase.h:61
cms::DDSolidShape::ddpolycone
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
DDDividedGeometryObject::divisionType_
DivisionType divisionType_
Definition: DDDividedGeometryObject.h:57
DDDivision::offset
double offset() const
Definition: DDDivision.cc:55
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
DDDivision::nReplicas
int nReplicas() const
Definition: DDDivision.cc:51
DDName::ns
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52
Exception
Definition: hltDiff.cc:245
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDPolycone
Definition: DDSolid.h:211
DDRotation
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
DDPolycone::rMinVec
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:289
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
DDDivision::parent
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
DDDividedPolyconeZ::checkParametersValidity
void checkParametersValidity() override
Definition: DDDividedPolycone.cc:197