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;
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;
146 for (
int d = 0;
d < pn->GetNdaughters(); ++
d) {
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) {
181 return regexp.Match(
s);
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();
463 double sqr_r = radius *
radius;
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];
505 Double_t
delta = dp + bd[
i];
506 sqr_d += delta *
delta;
507 }
else if (dp > bd[i]) {
508 Double_t
delta = dp - bd[
i];
509 sqr_d += delta *
delta;
512 visible = (sqr_d <= sqr_r);
518 int pidx = eit->m_parent;
530 printf(
"FWGeometryTableManager::checkRegionOfInterest END [%d]\n ", cnt);
FWGeometryTableView * m_browser
std::vector< int > m_row_to_index
FWGeometryTableManager(FWGeometryTableView *)
int getFilterType() const
void setIsOpen(bool value)
void checkRegionOfInterest(double *center, double radius, long algo)
std::string getFilter() const
std::unordered_map< TGeoVolume *, Match > Volumes_t
void setDaughtersSelfVisibility(int i, bool v) override
TGGC * m_highlightContext
void setData(Color_t c, bool)
void recalculateVisibility() override
int getAutoExpand() const
void recalculateVisibilityNodeRec(int)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
void resetRegionOfInterest()
uint16_t const *__restrict__ x
void assertNodeFilterCache(NodeInfo &data)
void setIsParent(bool value)
~FWGeometryTableManager() override
bool getVisibility(const NodeInfo &nodeInfo) const override
const char * cellName(const NodeInfo &data) const override
int m_editTransparencyIdx
virtual void setIndentation(int indentation=0)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
void setData(const std::string &, bool isSelected)
bool nodeIsParent(const NodeInfo &) const override
void loadGeometry(TGeoNode *iGeoTopNode, TObjArray *iVolumes)
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume * > &)
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
void recalculateVisibilityVolumeRec(int)
FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const override
static TGeoManager * getGeoMangeur()
bool getVolumeMode() const
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
int getTopNodeIdx() const
void setBitVal(UChar_t f, bool x)
Volumes_t::iterator Volumes_i
Entries_v::iterator Entries_i
FWTextTreeCellRenderer m_renderer
void importChildren(int parent_idx)
bool testBitAny(UChar_t f) const
bool getVisibilityChld(const NodeInfo &nodeInfo) const override
ColorBoxRenderer m_colorBoxRenderer
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
bool testBit(UChar_t f) const
virtual void showEditor(bool value)