CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DDDividedGeometryObject Class Reference

#include <DDDividedGeometryObject.h>

Inheritance diagram for DDDividedGeometryObject:
DDDividedBoxX DDDividedBoxY DDDividedBoxZ DDDividedConsPhi DDDividedConsRho DDDividedConsZ DDDividedPolyconePhi DDDividedPolyconeRho DDDividedPolyconeZ DDDividedPolyhedraPhi DDDividedPolyhedraRho DDDividedPolyhedraZ DDDividedTrdX DDDividedTrdY DDDividedTrdZ DDDividedTubsPhi DDDividedTubsRho DDDividedTubsZ

Public Member Functions

 DDDividedGeometryObject (const DDDivision &div, DDCompactView *cpv)
 
virtual void execute (void)
 
virtual const std::string & getType (void) const
 
virtual DDLogicalPart makeDDLogicalPart (int copyNo) const
 
virtual DDRotation makeDDRotation (int copyNo) const
 
virtual DDTranslation makeDDTranslation (int copyNo) const
 
virtual void setType (const std::string &type)
 
int volumeFirstCopyNo (void) const
 
virtual ~DDDividedGeometryObject (void)=default
 

Static Public Member Functions

static const double tolerance (void)
 

Protected Member Functions

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)
 
virtual void checkParametersValidity (void)
 
virtual double getMaxParameter (void) const
 

Protected Attributes

int compNDiv_
 
double compWidth_
 
DDCompactViewcpv_
 
DDDivision div_
 
DivisionType divisionType_
 
std::string ftype_
 
int theVoluFirstCopyNo_
 

Detailed Description

Definition at line 20 of file DDDividedGeometryObject.h.

Constructor & Destructor Documentation

◆ DDDividedGeometryObject()

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

Definition at line 13 of file DDDividedGeometryObject.cc.

References div_, divisionType_, DivNDIV, DivWIDTH, DDDivision::nReplicas(), tolerance(), and DDDivision::width().

◆ ~DDDividedGeometryObject()

virtual DDDividedGeometryObject::~DDDividedGeometryObject ( void  )
virtualdefault

Member Function Documentation

◆ calculateNDiv()

int DDDividedGeometryObject::calculateNDiv ( double  motherDim,
double  width,
double  offset 
) const
protected

◆ calculateWidth()

double DDDividedGeometryObject::calculateWidth ( double  motherDim,
int  nDiv,
double  offset 
) const
protected

◆ changeRotMatrix()

std::unique_ptr< DDRotationMatrix > DDDividedGeometryObject::changeRotMatrix ( double  rotZ = 0.) const
protected

Definition at line 29 of file DDDividedGeometryObject.cc.

Referenced by DDDividedConsPhi::makeDDRotation(), DDDividedTubsPhi::makeDDRotation(), DDDividedPolyhedraPhi::makeDDRotation(), and DDDividedPolyconePhi::makeDDRotation().

29  {
30  return std::make_unique<DDRotationMatrix>(ROOT::Math::RotationZ(rotZ));
31 }

◆ checkNDivAndWidth()

void DDDividedGeometryObject::checkNDivAndWidth ( double  maxPar)
protected

Definition at line 64 of file DDDividedGeometryObject.cc.

References compNDiv_, compWidth_, gather_cfg::cout, div_, divisionType_, DivNDIVandWIDTH, Exception, DDName::name(), DDBase< N, C >::name(), DDDivision::offset(), DDDivision::parent(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and tolerance().

Referenced by checkParametersValidity().

64  {
65  if ((divisionType_ == DivNDIVandWIDTH) && (div_.offset() + compWidth_ * compNDiv_ - maxPar > tolerance())) {
66  std::string s = "ERROR - DDDividedGeometryObject::checkNDivAndWidth()";
67  s += "\n Division of LogicalPart " + div_.parent().name().name();
68  s += " has too big an offset.";
69 
70  std::cout << compWidth_ << std::endl;
71  throw cms::Exception("DDException") << s;
72  }
73 }
double offset() const
Definition: DDDivision.cc:55
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
static const double tolerance(void)
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
const N & name() const
Definition: DDBase.h:59

◆ checkOffset()

void DDDividedGeometryObject::checkOffset ( double  maxPar)
protected

Definition at line 54 of file DDDividedGeometryObject.cc.

References div_, Exception, DDDivision::offset(), alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by checkParametersValidity().

54  {
55  if (div_.offset() >= maxPar) {
56  std::string s = "DDDividedGeometryObject::checkOffset() IllegalConstruct";
57  s += "\nERROR - DDDividedGeometryObject::checkOffset()";
58  s += "\n failed.";
59  s += " Too big an offset.";
60  throw cms::Exception("DDException") << s;
61  }
62 }
double offset() const
Definition: DDDivision.cc:55

◆ checkParametersValidity()

void DDDividedGeometryObject::checkParametersValidity ( void  )
protectedvirtual

Reimplemented in DDDividedPolyconeZ, DDDividedPolyhedraZ, DDDividedTrdZ, DDDividedPolyconePhi, DDDividedPolyhedraPhi, DDDividedTrdY, DDDividedPolyconeRho, DDDividedPolyhedraRho, and DDDividedTrdX.

Definition at line 41 of file DDDividedGeometryObject.cc.

References checkNDivAndWidth(), checkOffset(), div_, Exception, getMaxParameter(), DDBase< N, C >::isDefined(), DDDivision::parent(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and DDBase< N, C >::toString().

Referenced by DDDividedPolyconeRho::checkParametersValidity(), DDDividedPolyhedraRho::checkParametersValidity(), DDDividedTrdX::checkParametersValidity(), DDDividedPolyconePhi::checkParametersValidity(), DDDividedPolyhedraPhi::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), DDDividedPolyconeZ::checkParametersValidity(), DDDividedPolyhedraZ::checkParametersValidity(), DDDividedTrdZ::checkParametersValidity(), DDDividedBoxX::DDDividedBoxX(), DDDividedBoxY::DDDividedBoxY(), DDDividedBoxZ::DDDividedBoxZ(), DDDividedConsPhi::DDDividedConsPhi(), DDDividedConsRho::DDDividedConsRho(), DDDividedConsZ::DDDividedConsZ(), DDDividedTubsPhi::DDDividedTubsPhi(), DDDividedTubsRho::DDDividedTubsRho(), and DDDividedTubsZ::DDDividedTubsZ().

41  {
42  double maxPar = getMaxParameter();
43  checkOffset(maxPar);
44  checkNDivAndWidth(maxPar);
45  if (!div_.parent().isDefined().second) {
46  std::string s = "DDDividedGeometryObject::checkParametersValidity() :";
47  s += "\n ERROR - the LogicalPart of the parent must be ";
48  s += "\n defined before a division can occur.";
49  s += "\n Parent= " + div_.parent().toString();
50  throw cms::Exception("DDException") << s;
51  }
52 }
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
virtual double getMaxParameter(void) const
std::string toString() const
Definition: DDBase.h:63
def_type isDefined() const
Definition: DDBase.h:90
void checkNDivAndWidth(double maxPar)

◆ execute()

void DDDividedGeometryObject::execute ( void  )
virtual

Definition at line 85 of file DDDividedGeometryObject.cc.

References compNDiv_, cpv_, div_, mps_fire::i, makeDDLogicalPart(), makeDDRotation(), makeDDTranslation(), DDDivision::parent(), DDCompactView::position(), and theVoluFirstCopyNo_.

Referenced by DDLDivision::processElement().

85  {
88  }
89 }
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
virtual DDRotation makeDDRotation(int copyNo) const
const DDLogicalPart & parent() const
Definition: DDDivision.cc:57
virtual DDLogicalPart makeDDLogicalPart(int copyNo) const
virtual DDTranslation makeDDTranslation(int copyNo) const

◆ getMaxParameter()

double DDDividedGeometryObject::getMaxParameter ( void  ) const
protectedvirtual

◆ getType()

const std::string & DDDividedGeometryObject::getType ( void  ) const
virtual

Definition at line 83 of file DDDividedGeometryObject.cc.

References ftype_.

83 { return ftype_; }

◆ makeDDLogicalPart()

DDLogicalPart DDDividedGeometryObject::makeDDLogicalPart ( int  copyNo) const
virtual

◆ makeDDRotation()

DDRotation DDDividedGeometryObject::makeDDRotation ( int  copyNo) const
virtual

◆ makeDDTranslation()

DDTranslation DDDividedGeometryObject::makeDDTranslation ( int  copyNo) const
virtual

◆ setType()

void DDDividedGeometryObject::setType ( const std::string &  type)
virtual

◆ tolerance()

const double DDDividedGeometryObject::tolerance ( void  )
static

Definition at line 75 of file DDDividedGeometryObject.cc.

Referenced by checkNDivAndWidth(), DDDividedTrdX::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), and DDDividedGeometryObject().

75  {
76  // this can come from some global tolerance if you want.
77  static const double tol = 1.0 / 1000.00;
78  return tol;
79 }

◆ volumeFirstCopyNo()

int DDDividedGeometryObject::volumeFirstCopyNo ( void  ) const

Member Data Documentation

◆ compNDiv_

int DDDividedGeometryObject::compNDiv_
protected

◆ compWidth_

double DDDividedGeometryObject::compWidth_
protected

Definition at line 56 of file DDDividedGeometryObject.h.

Referenced by checkNDivAndWidth(), DDDividedBoxX::DDDividedBoxX(), DDDividedBoxY::DDDividedBoxY(), DDDividedBoxZ::DDDividedBoxZ(), DDDividedConsPhi::DDDividedConsPhi(), DDDividedConsRho::DDDividedConsRho(), DDDividedConsZ::DDDividedConsZ(), DDDividedPolyconePhi::DDDividedPolyconePhi(), DDDividedPolyconeRho::DDDividedPolyconeRho(), DDDividedPolyconeZ::DDDividedPolyconeZ(), DDDividedPolyhedraPhi::DDDividedPolyhedraPhi(), DDDividedPolyhedraRho::DDDividedPolyhedraRho(), DDDividedPolyhedraZ::DDDividedPolyhedraZ(), DDDividedTrdX::DDDividedTrdX(), DDDividedTrdY::DDDividedTrdY(), DDDividedTrdZ::DDDividedTrdZ(), DDDividedTubsPhi::DDDividedTubsPhi(), DDDividedTubsRho::DDDividedTubsRho(), DDDividedTubsZ::DDDividedTubsZ(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedConsRho::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedTrdX::makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedTubsPhi::makeDDRotation(), DDDividedConsPhi::makeDDRotation(), DDDividedPolyhedraPhi::makeDDRotation(), DDDividedPolyconePhi::makeDDRotation(), DDDividedBoxX::makeDDTranslation(), DDDividedTrdX::makeDDTranslation(), DDDividedBoxY::makeDDTranslation(), DDDividedTrdY::makeDDTranslation(), DDDividedBoxZ::makeDDTranslation(), DDDividedConsZ::makeDDTranslation(), DDDividedTubsZ::makeDDTranslation(), and DDDividedTrdZ::makeDDTranslation().

◆ cpv_

DDCompactView* DDDividedGeometryObject::cpv_
protected

Definition at line 59 of file DDDividedGeometryObject.h.

Referenced by execute().

◆ div_

DDDivision DDDividedGeometryObject::div_
protected

Definition at line 53 of file DDDividedGeometryObject.h.

Referenced by checkNDivAndWidth(), checkOffset(), DDDividedPolyhedraRho::checkParametersValidity(), DDDividedPolyconeRho::checkParametersValidity(), DDDividedTrdX::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), DDDividedPolyhedraPhi::checkParametersValidity(), DDDividedTrdZ::checkParametersValidity(), DDDividedPolyconeZ::checkParametersValidity(), DDDividedPolyhedraZ::checkParametersValidity(), checkParametersValidity(), DDDividedBoxX::DDDividedBoxX(), DDDividedBoxY::DDDividedBoxY(), DDDividedBoxZ::DDDividedBoxZ(), DDDividedConsPhi::DDDividedConsPhi(), DDDividedConsRho::DDDividedConsRho(), DDDividedConsZ::DDDividedConsZ(), DDDividedGeometryObject(), DDDividedPolyconePhi::DDDividedPolyconePhi(), DDDividedPolyconeRho::DDDividedPolyconeRho(), DDDividedPolyconeZ::DDDividedPolyconeZ(), DDDividedPolyhedraPhi::DDDividedPolyhedraPhi(), DDDividedPolyhedraRho::DDDividedPolyhedraRho(), DDDividedPolyhedraZ::DDDividedPolyhedraZ(), DDDividedTrdX::DDDividedTrdX(), DDDividedTrdY::DDDividedTrdY(), DDDividedTrdZ::DDDividedTrdZ(), DDDividedTubsPhi::DDDividedTubsPhi(), DDDividedTubsRho::DDDividedTubsRho(), DDDividedTubsZ::DDDividedTubsZ(), execute(), DDDividedTubsRho::getMaxParameter(), DDDividedBoxX::getMaxParameter(), DDDividedConsRho::getMaxParameter(), DDDividedPolyconeRho::getMaxParameter(), DDDividedPolyhedraRho::getMaxParameter(), DDDividedTrdX::getMaxParameter(), DDDividedConsPhi::getMaxParameter(), DDDividedTubsPhi::getMaxParameter(), DDDividedBoxY::getMaxParameter(), DDDividedPolyconePhi::getMaxParameter(), DDDividedTrdY::getMaxParameter(), DDDividedPolyhedraPhi::getMaxParameter(), DDDividedBoxZ::getMaxParameter(), DDDividedTubsZ::getMaxParameter(), DDDividedConsZ::getMaxParameter(), DDDividedTrdZ::getMaxParameter(), DDDividedPolyconeZ::getMaxParameter(), DDDividedPolyhedraZ::getMaxParameter(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedConsRho::makeDDLogicalPart(), DDDividedPolyconeRho::makeDDLogicalPart(), DDDividedPolyhedraRho::makeDDLogicalPart(), DDDividedTrdX::makeDDLogicalPart(), makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedPolyhedraZ::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedConsPhi::makeDDRotation(), DDDividedTubsPhi::makeDDRotation(), DDDividedPolyconePhi::makeDDRotation(), DDDividedPolyhedraPhi::makeDDRotation(), DDDividedBoxX::makeDDTranslation(), DDDividedTrdX::makeDDTranslation(), DDDividedBoxY::makeDDTranslation(), DDDividedTrdY::makeDDTranslation(), DDDividedTubsZ::makeDDTranslation(), DDDividedConsZ::makeDDTranslation(), DDDividedBoxZ::makeDDTranslation(), DDDividedTrdZ::makeDDTranslation(), DDDividedPolyconeZ::makeDDTranslation(), and DDDividedPolyhedraZ::makeDDTranslation().

◆ divisionType_

DivisionType DDDividedGeometryObject::divisionType_
protected

◆ ftype_

std::string DDDividedGeometryObject::ftype_
protected

Definition at line 54 of file DDDividedGeometryObject.h.

Referenced by getType(), and setType().

◆ theVoluFirstCopyNo_

int DDDividedGeometryObject::theVoluFirstCopyNo_
protected

Definition at line 58 of file DDDividedGeometryObject.h.

Referenced by execute().