CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDPosData.h
Go to the documentation of this file.
1 #ifndef DDPosData_h
2 #define DDPosData_h
3 
6 //#include "DetectorDescription/Base/interface/DDException.h"
8 
10 
16 struct DDPosData
17 {
19 
26  DDPosData(const DDTranslation & t, const DDRotation& r, int c, const DDDivision * d = NULL ) //(mec:2007-06-07) tried = 0 when i did the delete in destructor... no help/difference.
27  : trans_(t), rot_(r), replication_(0), copyno_(c), div_(d)
28  {
29  //if (!rot_.rotation()) throw DDException("rotation not defined: [" + rot_.ns() + ":" + rot_.name() +"]" );
30  }
31 
32  /* Prior to this attempt do only delete div_ if it existed, we had less lost memory (mec:2007-06-07)
33  ~DDPosData() {
34  // delete &trans_;
35  if ( div_ == 0 ) delete div_;
36  } */
37  const DDTranslation & translation() const { return trans_; }
38  const DDTranslation & trans() const { return trans_; }
39 
40  const DDRotationMatrix & rotation() const { return *(rot_.rotation()); }
41  const DDRotationMatrix & rot() const { return *(rot_.rotation()); }
42 
43  const DDDivision & div() const { return *div_; }
44  const DDDivision & division() const { return *div_; }
45 
46  //const DDTranslation & trans_; /**< relative translation std::vector */
50  //FIXME: DDPosData: replication_ provide a design!
51  void * replication_;
52  int copyno_;
53  const DDDivision * div_;
55 private:
56  DDPosData();
57  DDPosData & operator=(const DDPosData &);
58 };
59 #endif
const DDRotationMatrix * rotation() const
Returns the read-only rotation-matrix.
Definition: DDTransform.h:90
DDPosData(const DDTranslation &t, const DDRotation &r, int c, const DDDivision *d=NULL)
Creates a new relative position.
Definition: DDPosData.h:26
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:16
#define NULL
Definition: scimark2.h:8
const DDDivision * div_
Definition: DDPosData.h:53
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
const DDRotationMatrix & rot() const
Definition: DDPosData.h:41
int copyno_
Definition: DDPosData.h:52
const DDDivision & division() const
Definition: DDPosData.h:44
const DDTranslation & trans() const
Definition: DDPosData.h:38
DDTranslation trans_
Definition: DDPosData.h:47
const DDTranslation & translation() const
Definition: DDPosData.h:37
const DDDivision & div() const
Definition: DDPosData.h:43
DDPosData & operator=(const DDPosData &)
void * replication_
Definition: DDPosData.h:51
const DDRotationMatrix & rotation() const
Definition: DDPosData.h:40
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
DDRotation rot_
Definition: DDPosData.h:49