22 #include "TEveVector.h"
23 #include "TGeoShape.h"
24 #include "TGeoMatrix.h"
35 return Form(
"%s [%d]",
data.m_node->GetVolume()->GetName(),
data.m_node->GetNdaughters());
37 return Form(
"%s [%d]",
data.m_node->GetName(),
data.m_node->GetNdaughters());
49 printf(
"!!!!!!!!!!!!!!!! error %d %d \n", unsortedRow, iSortedRowNumber);
58 TGeoNode& gn = *
data.m_node;
94 renderer->
setData(Form(
"%d", 100 -
data.m_transparency), isSelected);
103 renderer->
setData(gn.GetVolume()->GetMaterial()->GetName(), isSelected);
106 renderer->
setData(
"ERROR",
false);
116 TGeoNode* parentGeoNode =
parent.m_node;
117 int parentLevel =
parent.m_level;
119 int nV = parentGeoNode->GetNdaughters();
121 for (
int n = 0;
n != nV; ++
n) {
123 data.m_node = parentGeoNode->GetDaughter(
n);
124 data.m_level = parentLevel + 1;
125 data.m_parent = parent_idx;
126 data.m_color =
data.m_node->GetVolume()->GetLineColor();
127 data.m_transparency =
data.m_node->GetVolume()->GetTransparency();
146 for (
int d = 0;
d < pn->GetNdaughters(); ++
d) {
153 printf(
"!!!!!! node %s has false parent %s \n",
m_entries[
i].
name(), pn->GetName());
160 for (std::vector<TGeoVolume*>::iterator
i = pstack.begin();
i != pstack.end(); ++
i) {
166 pstack.push_back(vol);
168 int nD = vol->GetNdaughters();
169 for (
int i = 0;
i < nD; ++
i)
179 int matchTPME(
const char*
w, TPMERegexp&
regexp) {
196 TPMERegexp
regexp(TString(filterExp.c_str()),
"o");
201 res = matchTPME(
i->first->GetMaterial()->GetName(),
regexp);
203 res = matchTPME(
i->first->GetMaterial()->GetTitle(),
regexp);
205 res = matchTPME(
i->first->GetShape()->GetName(),
regexp);
207 res = matchTPME(
i->first->GetShape()->ClassName(),
regexp);
210 i->second.m_matches = (
res > 0);
211 i->second.m_childMatches =
false;
216 printf(
"update filter [%d] volumes matched\n", numMatched);
217 std::vector<TGeoVolume*> pstack;
229 #ifdef PERFTOOL_GEO_TABLE
230 ProfilerStart(
"loadGeo");
244 TIter
next(iVolumes);
246 while ((
v = (TGeoVolume*)
next()) !=
nullptr)
256 topNodeInfo.
m_node = iGeoTopNode;
259 topNodeInfo.
m_color = iGeoTopNode->GetVolume()->GetLineColor();
260 topNodeInfo.
m_transparency = iGeoTopNode->GetVolume()->GetTransparency();
272 #ifdef PERFTOOL_GEO_TABLE
309 TGeoNode* parentNode =
m_entries[pIdx].m_node;
310 int nD = parentNode->GetNdaughters();
318 for (
int n = 0;
n != nD; ++
n) {
319 int idx = pIdx + 1 +
n + dOff;
323 for (std::vector<int>::iterator u = vi.begin(); u != vi.end(); ++u) {
324 TGeoVolume* neighbourVolume = parentNode->GetDaughter(*u)->GetVolume();
325 if (neighbourVolume ==
data.m_node->GetVolume()) {
354 TGeoNode* parentNode =
m_entries[pIdx].m_node;
355 int nD = parentNode->GetNdaughters();
357 for (
int n = 0;
n != nD; ++
n) {
358 int idx = pIdx + 1 +
n + dOff;
386 bool childMatches =
m_volumes[
data.m_node->GetVolume()].m_childMatches;
400 if (
data.m_node->GetVolume()->IsVisible() !=
x) {
402 data.m_node->GetVolume()->SetVisibility(
x);
413 if (
data.m_node->GetVolume()->IsVisibleDaughters() !=
x) {
415 data.m_node->GetVolume()->VisibleDaughters(
x);
424 TGeoNode* parentNode =
m_entries[selectedIdx].m_node;
425 int nD = parentNode->GetNdaughters();
427 for (
int n = 0;
n != nD; ++
n) {
428 int idx = selectedIdx + 1 +
n + dOff;
442 return data.m_node->GetVolume()->IsVisible();
449 return data.m_node->GetVolume()->IsVisibleDaughters();
470 printf(
"FWGeometryTableManagerBase::checkRegionOfInterest BEGIN r=%d center= (%.1f, %.1f, %.1f)\n ",
475 TGeoIterator git(
m_entries[0].m_node->GetVolume());
478 const TGeoMatrix* gm = git.GetCurrentMatrix();
479 const TGeoBBox* bb = static_cast<TGeoBBox*>(eit->m_node->GetVolume()->GetShape());
480 const Double_t* bo = bb->GetOrigin();
481 const Double_t
bd[] = {bb->GetDX(), bb->GetDY(), bb->GetDZ()};
482 const Double_t*
cc = center;
484 bool visible =
false;
488 const Double_t*
t = gm->GetTranslation();
489 TEveVectorD
d(
cc[0] - (
t[0] + bo[0]),
cc[1] - (
t[1] + bo[1]),
cc[2] - (
t[2] + bo[2]));
490 Double_t sqr_d =
d.Mag2();
492 visible = (sqr_d <= sqr_r);
496 assert(gm->IsScale() ==
false);
498 const Double_t*
t = gm->GetTranslation();
499 const Double_t*
r = gm->GetRotationMatrix();
500 TEveVectorD
d(
cc[0] - (
t[0] + bo[0]),
cc[1] - (
t[1] + bo[1]),
cc[2] - (
t[2] + bo[2]));
502 for (Int_t
i = 0;
i < 3; ++
i) {
503 Double_t
dp =
d[0] *
r[
i] +
d[1] *
r[
i + 3] +
d[2] *
r[
i + 6];
507 }
else if (
dp >
bd[
i]) {
512 visible = (sqr_d <= sqr_r);
518 int pidx = eit->m_parent;
530 printf(
"FWGeometryTableManager::checkRegionOfInterest END [%d]\n ", cnt);