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 31 of file FWGeometryTableManager.h.

Member Typedef Documentation

typedef Volumes_t::iterator FWGeometryTableManager::Volumes_i

Definition at line 54 of file FWGeometryTableManager.h.

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

Definition at line 53 of file FWGeometryTableManager.h.

Member Enumeration Documentation

Enumerator
kMatches 
kChildMatches 
kFilterCached 

Definition at line 36 of file FWGeometryTableManager.h.

Constructor & Destructor Documentation

FWGeometryTableManager::FWGeometryTableManager ( FWGeometryTableView v)

Definition at line 29 of file FWGeometryTableManager.cc.

Referenced by numberOfColumns().

FWGeometryTableManager::~FWGeometryTableManager ( )
override

Definition at line 35 of file FWGeometryTableManager.cc.

36 {}
FWGeometryTableManager::FWGeometryTableManager ( const FWGeometryTableManager )
privatedelete

Member Function Documentation

void FWGeometryTableManager::assertNodeFilterCache ( NodeInfo data)

Definition at line 431 of file FWGeometryTableManager.cc.

References kChildMatches, FWGeometryTableManagerBase::kExpanded, kFilterCached, kMatches, FWGeometryTableManagerBase::NodeInfo::m_node, m_volumes, patRefSel_triggerMatching_cfi::matches, FWGeometryTableManagerBase::NodeInfo::setBit(), FWGeometryTableManagerBase::NodeInfo::setBitVal(), setVisibility(), setVisibilityChld(), and FWGeometryTableManagerBase::NodeInfo::testBit().

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

432 {
433  if (! data.testBit(kFilterCached))
434  {
435  bool matches = m_volumes[data.m_node->GetVolume()].m_matches;
436  // if (matches) printf("%s matches filter \n", data.name());
437  data.setBitVal(kMatches, matches);
438  setVisibility(data, matches);
439 
440  bool childMatches = m_volumes[data.m_node->GetVolume()].m_childMatches;
441  data.setBitVal(kChildMatches, childMatches);
442  data.setBitVal(kExpanded, childMatches);
443  setVisibilityChld(data, childMatches);
444 
445  data.setBit(kFilterCached);
446  // printf("%s matches [%d] childMatches [%d] ................ %d %d \n", data.name(), data.testBit(kMatches), data.testBit(kChildMatches), matches , childMatches);
447  }
448 }
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
const char * FWGeometryTableManager::cellName ( const NodeInfo data) const
overrideprotectedvirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 38 of file FWGeometryTableManager.cc.

References FWGeometryTableView::getVolumeMode(), m_browser, and FWGeometryTableManagerBase::NodeInfo::m_node.

Referenced by cellRenderer(), and numberOfColumns().

39 {
40  if (m_browser->getVolumeMode())
41  return Form("%s [%d]", data.m_node->GetVolume()->GetName(), data.m_node->GetNdaughters());
42  else
43  return Form("%s [%d]", data.m_node->GetName(), data.m_node->GetNdaughters());
44 }
FWGeometryTableView * m_browser
bool getVolumeMode() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 48 of file FWGeometryTableManager.cc.

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

Referenced by numberOfColumns().

49 {
51  if (m_row_to_index.empty()) return renderer;
52 
53  int unsortedRow = m_row_to_index[iSortedRowNumber];
54  if (unsortedRow < 0) printf("!!!!!!!!!!!!!!!! error %d %d \n",unsortedRow, iSortedRowNumber);
55 
56  // editor state
57  //
58  m_renderer.showEditor(unsortedRow == m_editTransparencyIdx && iCol == kTranspColumn);
59 
60  // selection state
61  //
62  const NodeInfo& data = m_entries[unsortedRow];
63  TGeoNode& gn = *data.m_node;
64  bool isSelected = data.testBit(kHighlighted) || data.testBit(kSelected);
65  // printf("cell render %s \n", data.name());
66  if (data.testBit(kSelected))
67  {
68  m_highlightContext->SetBackground(0xc86464);
69  }
70  else if (data.testBit(kHighlighted) )
71  {
72  m_highlightContext->SetBackground(0x6464c8);
73  }
74  else if (iCol == kMaterialColumn && data.testBit(kMatches) )
75  {
76  m_highlightContext->SetBackground(0xdddddd);
77  }
78 
79  // set column content
80  //
81  if (iCol == kNameColumn)
82  {
83  renderer->setData(cellName(data), isSelected);
84 
85  renderer->setIsParent(nodeIsParent(data));
86 
87  renderer->setIsOpen( data.testBit(FWGeometryTableManagerBase::kExpanded));
88 
89  int level = data.m_level - m_levelOffset;
90  if (nodeIsParent(data))
91  renderer->setIndentation(20*level);
92  else
93  renderer->setIndentation(20*level + FWTextTreeCellRenderer::iconWidth());
94 
95  return renderer;
96  }
97  else
98  {
99  // printf("title %s \n",data.m_node->GetTitle());
100  renderer->setIsParent(false);
101  renderer->setIndentation(0);
102  if (iCol == kColorColumn)
103  {
104  // m_colorBoxRenderer.setData(data.m_node->GetVolume()->GetLineColor(), isSelected);
105  m_colorBoxRenderer.setData(data.m_color, isSelected);
106  return &m_colorBoxRenderer;
107  }
108  else if (iCol == kTranspColumn)
109  {
110  renderer->setData(Form("%d", 100 -data.m_transparency), isSelected);
111  return renderer;
112  }
113  else if (iCol == kVisSelfColumn)
114  {
115  renderer->setData(getVisibility(data) ? "On" : "-", isSelected);
116  return renderer;
117  }
118  else if (iCol == kVisChildColumn)
119  {
120  renderer->setData( getVisibilityChld(data) ? "On" : "-", isSelected);
121  return renderer;
122  }
123  else if (iCol == kMaterialColumn)
124  {
125  renderer->setData( gn.GetVolume()->GetMaterial()->GetName(), isSelected);
126  return renderer;
127  }
128  else
129  { renderer->setData("ERROR", false);
130  return renderer;
131  }
132  }
133 }
bool getVisibility(const NodeInfo &nodeInfo) const override
const char * cellName(const NodeInfo &data) const override
bool getVisibilityChld(const NodeInfo &nodeInfo) const override
virtual void setIndentation(int indentation=0)
void setData(const std::string &, bool isSelected)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool nodeIsParent(const NodeInfo &) const override
virtual void showEditor(bool value)
void FWGeometryTableManager::checkChildMatches ( TGeoVolume *  v,
std::vector< TGeoVolume * > &  pstack 
)

Definition at line 186 of file FWGeometryTableManager.cc.

References mps_fire::i, FWGeometryTableManager::Match::m_childMatches, m_volumes, fetchall_from_DQM_v2::regexp, alignCSCRings::s, and w.

Referenced by updateFilter().

187 {
188  if (m_volumes[vol].m_matches)
189  {
190  for (std::vector<TGeoVolume*>::iterator i = pstack.begin(); i != pstack.end(); ++i)
191  {
192  Match& pm = m_volumes[*i];
193  pm.m_childMatches = true;
194  }
195  }
196 
197  pstack.push_back(vol);
198 
199  int nD = vol->GetNdaughters(); //TMath::Min(m_browser->getMaxDaughters(), vol->GetNdaughters());
200  for (int i = 0; i < nD; ++i)
201  checkChildMatches(vol->GetNode(i)->GetVolume(), pstack);
202 
203  pstack.pop_back();
204 }
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume * > &)
def Match(required, got)
void FWGeometryTableManager::checkHierarchy ( )

Definition at line 162 of file FWGeometryTableManager.cc.

References edmIntegrityCheck::d, MillePedeFileConverter_cfg::e, mps_fire::i, FWGeometryTableManagerBase::m_entries, dataset::name, and convertSQLiteXML::ok.

163 {
164  // Used for debug: in a NodeInfo entry look TGeoNode children from parent index and check
165  // if child is found.
166 
167  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
168  {
169  if (m_entries[i].m_level > 0)
170  {
171  TGeoNode* pn = m_entries[m_entries[i].m_parent].m_node;
172  bool ok = false;
173  for (int d = 0; d < pn->GetNdaughters(); ++d)
174  {
175  if (m_entries[i].m_node == pn->GetDaughter(d))
176  {
177  ok = true;
178  break;
179  }
180  }
181  if (! ok) printf("!!!!!! node %s has false parent %s \n", m_entries[i].name(), pn->GetName());
182  }
183  }
184 }
void FWGeometryTableManager::checkRegionOfInterest ( double *  center,
double  radius,
long  algo 
)

Definition at line 531 of file FWGeometryTableManager.cc.

References edmIntegrityCheck::d, delta, FWGeometryTableViewManager::getGeoMangeur(), mps_fire::i, FWGeometryTableView::kBBoxCenter, FWGeometryTableView::kBBoxSurface, FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, FWGeometryTableManagerBase::m_entries, alignCSCRings::r, TCMET_cfi::radius, and lumiQTWidget::t.

Referenced by FWGeometryTableView::checkRegionOfInterest(), and numberOfColumns().

532 {
533  double sqr_r = radius * radius;
534 
535  for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni)
536  ni->resetBit(kVisNodeChld);
537 
538  int cnt = 0;
539  TEveGeoManagerHolder mangeur( FWGeometryTableViewManager::getGeoMangeur());
540  printf("FWGeometryTableManagerBase::checkRegionOfInterest BEGIN r=%d center= (%.1f, %.1f, %.1f)\n ", (int)radius, center[0], center[1], center[2]);
541  TGeoIterator git(m_entries[0].m_node->GetVolume());
542  Entries_i eit(m_entries.begin());
543  while (git())
544  {
545  const TGeoMatrix *gm = git.GetCurrentMatrix();
546  const TGeoBBox *bb = static_cast<TGeoBBox*>(eit->m_node->GetVolume()->GetShape());
547  const Double_t *bo = bb->GetOrigin();
548  const Double_t bd[] = { bb->GetDX(), bb->GetDY(), bb->GetDZ() };
549  const Double_t *cc = center;
550 
551  bool visible = false;
552 
553  switch (algo)
554  {
556  {
557  const Double_t *t = gm->GetTranslation();
558  TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
559  Double_t sqr_d = d.Mag2();;
560  visible = (sqr_d <= sqr_r);
561  break;
562  }
564  {
565  assert (gm->IsScale() == false);
566 
567  const Double_t *t = gm->GetTranslation();
568  const Double_t *r = gm->GetRotationMatrix();
569  TEveVectorD d(cc[0] - (t[0] + bo[0]), cc[1] - (t[1] + bo[1]), cc[2] - (t[2] + bo[2]));
570  Double_t sqr_d = 0;
571  for (Int_t i = 0; i < 3; ++i)
572  {
573  Double_t dp = d[0]*r[i] + d[1]*r[i+3] + d[2]*r[i+6];
574  if (dp < -bd[i])
575  {
576  Double_t delta = dp + bd[i];
577  sqr_d += delta * delta;
578  }
579  else if (dp > bd[i])
580  {
581  Double_t delta = dp - bd[i];
582  sqr_d += delta * delta;
583  }
584  }
585  visible = (sqr_d <= sqr_r);
586  }
587  }
588 
589  if (visible)
590  {
591  eit->setBit(kVisNodeSelf);
592  int pidx = eit->m_parent;
593  while (pidx >= 0)
594  {
595  m_entries[pidx].setBit(kVisNodeChld);
596  pidx = m_entries[pidx].m_parent;
597  ++cnt;
598  }
599  }
600  else
601  {
602  eit->resetBit(kVisNodeSelf);
603  }
604  eit++;
605  }
606 
607  printf("FWGeometryTableManager::checkRegionOfInterest END [%d]\n ", cnt);
608 }
dbl * delta
Definition: mlp_gen.cc:36
bool FWGeometryTableManager::getVisibility ( const NodeInfo nodeInfo) const
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 506 of file FWGeometryTableManager.cc.

References FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeSelf, m_browser, FWGeometryTableManagerBase::NodeInfo::m_node, and FWGeometryTableManagerBase::NodeInfo::testBit().

Referenced by cellRenderer().

507 {
508  if (m_browser->getVolumeMode())
509  return data.m_node->GetVolume()->IsVisible();
510 
511  return data.testBit(kVisNodeSelf);
512 }
FWGeometryTableView * m_browser
bool getVolumeMode() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool FWGeometryTableManager::getVisibilityChld ( const NodeInfo nodeInfo) const
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 514 of file FWGeometryTableManager.cc.

References FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeChld, m_browser, FWGeometryTableManagerBase::NodeInfo::m_node, and FWGeometryTableManagerBase::NodeInfo::testBit().

Referenced by cellRenderer().

515 {
516  if (m_browser->getVolumeMode())
517  return data.m_node->GetVolume()->IsVisibleDaughters();
518 
519  return data.testBit(kVisNodeChld);
520 }
FWGeometryTableView * m_browser
bool getVolumeMode() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FWGeometryTableManager::importChildren ( int  parent_idx)

Definition at line 137 of file FWGeometryTableManager.cc.

References data, FWGeometryTableView::getAutoExpand(), FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableManagerBase::kExpanded, m_browser, FWGeometryTableManagerBase::NodeInfo::m_color, FWGeometryTableManagerBase::m_entries, FWGeometryTableManagerBase::NodeInfo::m_level, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::NodeInfo::m_parent, FWGeometryTableManagerBase::NodeInfo::m_transparency, gen::n, class-composition::parent, and FWGeometryTableManagerBase::NodeInfo::setBit().

Referenced by loadGeometry().

138 {
139  NodeInfo& parent = m_entries[parent_idx];
140  TGeoNode* parentGeoNode = parent.m_node;
141  int parentLevel = parent.m_level;
142 
143  int nV = parentGeoNode->GetNdaughters();
144  int dOff = 0;
145  for (int n = 0; n != nV; ++n)
146  {
147  NodeInfo& data = m_entries[parent_idx + n + 1 + dOff];
148  data.m_node = parentGeoNode->GetDaughter(n);
149  data.m_level = parentLevel + 1;
150  data.m_parent = parent_idx;
151  data.m_color = data.m_node->GetVolume()->GetLineColor();
152  data.m_transparency = data.m_node->GetVolume()->GetTransparency();
153  if (data.m_level <= m_browser->getAutoExpand()) data.setBit(kExpanded);
154 
155  importChildren(parent_idx + n + 1 + dOff);
156  getNNodesTotal(parentGeoNode->GetDaughter(n), dOff);
157  }
158 }
FWGeometryTableView * m_browser
static void getNNodesTotal(TGeoNode *geoNode, int &off)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void importChildren(int parent_idx)
void FWGeometryTableManager::loadGeometry ( TGeoNode *  iGeoTopNode,
TObjArray *  iVolumes 
)

Definition at line 268 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().

269 {
270 #ifdef PERFTOOL_GEO_TABLE
271  ProfilerStart("loadGeo");
272 #endif
273 
274  // Prepare data for cell render.
275 
276  // clear entries
277  m_entries.clear();
278  m_row_to_index.clear();
279  m_volumes.clear();
280  m_levelOffset = 0;
281 
282  // set volume table for filters
283  Volumes_t pipi(iVolumes->GetSize());
284  m_volumes.swap(pipi);
285  TIter next( iVolumes);
286  TGeoVolume* v;
287  while ((v = (TGeoVolume*) next()) != nullptr)
288  m_volumes.insert(std::make_pair(v, Match()));
289 
290  if (!m_filterOff)
292 
293  // add top node to init
294 
295  int nTotal = 0;
296  NodeInfo topNodeInfo;
297  topNodeInfo.m_node = iGeoTopNode;
298  topNodeInfo.m_level = 0;
299  topNodeInfo.m_parent = -1;
300  topNodeInfo.m_color = iGeoTopNode->GetVolume()->GetLineColor();
301  topNodeInfo.m_transparency = iGeoTopNode->GetVolume()->GetTransparency();
302  topNodeInfo.setBitVal(kExpanded, m_browser->getAutoExpand());
303  topNodeInfo.setBitVal(kVisNodeSelf, m_browser->drawTopNode());
304 
305  getNNodesTotal(topNodeInfo.m_node , nTotal);
306  m_entries.resize(nTotal+1);
307  m_entries[0] = topNodeInfo;
308 
309  importChildren(0);
310 
311  // checkHierarchy();
312 
313 #ifdef PERFTOOL_GEO_TABLE
314  ProfilerStop();
315 #endif
316 }
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)
bool FWGeometryTableManager::nodeIsParent ( const NodeInfo data) const
overrideprotectedvirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 524 of file FWGeometryTableManager.cc.

References kChildMatches, m_filterOff, FWGeometryTableManagerBase::NodeInfo::m_node, and FWGeometryTableManagerBase::NodeInfo::testBit().

Referenced by cellRenderer(), and numberOfColumns().

525 {
526  return (data.m_node->GetNdaughters() != 0) && (m_filterOff || data.testBit(kChildMatches));
527 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int FWGeometryTableManager::numberOfColumns ( ) const
inlineoverridevirtual
const FWGeometryTableManager& FWGeometryTableManager::operator= ( const FWGeometryTableManager )
privatedelete

Referenced by numberOfColumns().

void FWGeometryTableManager::printMaterials ( )

Definition at line 320 of file FWGeometryTableManager.cc.

References MessageLogger_cfi::cerr.

321 {
322  std::cerr << "not implemented \n";
323 }
void FWGeometryTableManager::recalculateVisibility ( )
overridevirtual

Implements FWGeometryTableManagerBase.

Definition at line 327 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, Max(), recalculateVisibilityNodeRec(), recalculateVisibilityVolumeRec(), and FWGeometryTableManagerBase::NodeInfo::testBit().

328 {
329  m_row_to_index.clear();
330 
331  int i = TMath::Max(0, m_browser->getTopNodeIdx());
332  m_row_to_index.push_back(i);
333 
334  NodeInfo& data = m_entries[i];
335 
336  if (!m_filterOff)
337  assertNodeFilterCache(data);
338 
339  if ((m_filterOff && data.testBit(kExpanded) == false) ||
340  (m_filterOff == false && data.testBit(kChildMatches) == false))
341  return;
342 
343  if (m_browser->getVolumeMode())
345  else
347 
348  // printf (" child [%d] FWGeometryTableManagerBase::recalculateVisibility table size %d \n", (int)m_row_to_index.size());
349 }
FWGeometryTableView * m_browser
void assertNodeFilterCache(NodeInfo &data)
T Max(T a, T b)
Definition: MathUtil.h:44
bool getVolumeMode() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FWGeometryTableManager::recalculateVisibilityNodeRec ( int  pIdx)

Definition at line 403 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), data, FWGeometryTableManagerBase::getNNodesTotal(), training_settings::idx, kChildMatches, FWGeometryTableManagerBase::kExpanded, kMatches, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::m_row_to_index, gen::n, FWGeometryTableManagerBase::NodeInfo::testBit(), and FWGeometryTableManagerBase::NodeInfo::testBitAny().

Referenced by recalculateVisibility().

404 {
405  TGeoNode* parentNode = m_entries[pIdx].m_node;
406  int nD = parentNode->GetNdaughters();
407  int dOff = 0;
408  for (int n = 0; n != nD; ++n)
409  {
410  int idx = pIdx + 1 + n + dOff;
411  NodeInfo& data = m_entries[idx];
412 
413  if (m_filterOff)
414  {
415  m_row_to_index.push_back(idx);
416  if (data.testBit(kExpanded)) recalculateVisibilityNodeRec(idx);
417  }
418  else
419  {
420  assertNodeFilterCache(data);
421  if (data.testBitAny(kMatches | kChildMatches)) m_row_to_index.push_back(idx);
422  if (data.testBit(kChildMatches) && data.testBit(kExpanded) ) recalculateVisibilityNodeRec(idx);
423  }
424 
425  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
426  }
427 }
void assertNodeFilterCache(NodeInfo &data)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FWGeometryTableManager::recalculateVisibilityVolumeRec ( int  pIdx)

Definition at line 353 of file FWGeometryTableManager.cc.

References assertNodeFilterCache(), data, FWGeometryTableManagerBase::getNNodesTotal(), training_settings::idx, kChildMatches, FWGeometryTableManagerBase::kExpanded, kMatches, FWGeometryTableManagerBase::m_entries, m_filterOff, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::m_row_to_index, gen::n, FWGeometryTableManagerBase::NodeInfo::testBit(), FWGeometryTableManagerBase::NodeInfo::testBitAny(), and pfDeepCMVAJetTags_cfi::toAdd.

Referenced by recalculateVisibility().

354 {
355  TGeoNode* parentNode = m_entries[pIdx].m_node;
356  int nD = parentNode->GetNdaughters();
357  int dOff=0;
358 
359  // printf("----------- parent %s\n", parentNode->GetName() );
360 
361  std::vector<int> vi;
362  vi.reserve(nD);
363 
364  for (int n = 0; n != nD; ++n)
365  {
366  int idx = pIdx + 1 + n + dOff;
367  NodeInfo& data = m_entries[idx];
368 
369  bool toAdd = true;
370  for (std::vector<int>::iterator u = vi.begin(); u != vi.end(); ++u )
371  {
372  TGeoVolume* neighbourVolume = parentNode->GetDaughter(*u)->GetVolume();
373  if (neighbourVolume == data.m_node->GetVolume())
374  {
375  toAdd = false;
376  // printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
377  break;
378  }
379  }
380 
381  if (toAdd)
382  {
383  vi.push_back(n);
384  if (m_filterOff)
385  {
386  // std::cout << data.nameIndent() << std::endl;
387  m_row_to_index.push_back(idx);
388  if (data.testBit(kExpanded)) recalculateVisibilityVolumeRec(idx);
389  }
390  else
391  {
392  assertNodeFilterCache(data);
393  if (data.testBitAny(kMatches | kChildMatches)) m_row_to_index.push_back(idx);
394  if (data.testBit(kChildMatches) && data.testBit(kExpanded)) recalculateVisibilityVolumeRec(idx);
395  }
396  }
397  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
398  }
399 }
void assertNodeFilterCache(NodeInfo &data)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FWGeometryTableManager::resetRegionOfInterest ( )
void FWGeometryTableManager::setDaughtersSelfVisibility ( int  i,
bool  v 
)
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 487 of file FWGeometryTableManager.cc.

References data, FWGeometryTableManagerBase::getNNodesTotal(), training_settings::idx, FWGeometryTableManagerBase::m_entries, gen::n, setVisibility(), and setVisibilityChld().

488 {
489  TGeoNode *parentNode = m_entries[selectedIdx].m_node;
490  int nD = parentNode->GetNdaughters();
491  int dOff = 0;
492  for (int n = 0; n != nD; ++n)
493  {
494  int idx = selectedIdx + 1 + n + dOff;
495  NodeInfo& data = m_entries[idx];
496 
497  setVisibility(data, v);
498  setVisibilityChld(data, v);
499 
500  FWGeometryTableManager::getNNodesTotal(parentNode->GetDaughter(n), dOff);
501  }
502 }
static void getNNodesTotal(TGeoNode *geoNode, int &off)
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
void FWGeometryTableManager::setVisibility ( NodeInfo nodeInfo,
bool  x 
)
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 452 of file FWGeometryTableManager.cc.

References FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeSelf, m_browser, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::NodeInfo::setBitVal(), and x.

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

453 {
454  if (m_browser->getVolumeMode())
455  {
456  if (data.m_node->GetVolume()->IsVisible() != x)
457  {
459  data.m_node->GetVolume()->SetVisibility(x);
460  }
461  }
462  else
463  {
464  data.setBitVal(kVisNodeSelf, x);
465  }
466 }
FWGeometryTableView * m_browser
bool getVolumeMode() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FWGeometryTableManager::setVisibilityChld ( NodeInfo nodeInfo,
bool  x 
)
overridevirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 470 of file FWGeometryTableManager.cc.

References FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableView::getVolumeMode(), FWGeometryTableManagerBase::kVisNodeChld, m_browser, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::NodeInfo::setBitVal(), and x.

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

471 {
472  if (m_browser->getVolumeMode())
473  {
474  if (data.m_node->GetVolume()->IsVisibleDaughters() != x)
475  {
476  TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());
477  data.m_node->GetVolume()->VisibleDaughters(x);
478  }
479  }
480  else
481  {
482  data.setBitVal(kVisNodeChld, x);
483  }
484 }
FWGeometryTableView * m_browser
bool getVolumeMode() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FWGeometryTableManager::updateFilter ( int  iType)

Definition at line 216 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().

217 {
218  std::string filterExp = m_browser->getFilter();
219  m_filterOff = filterExp.empty();
220  printf("update filter %s OFF %d volumes size %d\n",filterExp.c_str(), m_filterOff , (int)m_volumes.size());
221 
222  if (m_filterOff || m_entries.empty()) return;
223 
224  // update volume-match entries
225  int numMatched = 0;
226 
227  TPMERegexp regexp(TString(filterExp.c_str()), "o");
228  for (Volumes_i i = m_volumes.begin(); i != m_volumes.end(); ++i)
229  {
230  int res = 0;
231 
233  {
234  res = matchTPME( i->first->GetMaterial()->GetName() , regexp);
235  }
237  {
238  res = matchTPME( i->first->GetMaterial()->GetTitle() , regexp);
239  }
240  else if (iType == FWGeometryTableView::kFilterShapeName)
241  {
242  res = matchTPME( i->first->GetShape()->GetName() , regexp);
243  }
245  {
246  res = matchTPME( i->first->GetShape()->ClassName() , regexp);
247  }
248 
249  i->second.m_matches = (res > 0);
250  i->second.m_childMatches = false;
251  if (res) numMatched++;
252  }
253 
254  printf("update filter [%d] volumes matched\n", numMatched);
255  std::vector<TGeoVolume*> pstack;
256  checkChildMatches(m_entries[0].m_node->GetVolume(), pstack);
257 
258  for (Entries_i ni = m_entries.begin(); ni != m_entries.end(); ++ni)
259  {
260  ni->resetBit(kFilterCached);
262  }
263 
264 }
FWGeometryTableView * m_browser
std::string getFilter() const
Definition: Electron.h:6
void assertNodeFilterCache(NodeInfo &data)
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume * > &)
Volumes_t::iterator Volumes_i

Member Data Documentation

FWGeometryTableView* FWGeometryTableManager::m_browser
private
bool FWGeometryTableManager::m_filterOff
private
Volumes_t FWGeometryTableManager::m_volumes
mutableprivate