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 {
18  friend class DDExpandedView;
19 
20 public:
21  DDExpandedNode(const DDLogicalPart & lp,
22  const DDPosData * pd,
23  const DDTranslation & t,
24  const DDRotationMatrix & r,
25  int siblingno);
26 
28 
29 
30  bool operator==(const DDExpandedNode & n) const;
31 
33  const DDLogicalPart & logicalPart() const { return logp_; }
34 
35 
37  const DDTranslation & absTranslation() const { return trans_; }
38 
39 
41  const DDRotationMatrix & absRotation() const { return rot_; }
42 
44  int copyno() const;
45 
47  int siblingno() const { return siblingno_; }
48 
49 
50  const DDPosData * posdata() const { return posd_; }
51 
52 private:
53  DDLogicalPart logp_; // logicalpart to provide access to solid & material information
54  const DDPosData * posd_;
55  DDTranslation trans_; // absolute translation
56  DDRotationMatrix rot_; // absolute rotation
57  int siblingno_; // internal sibling-numbering from 0 to max-sibling
58 };
59 
60 
61 
63 
67 {
68 
69  bool operator()(const DDExpandedNode & n1, const DDExpandedNode & n2)
70  {
71  const DDTranslation & t1 = n1.absTranslation();
72  const DDTranslation & t2 = n2.absTranslation();
73 
74  bool result = false;
75 
76  // 'alphabetical ordering' according to absolute position
77 
78  if (t1.z() < t2.z())
79  {
80  result=true;
81  }
82  else if ( (t1.z()==t2.z()) && (t1.y() < t2.y()))
83  {
84  result=true;
85  }
86  else if ( (t1.z()==t2.z()) && (t1.y()==t2.y()) && (t1.x()<t2.x()))
87  {
88  result=true;
89  }
90  else if (n1.siblingno() < n2.siblingno())
91  {
92  result=true;
93  }
94  else if (n1.logicalPart().ddname() < n2.logicalPart().ddname())
95  {
96  result=true;
97  }
98 
99  return result;
100  }
101 
102 };
103 
104 
106 typedef std::vector<DDExpandedNode> DDGeoHistory;
107 
108 std::ostream & operator<<(std::ostream &, const DDExpandedNode &);
109 std::ostream & operator<<(std::ostream &, const DDGeoHistory &);
110 #endif
111 
const DDTranslation & absTranslation() const
absolute translation of this node
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
DDExpandedNode(const DDLogicalPart &lp, const DDPosData *pd, const DDTranslation &t, const DDRotationMatrix &r, int siblingno)
const DDRotationMatrix & absRotation() const
absolute rotation of this node
std::ostream & operator<<(std::ostream &, const DDExpandedNode &)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const DDPosData * posd_
represents one node in the DDExpandedView
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDRotationMatrix rot_
DDTranslation trans_
function object to compare to ExpandedNodes
bool operator()(const DDExpandedNode &n1, const DDExpandedNode &n2)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const DDPosData * posdata() const
std::vector< DDExpandedNode > DDGeoHistory
Geometrical &#39;path&#39; of the current node up to the root-node.
int copyno() const
copy number of this node
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)
const DDLogicalPart & logicalPart() const
the LogicalPart describing this node
const N & ddname() const
Definition: DDBase.h:76