CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 

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 22 of file DDDividedGeometryObject.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file DDDividedGeometryObject.cc.

References DCOUT_V, 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  DCOUT_V( 'P', " DDDividedGeometryObject Divisions " << div_ << std::endl );
30 }
int nReplicas() const
Definition: DDDivision.cc:71
static const double tolerance(void)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
double width() const
Definition: DDDivision.cc:76
DDDividedGeometryObject::~DDDividedGeometryObject ( void  )
virtual

Definition at line 32 of file DDDividedGeometryObject.cc.

33 {}

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 36 of file DDDividedGeometryObject.cc.

References submit::rm.

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

37 {
38  DDRotationMatrix * rm = new DDRotationMatrix(ROOT::Math::RotationZ(rotZ));
39  return rm;
40 }
string 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 87 of file DDDividedGeometryObject.cc.

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

Referenced by checkParametersValidity().

88 {
90  && (div_.offset() + compWidth_*compNDiv_ - maxPar > tolerance() ) )
91  {
92  std::string s = "ERROR - DDDividedGeometryObject::checkNDivAndWidth()";
93  s+= "\n Division of LogicalPart " + div_.parent().name().name();
94  s+= " has too big an offset.";
95  DCOUT_V('P', "DDDividedGeometryObject::checkNDivAndWidth has computed div_.offset() + compWidth_*compNDiv_ - maxPar =" << div_.offset() + compWidth_*compNDiv_ - maxPar << " and tolerance()=" << tolerance());
96  std::cout << compWidth_ << std::endl;
97  throw cms::Exception("DDException") << s;
98  }
99 }
const N & name() const
Definition: DDBase.h:78
double offset() const
Definition: DDDivision.cc:81
static const double tolerance(void)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
tuple cout
Definition: gather_cfg.py:121
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
void DDDividedGeometryObject::checkOffset ( double  maxPar)
protected

Definition at line 73 of file DDDividedGeometryObject.cc.

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

Referenced by checkParametersValidity().

74 {
75  if( div_.offset() >= maxPar )
76  {
77  DCOUT_V('P', "DDDividedGeometryObject::checkOffset() Division of LogicalPart " << div_.parent() << " offset=" << div_.offset() << " maxPar=" << maxPar << "\n");
78  std::string s = "DDDividedGeometryObject::checkOffset() IllegalConstruct";
79  s += "\nERROR - DDDividedGeometryObject::checkOffset()";
80  s += "\n failed.";
81  s += " Too big an offset.";
82  throw cms::Exception("DDException") << s;
83  }
84 }
double offset() const
Definition: DDDivision.cc:81
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const DDLogicalPart & parent() const
Definition: DDDivision.cc:86
void DDDividedGeometryObject::checkParametersValidity ( void  )
protectedvirtual

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

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

59 {
60  double maxPar = getMaxParameter();
61  checkOffset( maxPar );
62  checkNDivAndWidth( maxPar );
63  if (!div_.parent().isDefined().second) {
64  std::string s = "DDDividedGeometryObject::checkParametersValidity() :";
65  s+= "\n ERROR - the LogicalPart of the parent must be ";
66  s+= "\n defined before a division can occur.";
67  s+= "\n Parent= " + div_.parent().toString();
68  throw cms::Exception("DDException") << s;
69  }
70 }
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 122 of file DDDividedGeometryObject.cc.

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

Referenced by DDLDivision::processElement().

123 {
124  DCOUT_V( 'D', "about to make " << compNDiv_ << " divisions." << std::endl );
126  {
127  DCOUT_V( 'D', "Parent Volume: " << div_.parent() << std::endl );
128  DCOUT_V( 'D', "Child Volume: " << makeDDLogicalPart(i) << std::endl );
129  DCOUT_V( 'D', " copyNo:" << i << std::endl );
130  DCOUT_V( 'D', " Translation: " << makeDDTranslation(i) << std::endl );
131  DCOUT_V( 'D', " rotation=" << makeDDRotation(i) << std::endl );
132 
134  div_.parent(),
135  i,
136  makeDDTranslation( i ),
137  makeDDRotation( i ),
138  &div_ );
139  }
140 }
virtual DDLogicalPart makeDDLogicalPart(const int copyNo) const
int i
Definition: DBlmapReader.cc:9
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
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
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 102 of file DDDividedGeometryObject.cc.

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

103 {
104  // this can come from some global tolerance if you want.
105  static const double tol = 1.0/1000.00;
106  return tol;
107 }
int DDDividedGeometryObject::volumeFirstCopyNo ( void  ) const

Member Data Documentation

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

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

DDCompactView* DDDividedGeometryObject::cpv_
protected

Definition at line 66 of file DDDividedGeometryObject.h.

Referenced by execute().

DDDivision DDDividedGeometryObject::div_
protected

Definition at line 60 of file DDDividedGeometryObject.h.

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

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

Definition at line 61 of file DDDividedGeometryObject.h.

Referenced by getType(), and setType().

int DDDividedGeometryObject::theVoluFirstCopyNo_
protected

Definition at line 65 of file DDDividedGeometryObject.h.

Referenced by execute().