CMS 3D CMS Logo

DDExpandedNode.h
Go to the documentation of this file.
1 #ifndef DDExpandedNode_h
2 #define DDExpandedNode_h
3 
4 #include <iosfwd>
5 #include <vector>
6 
11 
12 class DDExpandedView;
13 struct DDPosData;
14 
17  friend class DDExpandedView;
18 
19 public:
21  const DDLogicalPart &lp, const DDPosData *pd, const DDTranslation &t, const DDRotationMatrix &r, int siblingno);
22 
24 
25  bool operator==(const DDExpandedNode &n) const;
26 
28  const DDLogicalPart &logicalPart() const { return logp_; }
29 
31  const DDTranslation &absTranslation() const { return trans_; }
32 
34  const DDRotationMatrix &absRotation() const { return rot_; }
35 
37  int copyno() const;
38 
40  int siblingno() const { return siblingno_; }
41 
42  const DDPosData *posdata() const { return posd_; }
43 
44 private:
45  DDLogicalPart logp_; // logicalpart to provide access to solid & material information
46  const DDPosData *posd_;
47  DDTranslation trans_; // absolute translation
48  DDRotationMatrix rot_; // absolute rotation
49  int siblingno_; // internal sibling-numbering from 0 to max-sibling
50 };
51 
53 
57  bool operator()(const DDExpandedNode &n1, const DDExpandedNode &n2) {
58  const DDTranslation &t1 = n1.absTranslation();
59  const DDTranslation &t2 = n2.absTranslation();
60 
61  bool result = false;
62 
63  // 'alphabetical ordering' according to absolute position
64 
65  if (t1.z() < t2.z()) {
66  result = true;
67  } else if ((t1.z() == t2.z()) && (t1.y() < t2.y())) {
68  result = true;
69  } else if ((t1.z() == t2.z()) && (t1.y() == t2.y()) && (t1.x() < t2.x())) {
70  result = true;
71  } else if (n1.siblingno() < n2.siblingno()) {
72  result = true;
73  } else if (n1.logicalPart().ddname() < n2.logicalPart().ddname()) {
74  result = true;
75  }
76 
77  return result;
78  }
79 };
80 
82 typedef std::vector<DDExpandedNode> DDGeoHistory;
83 
84 std::ostream &operator<<(std::ostream &, const DDExpandedNode &);
85 std::ostream &operator<<(std::ostream &, const DDGeoHistory &);
86 #endif
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
const DDTranslation & absTranslation() const
absolute translation of this node
DDExpandedNode(const DDLogicalPart &lp, const DDPosData *pd, const DDTranslation &t, const DDRotationMatrix &r, int siblingno)
const DDPosData * posdata() const
std::ostream & operator<<(std::ostream &, const DDExpandedNode &)
const DDPosData * posd_
represents one node in the DDExpandedView
DDRotationMatrix rot_
DDTranslation trans_
function object to compare to ExpandedNodes
bool operator()(const DDExpandedNode &n1, const DDExpandedNode &n2)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const DDRotationMatrix & absRotation() const
absolute rotation of this node
int copyno() const
copy number of this node
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
const N & ddname() const
Definition: DDBase.h:60
DDLogicalPart logp_
int siblingno() const
sibling number of this node
bool operator==(const DDExpandedNode &n) const
Provides an exploded view of the detector (tree-view)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
const DDLogicalPart & logicalPart() const
the LogicalPart describing this node