test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDExpandedNode.h
Go to the documentation of this file.
1 #ifndef DDExpandedNode_h
2 #define DDExpandedNode_h
3 
7 #include <vector>
8 #include <iosfwd>
9 
10 class DDExpandedView;
11 struct DDPosData;
12 
15 {
16  friend class DDExpandedView;
17 
18 public:
19  DDExpandedNode(const DDLogicalPart & lp,
20  const DDPosData * pd,
21  const DDTranslation & t,
22  const DDRotationMatrix & r,
23  int siblingno);
24 
26 
27 
28  bool operator==(const DDExpandedNode & n) const;
29 
31  const DDLogicalPart & logicalPart() const { return logp_; }
32 
33 
35  const DDTranslation & absTranslation() const { return trans_; }
36 
37 
39  const DDRotationMatrix & absRotation() const { return rot_; }
40 
42  int copyno() const;
43 
45  int siblingno() const { return siblingno_; }
46 
47 
48  const DDPosData * posdata() const { return posd_; }
49 
50 private:
51  DDLogicalPart logp_; // logicalpart to provide access to solid & material information
52  const DDPosData * posd_;
53  DDTranslation trans_; // absolute translation
54  DDRotationMatrix rot_; // absolute rotation
55  int siblingno_; // internal sibling-numbering from 0 to max-sibling
56 };
57 
58 
59 
61 
65 {
66 
67  bool operator()(const DDExpandedNode & n1, const DDExpandedNode & n2)
68  {
69  const DDTranslation & t1 = n1.absTranslation();
70  const DDTranslation & t2 = n2.absTranslation();
71 
72  bool result = false;
73 
74  // 'alphabetical ordering' according to absolute position
75 
76  if (t1.z() < t2.z())
77  {
78  result=true;
79  }
80  else if ( (t1.z()==t2.z()) && (t1.y() < t2.y()))
81  {
82  result=true;
83  }
84  else if ( (t1.z()==t2.z()) && (t1.y()==t2.y()) && (t1.x()<t2.x()))
85  {
86  result=true;
87  }
88  else if (n1.siblingno() < n2.siblingno())
89  {
90  result=true;
91  }
92  else if (n1.logicalPart().ddname() < n2.logicalPart().ddname())
93  {
94  result=true;
95  }
96 
97  return result;
98  }
99 
100 };
101 
102 
104 typedef std::vector<DDExpandedNode> DDGeoHistory;
105 
106 std::ostream & operator<<(std::ostream &, const DDExpandedNode &);
107 std::ostream & operator<<(std::ostream &, const DDGeoHistory &);
108 #endif
109 
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
const DDPosData * posd_
represents one node in the DDExpandedView
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
tuple result
Definition: mps_fire.py:84
DDRotationMatrix rot_
DDTranslation trans_
function object to compare to ExpandedNodes
bool operator()(const DDExpandedNode &n1, const DDExpandedNode &n2)
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
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)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const DDLogicalPart & logicalPart() const
the LogicalPart describing this node
const N & ddname() const
Definition: DDBase.h:80