CMS 3D CMS Logo

DDExpandedView.h
Go to the documentation of this file.
1 #ifndef DDExpandedView_h
2 #define DDExpandedView_h
3 
4 #include <cstddef>
5 #include <iosfwd>
6 #include <map>
7 #include <string>
8 #include <utility>
9 #include <vector>
10 
20 
21 class DDFilteredView;
22 class DDLogicalPart;
23 struct DDPosData;
24 
35 
42  friend class DDFilteredView;
43 
44 public:
46 
48  typedef std::vector<int> nav_type;
49  typedef std::pair<int const *, size_t> NavRange;
50 
53 
54  virtual ~DDExpandedView();
55 
57  const DDLogicalPart &logicalPart() const;
58 
60  const std::string &name() const;
61 
63  const DDTranslation &translation() const;
64 
66  const DDRotationMatrix &rotation() const;
67 
69  const DDGeoHistory &geoHistory() const;
70 
72  bool goTo(const nav_type &);
73  bool goTo(NavRange);
74  bool goTo(int const *newpos, size_t sz);
75 
77  nav_type navPos() const;
78 
80  nav_type copyNumbers() const;
81 
83  std::vector<const DDsvalues_type *> specifics() const;
84  void specificsV(std::vector<const DDsvalues_type *> &vc) const;
85 
87  void mergedSpecificsV(DDsvalues_type &res) const;
88 
90  std::vector<double> const &vector(std::string_view iKey) const { return cpv_->vector(iKey); }
91 
93  int copyno() const;
94 
95  // navigation
96 
98  const DDGeoHistory &scope() const;
99 
101  bool setScope(const DDGeoHistory &hist, int depth = 0);
102 
104  void clearScope();
105 
107  int depth() const;
108 
110  bool next();
111 
113  bool nextB();
114 
116  bool nextSibling();
117 
119  bool firstChild();
120 
122  bool parent();
123 
125  //bool hasChildren() const;
126 
128  void reset();
129 
130  /* was protected, now public; was named goTo, now goToHistory*/
131  bool goToHistory(const DDGeoHistory &sc);
132 
133 protected:
134  bool descend(const DDGeoHistory &sc);
135 
136 protected:
143  unsigned int depth_;
145  std::vector<nav_type> nextBStack_;
147 };
148 
149 std::string printNavType(int const *n, size_t sz);
150 inline std::ostream &operator<<(std::ostream &os, const DDExpandedView::nav_type &n) {
151  os << printNavType(&n.front(), n.size());
152  return os;
153 }
154 inline std::ostream &operator<<(std::ostream &os, const DDExpandedView::NavRange &n) {
155  os << printNavType(n.first, n.second);
156  return os;
157 }
158 #endif
DDExpandedView::depth_
unsigned int depth_
depth of the scope, 0==unrestricted depth
Definition: DDExpandedView.h:143
DDExpandedView::nextB
bool nextB()
broad search order of next()
Definition: DDExpandedView.cc:193
DDExpandedView::copyNumbers
nav_type copyNumbers() const
return the stack of copy numbers
Definition: DDExpandedView.cc:425
DDGeoHistory
std::vector< DDExpandedNode > DDGeoHistory
Geometrical 'path' of the current node up to the root-node.
Definition: DDExpandedNode.h:82
DDExpandedView::scope
const DDGeoHistory & scope() const
The scope of the expanded-view.
Definition: DDExpandedView.cc:261
DDTransform.h
DDExpandedView::vector
const std::vector< double > & vector(std::string_view iKey) const
The DDVector information.
Definition: DDExpandedView.h:90
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DDExpandedView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDExpandedView.cc:48
DDExpandedView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDExpandedView.cc:101
DDExpandedView::specifics
std::vector< const DDsvalues_type * > specifics() const
User specific data attached to the current node.
Definition: DDExpandedView.cc:215
DDExpandedView::mergedSpecifics
DDsvalues_type mergedSpecifics() const
Definition: DDExpandedView.cc:237
math::GraphWalker
Definition: GraphWalker.h:12
DDExpandedView::mergedSpecificsV
void mergedSpecificsV(DDsvalues_type &res) const
Definition: DDExpandedView.cc:243
DDExpandedView::nav_type
std::vector< int > nav_type
std::vector of sibling numbers
Definition: DDExpandedView.h:48
printNavType
std::string printNavType(int const *n, size_t sz)
Definition: DDExpandedView.cc:436
DDExpandedView::rot_
const DDRotationMatrix rot_
Definition: DDExpandedView.h:140
DDExpandedView::next
bool next()
set current node to the next node in the expanded tree
Definition: DDExpandedView.cc:175
DDExpandedView::scope_
DDGeoHistory scope_
scope of the expanded view
Definition: DDExpandedView.h:142
DDCompactView::vector
std::vector< double > const & vector(std::string_view iKey) const
returns an empty container if not found
Definition: DDCompactView.cc:67
DDExpandedView::DDExpandedView
DDExpandedView(const DDCompactView &)
Constructs an expanded-view based on the compact-view.
Definition: DDExpandedView.cc:21
DDCompactView.h
DDExpandedView::setScope
bool setScope(const DDGeoHistory &hist, int depth=0)
sets the scope of the expanded view
Definition: DDExpandedView.cc:284
DDExpandedView::goToHistory
bool goToHistory(const DDGeoHistory &sc)
Definition: DDExpandedView.cc:310
DDExpandedView::NavRange
std::pair< int const *, size_t > NavRange
Definition: DDExpandedView.h:49
DDExpandedView::copyno
int copyno() const
Copy number associated with the current node.
Definition: DDExpandedView.cc:54
DDExpandedView::nextSibling
bool nextSibling()
set the current node to the next sibling ...
Definition: DDExpandedView.cc:61
DDExpandedView::specificsV
void specificsV(std::vector< const DDsvalues_type * > &vc) const
Definition: DDExpandedView.cc:222
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DDExpandedView::name
const std::string & name() const
The name of the logical-part of the current node in the expanded-view.
Definition: DDExpandedView.cc:44
DDExpandedView::w2_
WalkerType w2_
Definition: DDExpandedView.h:138
DDExpandedView
Provides an exploded view of the detector (tree-view)
Definition: DDExpandedView.h:41
DDPosData.h
DDPosData
Relative position of a child-volume inside a parent-volume.
Definition: DDPosData.h:13
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDExpandedView::goTo
bool goTo(const nav_type &)
transversed the DDExpandedView according to the given stack of sibling numbers
Definition: DDExpandedView.cc:381
DDExpandedView::clearScope
void clearScope()
clears the scope; the full tree is available, depth=0
Definition: DDExpandedView.cc:263
GraphWalker.h
DDExpandedView::cpv_
const DDCompactView * cpv_
Definition: DDExpandedView.h:146
DDExpandedView::worldpos_
const DDPosData * worldpos_
???
Definition: DDExpandedView.h:144
gpuVertexFinder::hist
__shared__ Hist hist
Definition: gpuClusterTracksDBSCAN.h:48
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
DDTranslation.h
DDExpandedView::~DDExpandedView
virtual ~DDExpandedView()
Definition: DDExpandedView.cc:40
DDExpandedView::reset
void reset()
true, if a call to firstChild() would succeed (current node has at least one child)
Definition: DDExpandedView.cc:268
DDLogicalPart.h
res
Definition: Electron.h:6
DDExpandedView::geoHistory
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
Definition: DDExpandedView.cc:50
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DDExpandedView::nextBStack_
std::vector< nav_type > nextBStack_
Definition: DDExpandedView.h:145
DDRotationMatrix.h
DDExpandedView::walker_
WalkerType * walker_
the tricky walker
Definition: DDExpandedView.h:137
DDExpandedNode.h
DDExpandedView::history_
DDGeoHistory history_
std::vector of DDExpandedNode
Definition: DDExpandedView.h:141
DDExpandedView::navPos
nav_type navPos() const
return the stack of sibling numbers which indicates the current position in the DDExpandedView
Definition: DDExpandedView.cc:414
DDsvalues.h
DDExpandedView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the expanded-view.
Definition: DDExpandedView.cc:42
DDFilteredView
Definition: DDFilteredView.h:20
DDExpandedView::descend
bool descend(const DDGeoHistory &sc)
Definition: DDExpandedView.cc:341
DDExpandedView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDExpandedView.cc:46
DDExpandedView::depth
int depth() const
depth of the scope. 0 means unrestricted depth.
Definition: DDExpandedView.cc:52
operator<<
std::ostream & operator<<(std::ostream &os, const DDExpandedView::nav_type &n)
Definition: DDExpandedView.h:150
DDExpandedView::parent
bool parent()
set the current node to the parent node ...
Definition: DDExpandedView.cc:138
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
DDExpandedView::trans_
const DDTranslation trans_
Definition: DDExpandedView.h:139