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
 
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 ( const DDDivision div,
DDCompactView cpv 
)

Definition at line 13 of file DDDividedGeometryObject.cc.

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

14  : div_( div ),
15  ftype_(),
16  compNDiv_( div.nReplicas()),
17  compWidth_( div.width()),
20  cpv_( cpv )
21 {
22  if( div_.nReplicas() == 0 || div_.width() < tolerance())
23  {
24  if( div_.width() < tolerance())
26  else
28  }
29 }
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 32 of file DDDividedGeometryObject.cc.

References submit::rm.

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

33 {
34  DDRotationMatrix * rm = new DDRotationMatrix(ROOT::Math::RotationZ(rotZ));
35  return rm;
36 }
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 79 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().

80 {
82  && (div_.offset() + compWidth_*compNDiv_ - maxPar > tolerance() ) )
83  {
84  std::string s = "ERROR - DDDividedGeometryObject::checkNDivAndWidth()";
85  s+= "\n Division of LogicalPart " + div_.parent().name().name();
86  s+= " has too big an offset.";
87 
88  std::cout << compWidth_ << std::endl;
89  throw cms::Exception("DDException") << s;
90  }
91 }
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 66 of file DDDividedGeometryObject.cc.

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

Referenced by checkParametersValidity().

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

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

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

52 {
53  double maxPar = getMaxParameter();
54  checkOffset( maxPar );
55  checkNDivAndWidth( maxPar );
56  if (!div_.parent().isDefined().second) {
57  std::string s = "DDDividedGeometryObject::checkParametersValidity() :";
58  s+= "\n ERROR - the LogicalPart of the parent must be ";
59  s+= "\n defined before a division can occur.";
60  s+= "\n Parent= " + div_.parent().toString();
61  throw cms::Exception("DDException") << s;
62  }
63 }
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 114 of file DDDividedGeometryObject.cc.

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

Referenced by DDLDivision::processElement().

115 {
117  {
119  div_.parent(),
120  i,
121  makeDDTranslation( i ),
122  makeDDRotation( i ),
123  &div_ );
124  }
125 }
virtual DDTranslation makeDDTranslation(int copyNo) const
virtual DDRotation makeDDRotation(int copyNo) const
virtual DDLogicalPart makeDDLogicalPart(int copyNo) const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
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 ( int  copyNo) const
virtual
DDRotation DDDividedGeometryObject::makeDDRotation ( int  copyNo) const
virtual
DDTranslation DDDividedGeometryObject::makeDDTranslation ( int  copyNo) const
virtual
void DDDividedGeometryObject::setType ( const std::string &  type)
virtual
const double DDDividedGeometryObject::tolerance ( void  )
static

Definition at line 94 of file DDDividedGeometryObject.cc.

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

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

Member Data Documentation

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

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

DDCompactView* DDDividedGeometryObject::cpv_
protected

Definition at line 64 of file DDDividedGeometryObject.h.

Referenced by execute().

DDDivision DDDividedGeometryObject::div_
protected

Definition at line 58 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 DDDividedGeometryObject::divisionType_
protected
std::string DDDividedGeometryObject::ftype_
protected

Definition at line 59 of file DDDividedGeometryObject.h.

Referenced by getType(), and setType().

int DDDividedGeometryObject::theVoluFirstCopyNo_
protected

Definition at line 63 of file DDDividedGeometryObject.h.

Referenced by execute().