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 (const int copyNo) const
 
virtual DDRotation makeDDRotation (const int copyNo) const
 
virtual DDTranslation makeDDTranslation (const 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
 
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 25 of file DDDividedGeometryObject.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file DDDividedGeometryObject.cc.

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

15  : div_( div ),
16  ftype_(),
17  compNDiv_( div.nReplicas()),
18  compWidth_( div.width()),
21  cpv_( cpv )
22 {
23  if( div_.nReplicas() == 0 || div_.width() < tolerance())
24  {
25  if( div_.width() < tolerance())
27  else
29  }
30 }
int nReplicas() const
Definition: DDDivision.cc:71
static const double tolerance(void)
double width() const
Definition: DDDivision.cc:76
virtual DDDividedGeometryObject::~DDDividedGeometryObject ( void  )
virtualdefault

Member Function Documentation

int DDDividedGeometryObject::calculateNDiv ( double  motherDim,
double  width,
double  offset 
) const
protected
double DDDividedGeometryObject::calculateWidth ( double  motherDim,
int  nDiv,
double  offset 
) const
protected
DDRotationMatrix * DDDividedGeometryObject::changeRotMatrix ( double  rotZ = 0.) const
protected

Definition at line 33 of file DDDividedGeometryObject.cc.

References submit::rm.

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

34 {
35  DDRotationMatrix * rm = new DDRotationMatrix(ROOT::Math::RotationZ(rotZ));
36  return rm;
37 }
rm
Definition: submit.py:76
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
void DDDividedGeometryObject::checkNDivAndWidth ( double  maxPar)
protected

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

81 {
83  && (div_.offset() + compWidth_*compNDiv_ - maxPar > tolerance() ) )
84  {
85  std::string s = "ERROR - DDDividedGeometryObject::checkNDivAndWidth()";
86  s+= "\n Division of LogicalPart " + div_.parent().name().name();
87  s+= " has too big an offset.";
88 
89  std::cout << compWidth_ << std::endl;
90  throw cms::Exception("DDException") << s;
91  }
92 }
const N & name() const
Definition: DDBase.h:78
double offset() const
Definition: DDDivision.cc:81
static const double tolerance(void)
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
void DDDividedGeometryObject::checkOffset ( double  maxPar)
protected

Definition at line 67 of file DDDividedGeometryObject.cc.

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

Referenced by checkParametersValidity().

68 {
69  if( div_.offset() >= maxPar )
70  {
71  std::string s = "DDDividedGeometryObject::checkOffset() IllegalConstruct";
72  s += "\nERROR - DDDividedGeometryObject::checkOffset()";
73  s += "\n failed.";
74  s += " Too big an offset.";
75  throw cms::Exception("DDException") << s;
76  }
77 }
double offset() const
Definition: DDDivision.cc:81
void DDDividedGeometryObject::checkParametersValidity ( void  )
protectedvirtual

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

Definition at line 52 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 DDDividedTrdX::checkParametersValidity(), DDDividedPolyhedraRho::checkParametersValidity(), DDDividedPolyconeRho::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), DDDividedPolyconePhi::checkParametersValidity(), DDDividedPolyhedraPhi::checkParametersValidity(), DDDividedTrdZ::checkParametersValidity(), DDDividedPolyconeZ::checkParametersValidity(), DDDividedPolyhedraZ::checkParametersValidity(), DDDividedBoxX::DDDividedBoxX(), DDDividedBoxY::DDDividedBoxY(), DDDividedBoxZ::DDDividedBoxZ(), DDDividedConsPhi::DDDividedConsPhi(), DDDividedConsRho::DDDividedConsRho(), DDDividedConsZ::DDDividedConsZ(), DDDividedTubsPhi::DDDividedTubsPhi(), DDDividedTubsRho::DDDividedTubsRho(), and DDDividedTubsZ::DDDividedTubsZ().

53 {
54  double maxPar = getMaxParameter();
55  checkOffset( maxPar );
56  checkNDivAndWidth( maxPar );
57  if (!div_.parent().isDefined().second) {
58  std::string s = "DDDividedGeometryObject::checkParametersValidity() :";
59  s+= "\n ERROR - the LogicalPart of the parent must be ";
60  s+= "\n defined before a division can occur.";
61  s+= "\n Parent= " + div_.parent().toString();
62  throw cms::Exception("DDException") << s;
63  }
64 }
def_type isDefined() const
Definition: DDBase.h:110
virtual double getMaxParameter(void) const
std::string toString() const
Definition: DDBase.h:82
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
void checkNDivAndWidth(double maxPar)
void DDDividedGeometryObject::execute ( void  )
virtual

Definition at line 115 of file DDDividedGeometryObject.cc.

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

Referenced by DDLDivision::processElement().

116 {
118  {
120  div_.parent(),
121  i,
122  makeDDTranslation( i ),
123  makeDDRotation( i ),
124  &div_ );
125  }
126 }
virtual DDLogicalPart makeDDLogicalPart(const int copyNo) const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
virtual DDTranslation makeDDTranslation(const int copyNo) const
virtual DDRotation makeDDRotation(const int copyNo) const
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
double DDDividedGeometryObject::getMaxParameter ( void  ) const
protectedvirtual
const std::string & DDDividedGeometryObject::getType ( void  ) const
virtual
DDLogicalPart DDDividedGeometryObject::makeDDLogicalPart ( const int  copyNo) const
virtual
DDRotation DDDividedGeometryObject::makeDDRotation ( const int  copyNo) const
virtual
DDTranslation DDDividedGeometryObject::makeDDTranslation ( const int  copyNo) const
virtual
void DDDividedGeometryObject::setType ( const std::string &  type)
virtual
const double DDDividedGeometryObject::tolerance ( void  )
static

Definition at line 95 of file DDDividedGeometryObject.cc.

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

96 {
97  // this can come from some global tolerance if you want.
98  static const double tol = 1.0/1000.00;
99  return tol;
100 }
int DDDividedGeometryObject::volumeFirstCopyNo ( void  ) const

Member Data Documentation

int DDDividedGeometryObject::compNDiv_
protected
double DDDividedGeometryObject::compWidth_
protected

Definition at line 66 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(), DDDividedTrdX::makeDDLogicalPart(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedConsRho::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedTubsPhi::makeDDRotation(), DDDividedConsPhi::makeDDRotation(), DDDividedPolyconePhi::makeDDRotation(), DDDividedPolyhedraPhi::makeDDRotation(), DDDividedTrdX::makeDDTranslation(), DDDividedBoxX::makeDDTranslation(), DDDividedTrdY::makeDDTranslation(), DDDividedBoxY::makeDDTranslation(), DDDividedConsZ::makeDDTranslation(), DDDividedTubsZ::makeDDTranslation(), DDDividedBoxZ::makeDDTranslation(), and DDDividedTrdZ::makeDDTranslation().

DDCompactView* DDDividedGeometryObject::cpv_
protected

Definition at line 69 of file DDDividedGeometryObject.h.

Referenced by execute().

DDDivision DDDividedGeometryObject::div_
protected

Definition at line 63 of file DDDividedGeometryObject.h.

Referenced by checkNDivAndWidth(), checkOffset(), DDDividedTrdX::checkParametersValidity(), DDDividedPolyhedraRho::checkParametersValidity(), DDDividedPolyconeRho::checkParametersValidity(), DDDividedTrdY::checkParametersValidity(), DDDividedPolyhedraPhi::checkParametersValidity(), DDDividedTrdZ::checkParametersValidity(), DDDividedPolyconeZ::checkParametersValidity(), checkParametersValidity(), DDDividedPolyhedraZ::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(), DDDividedConsRho::getMaxParameter(), DDDividedTrdX::getMaxParameter(), DDDividedBoxX::getMaxParameter(), DDDividedPolyconeRho::getMaxParameter(), DDDividedPolyhedraRho::getMaxParameter(), DDDividedConsPhi::getMaxParameter(), DDDividedTubsPhi::getMaxParameter(), DDDividedTrdY::getMaxParameter(), DDDividedBoxY::getMaxParameter(), DDDividedPolyconePhi::getMaxParameter(), DDDividedPolyhedraPhi::getMaxParameter(), DDDividedTubsZ::getMaxParameter(), DDDividedConsZ::getMaxParameter(), DDDividedBoxZ::getMaxParameter(), DDDividedTrdZ::getMaxParameter(), DDDividedPolyconeZ::getMaxParameter(), DDDividedPolyhedraZ::getMaxParameter(), DDDividedConsRho::makeDDLogicalPart(), DDDividedTubsRho::makeDDLogicalPart(), DDDividedTrdX::makeDDLogicalPart(), DDDividedBoxX::makeDDLogicalPart(), DDDividedPolyconeRho::makeDDLogicalPart(), DDDividedPolyhedraRho::makeDDLogicalPart(), makeDDLogicalPart(), DDDividedTubsPhi::makeDDLogicalPart(), DDDividedConsPhi::makeDDLogicalPart(), DDDividedBoxY::makeDDLogicalPart(), DDDividedTrdY::makeDDLogicalPart(), DDDividedPolyconePhi::makeDDLogicalPart(), DDDividedPolyhedraPhi::makeDDLogicalPart(), DDDividedTubsZ::makeDDLogicalPart(), DDDividedConsZ::makeDDLogicalPart(), DDDividedBoxZ::makeDDLogicalPart(), DDDividedTrdZ::makeDDLogicalPart(), DDDividedPolyconeZ::makeDDLogicalPart(), DDDividedPolyhedraZ::makeDDLogicalPart(), DDDividedTubsPhi::makeDDRotation(), DDDividedConsPhi::makeDDRotation(), DDDividedPolyconePhi::makeDDRotation(), DDDividedPolyhedraPhi::makeDDRotation(), DDDividedTrdX::makeDDTranslation(), DDDividedBoxX::makeDDTranslation(), DDDividedTrdY::makeDDTranslation(), DDDividedBoxY::makeDDTranslation(), DDDividedTubsZ::makeDDTranslation(), DDDividedConsZ::makeDDTranslation(), DDDividedBoxZ::makeDDTranslation(), DDDividedTrdZ::makeDDTranslation(), DDDividedPolyconeZ::makeDDTranslation(), and DDDividedPolyhedraZ::makeDDTranslation().

DivisionType DDDividedGeometryObject::divisionType_
protected
std::string DDDividedGeometryObject::ftype_
protected

Definition at line 64 of file DDDividedGeometryObject.h.

Referenced by getType(), and setType().

int DDDividedGeometryObject::theVoluFirstCopyNo_
protected

Definition at line 68 of file DDDividedGeometryObject.h.

Referenced by execute().