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

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

17  : div_( div ),
18  ftype_(),
19  compNDiv_( div.nReplicas()),
20  compWidth_( div.width()),
23  cpv_( cpv )
24 {
25  if( div_.nReplicas() == 0 || div_.width() < tolerance())
26  {
27  if( div_.width() < tolerance())
29  else
31  }
32  DCOUT_V( 'P', " DDDividedGeometryObject Divisions " << div_ << std::endl );
33 }
const int nReplicas() const
Definition: DDDivision.cc:90
static const double tolerance(void)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const double width() const
Definition: DDDivision.cc:95
DDDividedGeometryObject::~DDDividedGeometryObject ( void  )
virtual

Definition at line 35 of file DDDividedGeometryObject.cc.

36 {}

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

References submit::rm.

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

40 {
41  DDRotationMatrix * rm = new DDRotationMatrix(ROOT::Math::RotationZ(rotZ));
42  return rm;
43 }
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 90 of file DDDividedGeometryObject.cc.

References compNDiv_, compWidth_, gather_cfg::cout, DCOUT_V, div_, divisionType_, DivNDIVandWIDTH, DDDivision::offset(), DDDivision::parent(), asciidump::s, and tolerance().

Referenced by checkParametersValidity().

91 {
93  && (div_.offset() + compWidth_*compNDiv_ - maxPar > tolerance() ) )
94  {
95  std::string s = "ERROR - DDDividedGeometryObject::checkNDivAndWidth()";
96  s+= "\n Division of LogicalPart " + div_.parent();
97  s+= " has too big an offset.";
98  DCOUT_V('P', "DDDividedGeometryObject::checkNDivAndWidth has computed div_.offset() + compWidth_*compNDiv_ - maxPar =" << div_.offset() + compWidth_*compNDiv_ - maxPar << " and tolerance()=" << tolerance());
99  std::cout << compWidth_ << std::endl;
100  throw DDException(s);
101  }
102 }
An exception for DDD errors.
Definition: DDException.h:23
static const double tolerance(void)
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const double offset() const
Definition: DDDivision.cc:100
tuple cout
Definition: gather_cfg.py:41
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
string s
Definition: asciidump.py:422
void DDDividedGeometryObject::checkOffset ( double  maxPar)
protected

Definition at line 76 of file DDDividedGeometryObject.cc.

References DCOUT_V, div_, DDDivision::offset(), DDDivision::parent(), and asciidump::s.

Referenced by checkParametersValidity().

77 {
78  if( div_.offset() >= maxPar )
79  {
80  DCOUT_V('P', "DDDividedGeometryObject::checkOffset() Division of LogicalPart " << div_.parent() << " offset=" << div_.offset() << " maxPar=" << maxPar << "\n");
81  std::string s = "DDDividedGeometryObject::checkOffset() IllegalConstruct";
82  s += "\nERROR - DDDividedGeometryObject::checkOffset()";
83  s += "\n failed.";
84  s += " Too big an offset.";
85  throw DDException(s);
86  }
87 }
An exception for DDD errors.
Definition: DDException.h:23
#define DCOUT_V(M_v_Y, M_v_S)
Definition: DDdebug.h:54
const double offset() const
Definition: DDDivision.cc:100
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
string s
Definition: asciidump.py:422
void DDDividedGeometryObject::checkParametersValidity ( void  )
protectedvirtual

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

Definition at line 61 of file DDDividedGeometryObject.cc.

References checkNDivAndWidth(), checkOffset(), div_, getMaxParameter(), DDBase< N, C >::isDefined(), DDDivision::parent(), asciidump::s, 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().

62 {
63  double maxPar = getMaxParameter();
64  checkOffset( maxPar );
65  checkNDivAndWidth( maxPar );
66  if (!div_.parent().isDefined().second) {
67  std::string s = "DDDividedGeometryObject::checkParametersValidity() :";
68  s+= "\n ERROR - the LogicalPart of the parent must be ";
69  s+= "\n defined before a division can occur.";
70  s+= "\n Parent= " + div_.parent().toString();
71  throw DDException(s);
72  }
73 }
def_type isDefined() const
Definition: DDBase.h:121
virtual double getMaxParameter(void) const
An exception for DDD errors.
Definition: DDException.h:23
std::string toString() const
Definition: DDBase.h:92
const DDLogicalPart & parent() const
Definition: DDDivision.cc:105
string s
Definition: asciidump.py:422
void checkNDivAndWidth(double maxPar)
void DDDividedGeometryObject::execute ( void  )
virtual

Definition at line 125 of file DDDividedGeometryObject.cc.

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

Referenced by DDLDivision::processElement().

126 {
127  DCOUT_V( 'D', "about to make " << compNDiv_ << " divisions." << std::endl );
129  {
130  DCOUT_V( 'D', "Parent Volume: " << div_.parent() << std::endl );
131  DCOUT_V( 'D', "Child Volume: " << makeDDLogicalPart(i) << std::endl );
132  DCOUT_V( 'D', " copyNo:" << i << std::endl );
133  DCOUT_V( 'D', " Translation: " << makeDDTranslation(i) << std::endl );
134  DCOUT_V( 'D', " rotation=" << makeDDRotation(i) << std::endl );
135 
137  div_.parent(),
138  i,
139  makeDDTranslation( i ),
140  makeDDRotation( i ),
141  &div_ );
142  }
143 }
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:105
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 105 of file DDDividedGeometryObject.cc.

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

106 {
107  // this can come from some global tolerance if you want.
108  static const double tol = 1.0/1000.00;
109  return tol;
110 }
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().