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.

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().

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 }
int nReplicas() const
Definition: DDDivision.cc:51
std::vector< double > rMinVec(void) const
Definition: DDSolid.cc:293
double offset() const
Definition: DDDivision.cc:55
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
DDDividedGeometryObject(const DDDivision &div, DDCompactView *cpv)
int calculateNDiv(double motherDim, double width, double offset) const
void checkParametersValidity() override
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double width() const
Definition: DDDivision.cc:53
std::vector< double > zVec(void) const
Definition: DDSolid.cc:286
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:300

Member Function Documentation

◆ checkParametersValidity()

void DDDividedPolyconeZ::checkParametersValidity ( void  )
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 197 of file DDDividedPolycone.cc.

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

Referenced by DDDividedPolyconeZ().

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 }
int nReplicas() const
Definition: DDDivision.cc:51
std::string to_string(const V &value)
Definition: OMSAccess.h:77
double offset() const
Definition: DDDivision.cc:55
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
virtual void checkParametersValidity(void)
int calculateNDiv(double motherDim, double width, double offset) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
double width() const
Definition: DDDivision.cc:53
std::vector< double > zVec(void) const
Definition: DDSolid.cc:286

◆ getMaxParameter()

double DDDividedPolyconeZ::getMaxParameter ( void  ) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 219 of file DDDividedPolycone.cc.

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

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 }
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > zVec(void) const
Definition: DDSolid.cc:286

◆ makeDDLogicalPart()

DDLogicalPart DDDividedPolyconeZ::makeDDLogicalPart ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 240 of file DDDividedPolycone.cc.

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

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 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
static DDSolid cons(const DDName &name, double zhalf, double rInMinusZ, double rOutMinusZ, double rInPlusZ, double rOutPlusZ, double phiFrom, double deltaPhi)
Definition: DDSolid.cc:650
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::string to_string(const V &value)
Definition: OMSAccess.h:77
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
const N & ddname() const
Definition: DDBase.h:61
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > rMaxVec(void) const
Definition: DDSolid.cc:300
const std::string & ns() const
Returns the namespace.
Definition: DDName.cc:52

◆ 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 }
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57

◆ makeDDTranslation()

DDTranslation DDDividedPolyconeZ::makeDDTranslation ( int  copyNo) const
overridevirtual

Reimplemented from DDDividedGeometryObject.

Definition at line 231 of file DDDividedPolycone.cc.

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

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 }
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double > zVec(void) const
Definition: DDSolid.cc:286
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7