3 #include "DD4hep/Detector.h" 5 #include <TGeoBoolNode.h> 13 : registry_(&det->specpars()) {
24 return it_.back().GetCurrentMatrix()->GetTranslation();
29 return it_.back().GetCurrentMatrix()->GetRotationMatrix();
34 for(
const auto&
i : specs) {
35 for(
const auto& j :
i->paths) {
36 vector<string_view> toks =
split(j,
"/");
39 if(
k !=
end(
f->keys)) {
46 filters_.emplace_back(unique_ptr<Filter>(
new Filter{{toks.front()},
nullptr,
nullptr}));
50 for(
size_t pos = 1;
pos < toks.size(); ++
pos) {
67 it_.back().SetType(0);
69 while((node =
it_.back().Next())) {
70 if(
accept(node->GetVolume()->GetName())) {
82 it_.back().SetType(1);
92 }
while((
node_ =
it_.back().Next()));
99 it_.back().SetType(1);
106 }
while((
node_ =
it_.back().Next()));
113 it_.back().SetType(1);
114 Node *node =
nullptr;
115 while((node =
it_.back().Next())) {
126 it_.back().SetType(1);
127 Node *node =
nullptr;
128 while((node =
it_.back().Next())) {
139 it_.back().SetType(1);
140 Node *node =
nullptr;
141 while((node =
it_.back().Next())) {
152 it_.back().SetType(0);
160 it_.back().SetType(type);
161 Node *node =
nullptr;
162 if((node =
it_.back().Next())) {
201 const TGeoBBox* box =
static_cast<const TGeoBBox*
>(volume->GetShape());
202 return {box->GetDX(), box->GetDY(), box->GetDZ()};
205 const TGeoCompositeShape* shape =
static_cast<const TGeoCompositeShape*
>(volume->GetShape());
206 const TGeoBoolNode*
boolean = shape->GetBoolNode();
208 boolean =
static_cast<const TGeoCompositeShape*
>(
boolean->GetLeftShape())->GetBoolNode();
210 const TGeoBBox* box =
static_cast<const TGeoBBox*
>(
boolean->GetLeftShape());
211 return {box->GetDX(), box->GetDY(), box->GetDZ()};
226 for(
int nit = level; nit > 0; --nit) {
228 auto k = find_if(begin(i.second.paths), end(i.second.paths),[&](auto const& j) {
229 return (compareEqual(it_.back().GetNode(nit)->GetVolume()->GetName(), *begin(split(realTopName(j),
"/"))) &&
230 (i.second.hasValue(
"CopyNoTag") ||
231 i.second.hasValue(
"CopyNoOffset")));
233 if(
k !=
end(
i.second.paths)) {
234 nodes_.
tags.emplace_back(
i.second.dblValue(
"CopyNoTag"));
250 auto k = find_if(begin(i.second.paths), end(i.second.paths),[&](auto const& j) {
251 return (compareEqual(node_->GetVolume()->GetName(), *begin(split(realTopName(j),
"/"))) &&
252 (i.second.hasValue(
"CopyNoTag") ||
253 i.second.hasValue(
"CopyNoOffset")));
255 if(
k !=
end(
i.second.paths)) {
256 nodes_.
tags.emplace_back(
i.second.dblValue(
"CopyNoTag"));
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
void mergedSpecifics(DDSpecParRefs const &)
User specific data.
std::vector< std::string_view > keys
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const PlacedVolume volume() const
The physical volume of the current node.
bool sibling()
set the current node to the next sub sibling
std::unique_ptr< Filter > next
void down()
set current node to the child node in the filtered tree
std::vector< int > copyNos
std::vector< double > offsets
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
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.
bool accepted(std::vector< std::string_view > const &, std::string_view)
std::vector< const DDSpecPar * > DDSpecParRefs
std::vector< double > tags
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)