CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Private 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 *)
 
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...
 
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 Member Functions

 FWGeometryTableManager (const FWGeometryTableManager &)=delete
 
const FWGeometryTableManageroperator= (const FWGeometryTableManager &)=delete
 

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

Enumerator
kNameColumn 
kColorColumn 
kTranspColumn 
kVisSelfColumn 
kVisChildColumn 
kMaterialColumn 
kNumColumn 

Definition at line 32 of file FWGeometryTableManager.h.

◆ GeometryBits

Enumerator
kMatches 
kChildMatches 
kFilterCached 

Definition at line 34 of file FWGeometryTableManager.h.

34 { kMatches = BIT(5), kChildMatches = BIT(6), kFilterCached = BIT(7) };

Constructor & Destructor Documentation

◆ FWGeometryTableManager() [1/2]

FWGeometryTableManager::FWGeometryTableManager ( FWGeometryTableView v)

Definition at line 28 of file FWGeometryTableManager.cc.

◆ ~FWGeometryTableManager()

FWGeometryTableManager::~FWGeometryTableManager ( )
override

Definition at line 31 of file FWGeometryTableManager.cc.

31 {}

◆ FWGeometryTableManager() [2/2]

FWGeometryTableManager::FWGeometryTableManager ( const FWGeometryTableManager )
privatedelete

Member Function Documentation

◆ assertNodeFilterCache()

void FWGeometryTableManager::assertNodeFilterCache ( NodeInfo data)

Definition at line 379 of file FWGeometryTableManager.cc.

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 }

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

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

◆ cellName()

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

Reimplemented from FWGeometryTableManagerBase.

Definition at line 33 of file FWGeometryTableManager.cc.

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 }

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

Referenced by cellRenderer().

◆ 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.

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);
91  m_colorBoxRenderer.setData(data.m_color, 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 }

References cellName(), data, getVisibility(), getVisibilityChld(), FWTextTreeCellRenderer::iconWidth(), 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().

◆ checkChildMatches()

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

Definition at line 158 of file FWGeometryTableManager.cc.

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 }

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

Referenced by updateFilter().

◆ checkHierarchy()

void FWGeometryTableManager::checkHierarchy ( )

Definition at line 138 of file FWGeometryTableManager.cc.

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 }

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

◆ checkRegionOfInterest()

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

Definition at line 462 of file FWGeometryTableManager.cc.

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 }

References cms::cuda::assert(), 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().

◆ getVisibility()

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

Reimplemented from FWGeometryTableManagerBase.

Definition at line 440 of file FWGeometryTableManager.cc.

440  {
441  if (m_browser->getVolumeMode())
442  return data.m_node->GetVolume()->IsVisible();
443 
444  return data.testBit(kVisNodeSelf);
445 }

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

Referenced by cellRenderer().

◆ getVisibilityChld()

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

Reimplemented from FWGeometryTableManagerBase.

Definition at line 447 of file FWGeometryTableManager.cc.

447  {
448  if (m_browser->getVolumeMode())
449  return data.m_node->GetVolume()->IsVisibleDaughters();
450 
451  return data.testBit(kVisNodeChld);
452 }

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

Referenced by cellRenderer().

◆ importChildren()

void FWGeometryTableManager::importChildren ( int  parent_idx)

Definition at line 114 of file FWGeometryTableManager.cc.

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 }

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

Referenced by loadGeometry().

◆ loadGeometry()

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

Definition at line 228 of file FWGeometryTableManager.cc.

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 }

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().

◆ nodeIsParent()

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

Reimplemented from FWGeometryTableManagerBase.

Definition at line 456 of file FWGeometryTableManager.cc.

456  {
457  return (data.m_node->GetNdaughters() != 0) && (m_filterOff || data.testBit(kChildMatches));
458 }

References data, kChildMatches, and m_filterOff.

Referenced by cellRenderer().

◆ numberOfColumns()

int FWGeometryTableManager::numberOfColumns ( ) const
inlineoverridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 72 of file FWGeometryTableManager.h.

72 { return kNumColumn; }

References kNumColumn.

◆ operator=()

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

◆ printMaterials()

void FWGeometryTableManager::printMaterials ( )

Definition at line 279 of file FWGeometryTableManager.cc.

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

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

◆ recalculateVisibility()

void FWGeometryTableManager::recalculateVisibility ( )
overridevirtual

Implements FWGeometryTableManagerBase.

Definition at line 283 of file FWGeometryTableManager.cc.

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 }

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, Max(), recalculateVisibilityNodeRec(), and recalculateVisibilityVolumeRec().

◆ recalculateVisibilityNodeRec()

void FWGeometryTableManager::recalculateVisibilityNodeRec ( int  pIdx)

Definition at line 353 of file FWGeometryTableManager.cc.

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 }

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().

◆ recalculateVisibilityVolumeRec()

void FWGeometryTableManager::recalculateVisibilityVolumeRec ( int  pIdx)

Definition at line 308 of file FWGeometryTableManager.cc.

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 }

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_FULL_cff::toAdd.

Referenced by recalculateVisibility().

◆ resetRegionOfInterest()

void FWGeometryTableManager::resetRegionOfInterest ( )

Definition at line 533 of file FWGeometryTableManager.cc.

533  {
534  for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni) {
535  ni->setBit(kVisNodeSelf);
536  ni->setBit(kVisNodeChld);
537  }
538  // ni->setMatchRegion(true);
539 }

References FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, and FWGeometryTableManagerBase::m_entries.

Referenced by FWGeometryTableView::checkRegionOfInterest().

◆ setDaughtersSelfVisibility()

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

Reimplemented from FWGeometryTableManagerBase.

Definition at line 423 of file FWGeometryTableManager.cc.

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 }

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

◆ setVisibility()

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

Reimplemented from FWGeometryTableManagerBase.

Definition at line 398 of file FWGeometryTableManager.cc.

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 }

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

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

◆ setVisibilityChld()

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

Reimplemented from FWGeometryTableManagerBase.

Definition at line 411 of file FWGeometryTableManager.cc.

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 }

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

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

◆ updateFilter()

void FWGeometryTableManager::updateFilter ( int  iType)

Definition at line 185 of file FWGeometryTableManager.cc.

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 }

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().

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
personalPlayback.level
level
Definition: personalPlayback.py:22
FWGeometryTableManager::checkChildMatches
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume * > &)
Definition: FWGeometryTableManager.cc:158
FWGeometryTableManager::updateFilter
void updateFilter(int)
Definition: FWGeometryTableManager.cc:185
FWGeometryTableManagerBase::kExpanded
Definition: FWGeometryTableManagerBase.h:43
nvidia::inferenceserver
Definition: TritonData.cc:14
mps_fire.i
i
Definition: mps_fire.py:428
FWGeometryTableManager::m_volumes
Volumes_t m_volumes
Definition: FWGeometryTableManager.h:89
FWGeometryTableManager::m_browser
FWGeometryTableView * m_browser
Definition: FWGeometryTableManager.h:87
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
FWGeometryTableManagerBase::m_entries
Entries_v m_entries
Definition: FWGeometryTableManagerBase.h:196
FWGeometryTableViewManager::getGeoMangeur
static TGeoManager * getGeoMangeur()
Definition: FWGeometryTableViewManager.cc:78
FWGeometryTableManager::recalculateVisibilityVolumeRec
void recalculateVisibilityVolumeRec(int)
Definition: FWGeometryTableManager.cc:308
FWGeometryTableManager::Volumes_i
Volumes_t::iterator Volumes_i
Definition: FWGeometryTableManager.h:45
FWGeometryTableView::kFilterMaterialTitle
Definition: FWGeometryTableView.h:32
FWGeometryTableManager::kVisChildColumn
Definition: FWGeometryTableManager.h:32
deep_tau::DeepTauBase::BasicDiscriminator
BasicDiscriminator
Definition: DeepTauBase.h:115
FWGeometryTableView::getFilterType
int getFilterType() const
Definition: FWGeometryTableView.h:50
FWGeometryTableManager::kTranspColumn
Definition: FWGeometryTableManager.h:32
FWGeometryTableManagerBase::m_highlightContext
TGGC * m_highlightContext
Definition: FWGeometryTableManagerBase.h:190
FWGeometryTableManager::importChildren
void importChildren(int parent_idx)
Definition: FWGeometryTableManager.cc:114
FWTextTreeCellRenderer
Definition: FWTextTreeCellRenderer.h:17
cms::cuda::assert
assert(be >=bs)
FWGeometryTableManager::setVisibilityChld
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
Definition: FWGeometryTableManager.cc:411
FWGeometryTableView::getAutoExpand
int getAutoExpand() const
Definition: FWGeometryTableView.h:46
FWGeometryTableView::kFilterShapeClassName
Definition: FWGeometryTableView.h:32
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
FWGeometryTableManager::kVisSelfColumn
Definition: FWGeometryTableManager.h:32
FWTextTreeCellRenderer::showEditor
virtual void showEditor(bool value)
Definition: FWTextTreeCellRenderer.h:62
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
FWGeometryTableManagerBase::kHighlighted
Definition: FWGeometryTableManagerBase.h:48
fetchall_from_DQM_v2.regexp
regexp
Definition: fetchall_from_DQM_v2.py:93
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
cmsdt::algo
algo
Definition: constants.h:164
FWGeometryTableManager::nodeIsParent
bool nodeIsParent(const NodeInfo &) const override
Definition: FWGeometryTableManager.cc:456
FWGeometryTableManager::Volumes_t
std::unordered_map< TGeoVolume *, Match > Volumes_t
Definition: FWGeometryTableManager.h:44
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:157
FWTextTreeCellRenderer::iconWidth
static int iconWidth()
Definition: FWTextTreeCellRenderer.h:58
FWGeometryTableManagerBase::getNNodesTotal
static void getNNodesTotal(TGeoNode *geoNode, int &off)
Definition: FWGeometryTableManagerBase.h:204
FWGeometryTableManagerBase::FWGeometryTableManagerBase
FWGeometryTableManagerBase()
Definition: FWGeometryTableManagerBase.cc:87
FWGeometryTableManagerBase::m_editTransparencyIdx
int m_editTransparencyIdx
Definition: FWGeometryTableManagerBase.h:201
FWGeometryTableManager::kNumColumn
Definition: FWGeometryTableManager.h:32
FWGeometryTableManager::kMaterialColumn
Definition: FWGeometryTableManager.h:32
FWGeometryTableManagerBase::ColorBoxRenderer::setData
void setData(Color_t c, bool)
Definition: FWGeometryTableManagerBase.cc:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FWGeometryTableManager::m_filterOff
bool m_filterOff
Definition: FWGeometryTableManager.h:91
FWGeometryTableManager::recalculateVisibilityNodeRec
void recalculateVisibilityNodeRec(int)
Definition: FWGeometryTableManager.cc:353
FWGeometryTableManagerBase::m_levelOffset
int m_levelOffset
Definition: FWGeometryTableManagerBase.h:198
FWGeometryTableView::drawTopNode
bool drawTopNode() const
Definition: FWGeometryTableView.h:52
FWGeometryTableManager::cellName
const char * cellName(const NodeInfo &data) const override
Definition: FWGeometryTableManager.cc:33
FWGeometryTableManager::assertNodeFilterCache
void assertNodeFilterCache(NodeInfo &data)
Definition: FWGeometryTableManager.cc:379
FWGeometryTableView::kBBoxCenter
Definition: FWGeometryTableView.h:31
FWGeometryTableManagerBase::kVisNodeSelf
Definition: FWGeometryTableManagerBase.h:45
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
FWGeometryTableManager::getVisibility
bool getVisibility(const NodeInfo &nodeInfo) const override
Definition: FWGeometryTableManager.cc:440
createfilelist.int
int
Definition: createfilelist.py:10
FWGeometryTableManager::kNameColumn
Definition: FWGeometryTableManager.h:32
Max
T Max(T a, T b)
Definition: MathUtil.h:44
FWGeometryTableView::getVolumeMode
bool getVolumeMode() const
Definition: FWGeometryTableView.h:44
cc
res
Definition: Electron.h:6
MultipleCompare.Match
def Match(required, got)
Definition: MultipleCompare.py:75
FWGeometryTableViewBase::getTopNodeIdx
int getTopNodeIdx() const
Definition: FWGeometryTableViewBase.h:97
FWGeometryTableManagerBase::kSelected
Definition: FWGeometryTableManagerBase.h:49
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition: FWTextTableCellRenderer.cc:98
alignCSCRings.r
r
Definition: alignCSCRings.py:93
FWGeometryTableView::kBBoxSurface
Definition: FWGeometryTableView.h:31
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
FWGeometryTableManager::kColorColumn
Definition: FWGeometryTableManager.h:32
FWGeometryTableManager::getVisibilityChld
bool getVisibilityChld(const NodeInfo &nodeInfo) const override
Definition: FWGeometryTableManager.cc:447
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
patCandidatesForDimuonsSequences_cff.matches
matches
Definition: patCandidatesForDimuonsSequences_cff.py:131
FWTextTreeCellRenderer::setIsOpen
void setIsOpen(bool value)
Definition: FWTextTreeCellRenderer.h:65
FWGeometryTableManager::kChildMatches
Definition: FWGeometryTableManager.h:34
FWGeometryTableView::kFilterMaterialName
Definition: FWGeometryTableView.h:32
ztail.d
d
Definition: ztail.py:151
FWGeometryTableManagerBase::m_row_to_index
std::vector< int > m_row_to_index
Definition: FWGeometryTableManagerBase.h:194
FWGeometryTableManager::kMatches
Definition: FWGeometryTableManager.h:34
FWGeometryTableView::getFilter
std::string getFilter() const
Definition: FWGeometryTableView.h:45
FWGeometryTableManagerBase::Entries_i
Entries_v::iterator Entries_i
Definition: FWGeometryTableManagerBase.h:88
FWGeometryTableManager::setVisibility
void setVisibility(NodeInfo &nodeInfo, bool) override
Definition: FWGeometryTableManager.cc:398
FWGeometryTableManagerBase::m_renderer
FWTextTreeCellRenderer m_renderer
Definition: FWGeometryTableManagerBase.h:191
FWGeometryTableManagerBase::kVisNodeChld
Definition: FWGeometryTableManagerBase.h:46
FWTextTreeCellRenderer::setIsParent
void setIsParent(bool value)
Definition: FWTextTreeCellRenderer.h:64
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
HLT_FULL_cff.toAdd
toAdd
Definition: HLT_FULL_cff.py:52121
class-composition.parent
parent
Definition: class-composition.py:88
FWGeometryTableView::kFilterShapeName
Definition: FWGeometryTableView.h:32
FWGeometryTableManager::kFilterCached
Definition: FWGeometryTableManager.h:34
FWGeometryTableManagerBase::m_colorBoxRenderer
ColorBoxRenderer m_colorBoxRenderer
Definition: FWGeometryTableManagerBase.h:192
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31
FWTextTreeCellRenderer::setIndentation
virtual void setIndentation(int indentation=0)
Definition: FWTextTreeCellRenderer.h:60
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37