CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
FWGeometryTableManager Class Reference

#include <Fireworks/Core/interface/FWGeometryTableManager.h>

Inheritance diagram for FWGeometryTableManager:
FWGeometryTableManagerBase FWTableManagerBase

Classes

struct  Match
 

Public Types

enum  ECol {
  kNameColumn, kColorColumn, kTranspColumn, kVisSelfColumn,
  kVisChildColumn, kMaterialColumn, kNumColumn
}
 
enum  GeometryBits { kMatches = BIT(5), kChildMatches = BIT(6), kFilterCached = BIT(7) }
 
typedef Volumes_t::iterator Volumes_i
 
typedef std::unordered_map< TGeoVolume *, MatchVolumes_t
 
- Public Types inherited from FWGeometryTableManagerBase
enum  Bits {
  kExpanded = BIT(0), kVisNodeSelf = BIT(1), kVisNodeChld = BIT(2), kHighlighted = BIT(3),
  kSelected = BIT(4)
}
 
typedef Entries_v::iterator Entries_i
 
typedef std::vector< NodeInfoEntries_v
 

Public Member Functions

void assertNodeFilterCache (NodeInfo &data)
 
FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const override
 
void checkChildMatches (TGeoVolume *v, std::vector< TGeoVolume *> &)
 
void checkHierarchy ()
 
void checkRegionOfInterest (double *center, double radius, long algo)
 
 FWGeometryTableManager (FWGeometryTableView *)
 
 FWGeometryTableManager (const FWGeometryTableManager &)=delete
 
bool getVisibility (const NodeInfo &nodeInfo) const override
 
bool getVisibilityChld (const NodeInfo &nodeInfo) const override
 
void importChildren (int parent_idx)
 
void loadGeometry (TGeoNode *iGeoTopNode, TObjArray *iVolumes)
 
int numberOfColumns () const override
 Number of columns in the table. More...
 
const FWGeometryTableManageroperator= (const FWGeometryTableManager &)=delete
 
void printMaterials ()
 
void recalculateVisibility () override
 
void recalculateVisibilityNodeRec (int)
 
void recalculateVisibilityVolumeRec (int)
 
void resetRegionOfInterest ()
 
void setDaughtersSelfVisibility (int i, bool v) override
 
void setVisibility (NodeInfo &nodeInfo, bool) override
 
void setVisibilityChld (NodeInfo &nodeInfo, bool) override
 
void updateFilter (int)
 
 ~FWGeometryTableManager () override
 
- Public Member Functions inherited from FWGeometryTableManagerBase
virtual void applyColorTranspToDaughters (int selectedIdx, bool recurse)
 
void applyTransparencyFromEditor ()
 
void cancelEditor (bool)
 
bool cellDataIsSortable () const override
 
bool firstColumnClicked (int row, int xPos)
 
 FWGeometryTableManagerBase ()
 
 FWGeometryTableManagerBase (const FWGeometryTableManagerBase &)
 
int getLevelOffset () const
 
void getNodeMatrix (const NodeInfo &nodeInfo, TGeoHMatrix &mat) const
 
void getNodePath (int, std::string &) const
 
NodeInfogetSelected ()
 
std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
void implSort (int, bool) override
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. More...
 
bool isNodeRendered (int idx, int top_node_idx) const
 
void loadGeometry (TGeoNode *, TObjArray *)
 
bool nodeImported (int idx) const
 
int numberOfRows () const override
 Number of rows in the table. More...
 
const FWGeometryTableManagerBaseoperator= (const FWGeometryTableManagerBase &)
 
void redrawTable (bool setExpand=false)
 
Entries_vrefEntries ()
 
NodeInforefEntry (int i)
 
std::vector< int > rowToIndex ()
 
void setBackgroundToWhite (bool)
 
void setCellValueEditor (TGTextEntry *editor)
 
void setDaughtersSelfVisibility (bool)
 
void setLevelOffset (int x)
 
void showEditor (int)
 
virtual const std::string title () const
 
int unsortedRowNumber (int unsorted) const override
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data More...
 
 ~FWGeometryTableManagerBase () override
 
- Public Member Functions inherited from FWTableManagerBase
virtual void buttonPressedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 Called if mouse button pressed in Row Header, defaults is to do nothing. More...
 
virtual void buttonReleasedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 
virtual unsigned int cellHeight () const
 require all cells to be the same height More...
 
 ClassDefOverride (FWTableManagerBase, 0)
 
void dataChanged ()
 Classes which inherit from FWTableManagerBase must call this when their underlying data changes. More...
 
 FWTableManagerBase ()
 
virtual bool hasLabelHeaders () const
 
virtual bool hasRowHeaders () const
 Returns 'true' if this table has row headers. Defaults return value is false. More...
 
virtual std::vector< unsigned int > maxWidthForColumns () const
 for each column in the table this returns the present maximum width for that column More...
 
virtual FWTableCellRendererBaserowHeader (int iSortedRowNumber) const
 Returns the renderer for the row header for the sorted row number iSortedRowNumber. More...
 
void sort (int iCol, bool iSortOrder)
 Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder is 'true'. More...
 
int sortColumn (void)
 The current sort column. More...
 
bool sortOrder (void)
 The current sort order for the table. More...
 
void visualPropertiesChanged ()
 Classes which inherit from FWTableManagerBase must call this when how the data is shown (e.g. color) changes. More...
 
 ~FWTableManagerBase () override
 

Protected Member Functions

const char * cellName (const NodeInfo &data) const override
 
bool nodeIsParent (const NodeInfo &) const override
 

Private Attributes

FWGeometryTableViewm_browser
 
bool m_filterOff
 
Volumes_t m_volumes
 

Additional Inherited Members

- Static Public Member Functions inherited from FWGeometryTableManagerBase
static void getNNodesTotal (TGeoNode *geoNode, int &off)
 
- Public Attributes inherited from FWGeometryTableManagerBase
ColorBoxRenderer m_colorBoxRenderer
 
TGTextEntry * m_editor
 
int m_editTransparencyIdx
 
Entries_v m_entries
 
TGGC * m_highlightContext
 
int m_highlightIdx
 
int m_levelOffset
 
FWTextTreeCellRenderer m_renderer
 
std::vector< int > m_row_to_index
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 30 of file FWGeometryTableManager.h.

Member Typedef Documentation

◆ Volumes_i

typedef Volumes_t::iterator FWGeometryTableManager::Volumes_i

Definition at line 45 of file FWGeometryTableManager.h.

◆ Volumes_t

typedef std::unordered_map<TGeoVolume*, Match> FWGeometryTableManager::Volumes_t

Definition at line 44 of file FWGeometryTableManager.h.

Member Enumeration Documentation

◆ ECol

◆ GeometryBits

Constructor & Destructor Documentation

◆ FWGeometryTableManager() [1/2]

FWGeometryTableManager::FWGeometryTableManager ( FWGeometryTableView v)

◆ ~FWGeometryTableManager()

FWGeometryTableManager::~FWGeometryTableManager ( )
override

Definition at line 31 of file FWGeometryTableManager.cc.

31 {}

◆ FWGeometryTableManager() [2/2]

FWGeometryTableManager::FWGeometryTableManager ( const FWGeometryTableManager )
delete

Member Function Documentation

◆ assertNodeFilterCache()

void FWGeometryTableManager::assertNodeFilterCache ( NodeInfo data)

Definition at line 379 of file FWGeometryTableManager.cc.

References data, kChildMatches, FWGeometryTableManagerBase::kExpanded, kFilterCached, kMatches, m_volumes, oniaPATMuonsWithTrigger_cff::matches, setVisibility(), and setVisibilityChld().

Referenced by recalculateVisibility(), recalculateVisibilityNodeRec(), recalculateVisibilityVolumeRec(), and updateFilter().

379  {
380  if (!data.testBit(kFilterCached)) {
381  bool matches = m_volumes[data.m_node->GetVolume()].m_matches;
382  // if (matches) printf("%s matches filter \n", data.name());
383  data.setBitVal(kMatches, matches);
385 
386  bool childMatches = m_volumes[data.m_node->GetVolume()].m_childMatches;
387  data.setBitVal(kChildMatches, childMatches);
388  data.setBitVal(kExpanded, childMatches);
389  setVisibilityChld(data, childMatches);
390 
391  data.setBit(kFilterCached);
392  // printf("%s matches [%d] childMatches [%d] ................ %d %d \n", data.name(), data.testBit(kMatches), data.testBit(kChildMatches), matches , childMatches);
393  }
394 }
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
void setVisibilityChld(NodeInfo &nodeInfo, bool) override

◆ cellName()

const char * FWGeometryTableManager::cellName ( const NodeInfo data) const
overrideprotectedvirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 33 of file FWGeometryTableManager.cc.

References data, FWGeometryTableView::getVolumeMode(), and m_browser.

Referenced by cellRenderer().

33  {
34  if (m_browser->getVolumeMode())
35  return Form("%s [%d]", data.m_node->GetVolume()->GetName(), data.m_node->GetNdaughters());
36  else
37  return Form("%s [%d]", data.m_node->GetName(), data.m_node->GetNdaughters());
38 }
FWGeometryTableView * m_browser
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ cellRenderer()

FWTableCellRendererBase * FWGeometryTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const
overridevirtual

Returns the particular renderer used to handle the requested cell. Arguments: iSortedRowNumber: the row number from the present sort (i.e. the cell number of the view) iCol: the column number of the cell. The returned value must be used immediately and not held onto since the same Renderer can be used for subsequent calls

Implements FWTableManagerBase.

Definition at line 42 of file FWGeometryTableManager.cc.

References cellName(), data, getVisibility(), getVisibilityChld(), FWTextTreeCellRenderer::iconWidth(), isSelected(), kColorColumn, FWGeometryTableManagerBase::kExpanded, FWGeometryTableManagerBase::kHighlighted, kMatches, kMaterialColumn, kNameColumn, FWGeometryTableManagerBase::kSelected, kTranspColumn, kVisChildColumn, kVisSelfColumn, personalPlayback::level, FWGeometryTableManagerBase::m_colorBoxRenderer, FWGeometryTableManagerBase::m_editTransparencyIdx, FWGeometryTableManagerBase::m_entries, FWGeometryTableManagerBase::m_highlightContext, FWGeometryTableManagerBase::m_levelOffset, FWGeometryTableManagerBase::m_renderer, FWGeometryTableManagerBase::m_row_to_index, nodeIsParent(), FWTextTableCellRenderer::setData(), FWGeometryTableManagerBase::ColorBoxRenderer::setData(), FWTextTreeCellRenderer::setIndentation(), FWTextTreeCellRenderer::setIsOpen(), FWTextTreeCellRenderer::setIsParent(), and FWTextTreeCellRenderer::showEditor().

42  {
44  if (m_row_to_index.empty())
45  return renderer;
46 
47  int unsortedRow = m_row_to_index[iSortedRowNumber];
48  if (unsortedRow < 0)
49  printf("!!!!!!!!!!!!!!!! error %d %d \n", unsortedRow, iSortedRowNumber);
50 
51  // editor state
52  //
53  m_renderer.showEditor(unsortedRow == m_editTransparencyIdx && iCol == kTranspColumn);
54 
55  // selection state
56  //
57  const NodeInfo& data = m_entries[unsortedRow];
58  TGeoNode& gn = *data.m_node;
59  bool isSelected = data.testBit(kHighlighted) || data.testBit(kSelected);
60  // printf("cell render %s \n", data.name());
61  if (data.testBit(kSelected)) {
62  m_highlightContext->SetBackground(0xc86464);
63  } else if (data.testBit(kHighlighted)) {
64  m_highlightContext->SetBackground(0x6464c8);
65  } else if (iCol == kMaterialColumn && data.testBit(kMatches)) {
66  m_highlightContext->SetBackground(0xdddddd);
67  }
68 
69  // set column content
70  //
71  if (iCol == kNameColumn) {
72  renderer->setData(cellName(data), isSelected);
73 
74  renderer->setIsParent(nodeIsParent(data));
75 
77 
78  int level = data.m_level - m_levelOffset;
79  if (nodeIsParent(data))
80  renderer->setIndentation(20 * level);
81  else
83 
84  return renderer;
85  } else {
86  // printf("title %s \n",data.m_node->GetTitle());
87  renderer->setIsParent(false);
88  renderer->setIndentation(0);
89  if (iCol == kColorColumn) {
90  // m_colorBoxRenderer.setData(data.m_node->GetVolume()->GetLineColor(), isSelected);
92  return &m_colorBoxRenderer;
93  } else if (iCol == kTranspColumn) {
94  renderer->setData(Form("%d", 100 - data.m_transparency), isSelected);
95  return renderer;
96  } else if (iCol == kVisSelfColumn) {
97  renderer->setData(getVisibility(data) ? "On" : "-", isSelected);
98  return renderer;
99  } else if (iCol == kVisChildColumn) {
100  renderer->setData(getVisibilityChld(data) ? "On" : "-", isSelected);
101  return renderer;
102  } else if (iCol == kMaterialColumn) {
103  renderer->setData(gn.GetVolume()->GetMaterial()->GetName(), isSelected);
104  return renderer;
105  } else {
106  renderer->setData("ERROR", false);
107  return renderer;
108  }
109  }
110 }
bool getVisibility(const NodeInfo &nodeInfo) const override
const char * cellName(const NodeInfo &data) const override
virtual void setIndentation(int indentation=0)
void setData(const std::string &, bool isSelected)
bool nodeIsParent(const NodeInfo &) const override
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
bool getVisibilityChld(const NodeInfo &nodeInfo) const override
virtual void showEditor(bool value)

◆ checkChildMatches()

void FWGeometryTableManager::checkChildMatches ( TGeoVolume *  v,
std::vector< TGeoVolume *> &  pstack 
)

Definition at line 158 of file FWGeometryTableManager.cc.

References mps_fire::i, FWGeometryTableManager::Match::m_childMatches, and m_volumes.

Referenced by updateFilter().

158  {
159  if (m_volumes[vol].m_matches) {
160  for (std::vector<TGeoVolume*>::iterator i = pstack.begin(); i != pstack.end(); ++i) {
161  Match& pm = m_volumes[*i];
162  pm.m_childMatches = true;
163  }
164  }
165 
166  pstack.push_back(vol);
167 
168  int nD = vol->GetNdaughters(); //TMath::Min(m_browser->getMaxDaughters(), vol->GetNdaughters());
169  for (int i = 0; i < nD; ++i)
170  checkChildMatches(vol->GetNode(i)->GetVolume(), pstack);
171 
172  pstack.pop_back();
173 }
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume *> &)
def Match(required, got)

◆ checkHierarchy()

void FWGeometryTableManager::checkHierarchy ( )

Definition at line 138 of file FWGeometryTableManager.cc.

References ztail::d, MillePedeFileConverter_cfg::e, mps_fire::i, FWGeometryTableManagerBase::m_entries, Skims_PA_cff::name, and convertSQLiteXML::ok.

138  {
139  // Used for debug: in a NodeInfo entry look TGeoNode children from parent index and check
140  // if child is found.
141 
142  for (size_t i = 0, e = m_entries.size(); i != e; ++i) {
143  if (m_entries[i].m_level > 0) {
144  TGeoNode* pn = m_entries[m_entries[i].m_parent].m_node;
145  bool ok = false;
146  for (int d = 0; d < pn->GetNdaughters(); ++d) {
147  if (m_entries[i].m_node == pn->GetDaughter(d)) {
148  ok = true;
149  break;
150  }
151  }
152  if (!ok)
153  printf("!!!!!! node %s has false parent %s \n", m_entries[i].name(), pn->GetName());
154  }
155  }
156 }
d
Definition: ztail.py:151

◆ checkRegionOfInterest()

void FWGeometryTableManager::checkRegionOfInterest ( double *  center,
double  radius,
long  algo 
)

Definition at line 462 of file FWGeometryTableManager.cc.

References cms::cuda::assert(), gpuPixelDoublets::cc, ztail::d, dumpMFGeometry_cfg::delta, Calorimetry_cff::dp, FWGeometryTableViewManager::getGeoMangeur(), mps_fire::i, FWGeometryTableView::kBBoxCenter, FWGeometryTableView::kBBoxSurface, FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, FWGeometryTableManagerBase::m_entries, alignCSCRings::r, CosmicsPD_Skims::radius, and submitPVValidationJobs::t.

Referenced by FWGeometryTableView::checkRegionOfInterest().

462  {
463  double sqr_r = radius * radius;
464 
465  for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni)
466  ni->resetBit(kVisNodeChld);
467 
468  int cnt = 0;
469  TEveGeoManagerHolder mangeur(FWGeometryTableViewManager::getGeoMangeur());
470  printf("FWGeometryTableManagerBase::checkRegionOfInterest BEGIN r=%d center= (%.1f, %.1f, %.1f)\n ",
471  (int)radius,
472  center[0],
473  center[1],
474  center[2]);
475  TGeoIterator git(m_entries[0].m_node->GetVolume());
476  Entries_i eit(m_entries.begin());
477  while (git()) {
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;
483 
484  bool visible = false;
485 
486  switch (algo) {
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();
491  ;
492  visible = (sqr_d <= sqr_r);
493  break;
494  }
496  assert(gm->IsScale() == false);
497 
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]));
501  Double_t sqr_d = 0;
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];
504  if (dp < -bd[i]) {
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;
510  }
511  }
512  visible = (sqr_d <= sqr_r);
513  }
514  }
515 
516  if (visible) {
517  eit->setBit(kVisNodeSelf);
518  int pidx = eit->m_parent;
519  while (pidx >= 0) {
520  m_entries[pidx].setBit(kVisNodeChld);
521  pidx = m_entries[pidx].m_parent;
522  ++cnt;
523  }
524  } else {
525  eit->resetBit(kVisNodeSelf);
526  }
527  eit++;
528  }
529 
530  printf("FWGeometryTableManager::checkRegionOfInterest END [%d]\n ", cnt);
531 }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
assert(be >=bs)
d
Definition: ztail.py:151

◆ getVisibility()

bool FWGeometryTableManager::getVisibility ( const NodeInfo nodeInfo) const
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 440 of file FWGeometryTableManager.cc.

References data, FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeSelf, and m_browser.

Referenced by cellRenderer().

440  {
441  if (m_browser->getVolumeMode())
442  return data.m_node->GetVolume()->IsVisible();
443 
444  return data.testBit(kVisNodeSelf);
445 }
FWGeometryTableView * m_browser
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ getVisibilityChld()

bool FWGeometryTableManager::getVisibilityChld ( const NodeInfo nodeInfo) const
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 447 of file FWGeometryTableManager.cc.

References data, FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeChld, and m_browser.

Referenced by cellRenderer().

447  {
448  if (m_browser->getVolumeMode())
449  return data.m_node->GetVolume()->IsVisibleDaughters();
450 
451  return data.testBit(kVisNodeChld);
452 }
FWGeometryTableView * m_browser
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ importChildren()

void FWGeometryTableManager::importChildren ( int  parent_idx)

Definition at line 114 of file FWGeometryTableManager.cc.

References data, FWGeometryTableView::getAutoExpand(), FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableManagerBase::kExpanded, m_browser, FWGeometryTableManagerBase::m_entries, dqmiodumpmetadata::n, and class-composition::parent.

Referenced by loadGeometry().

114  {
115  NodeInfo& parent = m_entries[parent_idx];
116  TGeoNode* parentGeoNode = parent.m_node;
117  int parentLevel = parent.m_level;
118 
119  int nV = parentGeoNode->GetNdaughters();
120  int dOff = 0;
121  for (int n = 0; n != nV; ++n) {
122  NodeInfo& data = m_entries[parent_idx + n + 1 + dOff];
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();
128  if (data.m_level <= m_browser->getAutoExpand())
129  data.setBit(kExpanded);
130 
131  importChildren(parent_idx + n + 1 + dOff);
132  getNNodesTotal(parentGeoNode->GetDaughter(n), dOff);
133  }
134 }
FWGeometryTableView * m_browser
static void getNNodesTotal(TGeoNode *geoNode, int &off)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
void importChildren(int parent_idx)

◆ loadGeometry()

void FWGeometryTableManager::loadGeometry ( TGeoNode *  iGeoTopNode,
TObjArray *  iVolumes 
)

Definition at line 228 of file FWGeometryTableManager.cc.

References FWGeometryTableView::drawTopNode(), FWGeometryTableView::getAutoExpand(), FWGeometryTableView::getFilterType(), FWGeometryTableManagerBase::getNNodesTotal(), importChildren(), FWGeometryTableManagerBase::kExpanded, FWGeometryTableManagerBase::kVisNodeSelf, m_browser, FWGeometryTableManagerBase::NodeInfo::m_color, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::NodeInfo::m_level, FWGeometryTableManagerBase::m_levelOffset, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::NodeInfo::m_parent, FWGeometryTableManagerBase::m_row_to_index, FWGeometryTableManagerBase::NodeInfo::m_transparency, m_volumes, MultipleCompare::Match(), GetRecoTauVFromDQM_MC_cff::next, FWGeometryTableManagerBase::NodeInfo::setBitVal(), updateFilter(), and findQualityFiles::v.

Referenced by FWGeometryTableView::FWGeometryTableView().

228  {
229 #ifdef PERFTOOL_GEO_TABLE
230  ProfilerStart("loadGeo");
231 #endif
232 
233  // Prepare data for cell render.
234 
235  // clear entries
236  m_entries.clear();
237  m_row_to_index.clear();
238  m_volumes.clear();
239  m_levelOffset = 0;
240 
241  // set volume table for filters
242  Volumes_t pipi(iVolumes->GetSize());
243  m_volumes.swap(pipi);
244  TIter next(iVolumes);
245  TGeoVolume* v;
246  while ((v = (TGeoVolume*)next()) != nullptr)
247  m_volumes.insert(std::make_pair(v, Match()));
248 
249  if (!m_filterOff)
251 
252  // add top node to init
253 
254  int nTotal = 0;
255  NodeInfo topNodeInfo;
256  topNodeInfo.m_node = iGeoTopNode;
257  topNodeInfo.m_level = 0;
258  topNodeInfo.m_parent = -1;
259  topNodeInfo.m_color = iGeoTopNode->GetVolume()->GetLineColor();
260  topNodeInfo.m_transparency = iGeoTopNode->GetVolume()->GetTransparency();
261  topNodeInfo.setBitVal(kExpanded, m_browser->getAutoExpand());
262  topNodeInfo.setBitVal(kVisNodeSelf, m_browser->drawTopNode());
263 
264  getNNodesTotal(topNodeInfo.m_node, nTotal);
265  m_entries.resize(nTotal + 1);
266  m_entries[0] = topNodeInfo;
267 
268  importChildren(0);
269 
270  // checkHierarchy();
271 
272 #ifdef PERFTOOL_GEO_TABLE
273  ProfilerStop();
274 #endif
275 }
FWGeometryTableView * m_browser
std::unordered_map< TGeoVolume *, Match > Volumes_t
static void getNNodesTotal(TGeoNode *geoNode, int &off)
def Match(required, got)
void importChildren(int parent_idx)

◆ nodeIsParent()

bool FWGeometryTableManager::nodeIsParent ( const NodeInfo data) const
overrideprotectedvirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 456 of file FWGeometryTableManager.cc.

References data, kChildMatches, and m_filterOff.

Referenced by cellRenderer().

456  {
457  return (data.m_node->GetNdaughters() != 0) && (m_filterOff || data.testBit(kChildMatches));
458 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ numberOfColumns()

int FWGeometryTableManager::numberOfColumns ( ) const
inlineoverridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 72 of file FWGeometryTableManager.h.

References kNumColumn.

◆ operator=()

const FWGeometryTableManager& FWGeometryTableManager::operator= ( const FWGeometryTableManager )
delete

◆ printMaterials()

void FWGeometryTableManager::printMaterials ( )

Definition at line 279 of file FWGeometryTableManager.cc.

References DMR_cfg::cerr.

279 { std::cerr << "not implemented \n"; }

◆ recalculateVisibility()

void FWGeometryTableManager::recalculateVisibility ( )
overridevirtual

Implements FWGeometryTableManagerBase.

Definition at line 283 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), data, FWGeometryTableViewBase::getTopNodeIdx(), FWGeometryTableView::getVolumeMode(), mps_fire::i, kChildMatches, FWGeometryTableManagerBase::kExpanded, m_browser, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::m_row_to_index, METSkim_cff::Max, recalculateVisibilityNodeRec(), and recalculateVisibilityVolumeRec().

283  {
284  m_row_to_index.clear();
285 
286  int i = TMath::Max(0, m_browser->getTopNodeIdx());
287  m_row_to_index.push_back(i);
288 
289  NodeInfo& data = m_entries[i];
290 
291  if (!m_filterOff)
293 
294  if ((m_filterOff && data.testBit(kExpanded) == false) ||
295  (m_filterOff == false && data.testBit(kChildMatches) == false))
296  return;
297 
298  if (m_browser->getVolumeMode())
300  else
302 
303  // printf (" child [%d] FWGeometryTableManagerBase::recalculateVisibility table size %d \n", (int)m_row_to_index.size());
304 }
FWGeometryTableView * m_browser
void assertNodeFilterCache(NodeInfo &data)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ recalculateVisibilityNodeRec()

void FWGeometryTableManager::recalculateVisibilityNodeRec ( int  pIdx)

Definition at line 353 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), data, FWGeometryTableManagerBase::getNNodesTotal(), heavyIonCSV_trainingSettings::idx, kChildMatches, FWGeometryTableManagerBase::kExpanded, kMatches, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::m_row_to_index, and dqmiodumpmetadata::n.

Referenced by recalculateVisibility().

353  {
354  TGeoNode* parentNode = m_entries[pIdx].m_node;
355  int nD = parentNode->GetNdaughters();
356  int dOff = 0;
357  for (int n = 0; n != nD; ++n) {
358  int idx = pIdx + 1 + n + dOff;
359  NodeInfo& data = m_entries[idx];
360 
361  if (m_filterOff) {
362  m_row_to_index.push_back(idx);
363  if (data.testBit(kExpanded))
365  } else {
367  if (data.testBitAny(kMatches | kChildMatches))
368  m_row_to_index.push_back(idx);
369  if (data.testBit(kChildMatches) && data.testBit(kExpanded))
371  }
372 
373  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
374  }
375 }
void assertNodeFilterCache(NodeInfo &data)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ recalculateVisibilityVolumeRec()

void FWGeometryTableManager::recalculateVisibilityVolumeRec ( int  pIdx)

Definition at line 308 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), data, FWGeometryTableManagerBase::getNNodesTotal(), heavyIonCSV_trainingSettings::idx, kChildMatches, FWGeometryTableManagerBase::kExpanded, kMatches, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::m_row_to_index, dqmiodumpmetadata::n, and HLT_2024v13_cff::toAdd.

Referenced by recalculateVisibility().

308  {
309  TGeoNode* parentNode = m_entries[pIdx].m_node;
310  int nD = parentNode->GetNdaughters();
311  int dOff = 0;
312 
313  // printf("----------- parent %s\n", parentNode->GetName() );
314 
315  std::vector<int> vi;
316  vi.reserve(nD);
317 
318  for (int n = 0; n != nD; ++n) {
319  int idx = pIdx + 1 + n + dOff;
320  NodeInfo& data = m_entries[idx];
321 
322  bool toAdd = true;
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()) {
326  toAdd = false;
327  // printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
328  break;
329  }
330  }
331 
332  if (toAdd) {
333  vi.push_back(n);
334  if (m_filterOff) {
335  // std::cout << data.nameIndent() << std::endl;
336  m_row_to_index.push_back(idx);
337  if (data.testBit(kExpanded))
339  } else {
341  if (data.testBitAny(kMatches | kChildMatches))
342  m_row_to_index.push_back(idx);
343  if (data.testBit(kChildMatches) && data.testBit(kExpanded))
345  }
346  }
347  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
348  }
349 }
void assertNodeFilterCache(NodeInfo &data)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ resetRegionOfInterest()

void FWGeometryTableManager::resetRegionOfInterest ( )

◆ setDaughtersSelfVisibility()

void FWGeometryTableManager::setDaughtersSelfVisibility ( int  i,
bool  v 
)
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 423 of file FWGeometryTableManager.cc.

References data, FWGeometryTableManagerBase::getNNodesTotal(), heavyIonCSV_trainingSettings::idx, FWGeometryTableManagerBase::m_entries, dqmiodumpmetadata::n, setVisibility(), setVisibilityChld(), and findQualityFiles::v.

423  {
424  TGeoNode* parentNode = m_entries[selectedIdx].m_node;
425  int nD = parentNode->GetNdaughters();
426  int dOff = 0;
427  for (int n = 0; n != nD; ++n) {
428  int idx = selectedIdx + 1 + n + dOff;
429  NodeInfo& data = m_entries[idx];
430 
431  setVisibility(data, v);
433 
434  FWGeometryTableManager::getNNodesTotal(parentNode->GetDaughter(n), dOff);
435  }
436 }
static void getNNodesTotal(TGeoNode *geoNode, int &off)
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
void setVisibilityChld(NodeInfo &nodeInfo, bool) override

◆ setVisibility()

void FWGeometryTableManager::setVisibility ( NodeInfo nodeInfo,
bool  x 
)
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 398 of file FWGeometryTableManager.cc.

References data, FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeSelf, m_browser, and x.

Referenced by assertNodeFilterCache(), setDaughtersSelfVisibility(), and FWGeometryTableView::updateFilter().

398  {
399  if (m_browser->getVolumeMode()) {
400  if (data.m_node->GetVolume()->IsVisible() != x) {
402  data.m_node->GetVolume()->SetVisibility(x);
403  }
404  } else {
405  data.setBitVal(kVisNodeSelf, x);
406  }
407 }
FWGeometryTableView * m_browser
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ setVisibilityChld()

void FWGeometryTableManager::setVisibilityChld ( NodeInfo nodeInfo,
bool  x 
)
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 411 of file FWGeometryTableManager.cc.

References data, FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeChld, m_browser, and x.

Referenced by assertNodeFilterCache(), setDaughtersSelfVisibility(), and FWGeometryTableView::updateFilter().

411  {
412  if (m_browser->getVolumeMode()) {
413  if (data.m_node->GetVolume()->IsVisibleDaughters() != x) {
414  TEveGeoManagerHolder gmgr(FWGeometryTableViewManager::getGeoMangeur());
415  data.m_node->GetVolume()->VisibleDaughters(x);
416  }
417  } else {
418  data.setBitVal(kVisNodeChld, x);
419  }
420 }
FWGeometryTableView * m_browser
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ updateFilter()

void FWGeometryTableManager::updateFilter ( int  iType)

Definition at line 185 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), checkChildMatches(), FWGeometryTableView::getFilter(), mps_fire::i, createfilelist::int, kFilterCached, FWGeometryTableView::kFilterMaterialName, FWGeometryTableView::kFilterMaterialTitle, FWGeometryTableView::kFilterShapeClassName, FWGeometryTableView::kFilterShapeName, m_browser, FWGeometryTableManagerBase::m_entries, m_filterOff, m_volumes, fetchall_from_DQM_v2::regexp, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by loadGeometry(), FWGeometryTableView::setFrom(), and FWGeometryTableView::updateFilter().

185  {
186  std::string filterExp = m_browser->getFilter();
187  m_filterOff = filterExp.empty();
188  printf("update filter %s OFF %d volumes size %d\n", filterExp.c_str(), m_filterOff, (int)m_volumes.size());
189 
190  if (m_filterOff || m_entries.empty())
191  return;
192 
193  // update volume-match entries
194  int numMatched = 0;
195 
196  TPMERegexp regexp(TString(filterExp.c_str()), "o");
197  for (Volumes_i i = m_volumes.begin(); i != m_volumes.end(); ++i) {
198  int res = 0;
199 
201  res = matchTPME(i->first->GetMaterial()->GetName(), regexp);
202  } else if (iType == FWGeometryTableView::kFilterMaterialTitle) {
203  res = matchTPME(i->first->GetMaterial()->GetTitle(), regexp);
204  } else if (iType == FWGeometryTableView::kFilterShapeName) {
205  res = matchTPME(i->first->GetShape()->GetName(), regexp);
206  } else if (iType == FWGeometryTableView::kFilterShapeClassName) {
207  res = matchTPME(i->first->GetShape()->ClassName(), regexp);
208  }
209 
210  i->second.m_matches = (res > 0);
211  i->second.m_childMatches = false;
212  if (res)
213  numMatched++;
214  }
215 
216  printf("update filter [%d] volumes matched\n", numMatched);
217  std::vector<TGeoVolume*> pstack;
218  checkChildMatches(m_entries[0].m_node->GetVolume(), pstack);
219 
220  for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni) {
221  ni->resetBit(kFilterCached);
223  }
224 }
FWGeometryTableView * m_browser
Definition: Electron.h:6
void assertNodeFilterCache(NodeInfo &data)
std::string getFilter() const
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume *> &)
Volumes_t::iterator Volumes_i

Member Data Documentation

◆ m_browser

FWGeometryTableView* FWGeometryTableManager::m_browser
private

◆ m_filterOff

bool FWGeometryTableManager::m_filterOff
private

◆ m_volumes

Volumes_t FWGeometryTableManager::m_volumes
mutableprivate