CMS 3D CMS Logo

DDFilteredView.h
Go to the documentation of this file.
1 #ifndef DETECTOR_DESCRIPTION_DD_FILTERED_VIEW_H
2 #define DETECTOR_DESCRIPTION_DD_FILTERED_VIEW_H
3 
4 // -*- C++ -*-
5 //
6 // Package: DetectorDescription/DDFilteredView
7 // Class: DDFilteredView
8 //
16 //
17 // Original Author: Ianna Osborne
18 // Created: Wed, 30 Jan 2019 09:24:30 GMT
19 //
20 //
24 #include <DD4hep/Volumes.h>
25 #include <memory>
26 #include <vector>
27 
28 namespace cms {
29 
30  class DDDetector;
31 
36  using Iterator = TGeoIterator;
37  using Node = TGeoNode;
38 
40 
41  public:
42 
43  DDFilteredView(const DDDetector*, const Volume);
44  DDFilteredView() = delete;
45 
47  const ExpandedNodes& history() const {
48  return nodes_;
49  }
50 
52  const PlacedVolume volume() const;
53 
55  const Double_t* trans() const;
56 
58  const Double_t* rot() const;
59 
61  void mergedSpecifics(DDSpecParRefs const&);
62 
64  bool firstChild();
65 
67  bool firstSibling();
68 
70  bool nextSibling();
71 
73  bool sibling();
74  bool siblingNoCheck();
75 
77  bool checkChild();
78 
80  bool parent();
81 
83  bool next(int);
84 
86  void down();
87 
89  void up();
90 
92  void unCheckNode();
93 
95  std::vector<double> extractParameters() const;
96 
97  private:
98 
99  bool accept(std::string_view);
100  bool addPath(Node* const);
101  bool addNode(Node* const);
102 
104  std::vector<Iterator> it_;
105  std::vector<std::unique_ptr<Filter>> filters_;
106  Filter* currentFilter_ = nullptr;
107  Node *node_ = nullptr;
109  };
110 }
111 
112 #endif
void up()
set current node to the parent node in the filtered tree
std::vector< std::unique_ptr< Filter > > filters_
bool firstSibling()
set the current node to the first sibling
TGeoNode Node
void mergedSpecifics(DDSpecParRefs const &)
User specific data.
ExpandedNodes nodes_
const PlacedVolume volume() const
The physical volume of the current node.
bool sibling()
set the current node to the next sub sibling
const ExpandedNodes & history() const
The numbering history of the current node.
void down()
set current node to the child node in the filtered tree
bool nextSibling()
set the current node to the next sibling
bool addPath(Node *const)
dd4hep::PlacedVolume PlacedVolume
bool accept(std::string_view)
const Double_t * rot() const
The absolute rotation of the current node.
bool parent()
set the current node to the parent node ...
bool firstChild()
set the current node to the first child
bool next(int)
set current node to the next node in the filtered tree
dd4hep::Volume Volume
Namespace of DDCMS conversion namespace.
std::vector< double > extractParameters() const
extract shape parameters
const Double_t * trans() const
The absolute translation of the current node.
cms::Filter Filter
std::vector< const DDSpecPar * > DDSpecParRefs
Definition: Filter.py:1
cms::ExpandedNodes ExpandedNodes
const DDSpecParRegistry * registry_
bool checkChild()
count the number of children matching selection
void unCheckNode()
pop current node
std::vector< Iterator > it_
bool addNode(Node *const)