CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
FWOverlapTableManager Class Reference

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

Inheritance diagram for FWOverlapTableManager:
FWGeometryTableManagerBase FWTableManagerBase

Classes

class  QuadId
 

Public Types

enum  OverlapBits { kVisMarker = BIT(5), kOverlap = BIT(6), kOverlapChild = BIT(7) }
 
- 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

FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const
 
 FWOverlapTableManager (FWOverlapTableView *)
 
void getOverlapTitles (int, TString &) const
 
virtual std::vector< std::string > getTitles () const
 returns the title names for each column More...
 
void importOverlaps (std::string path, double precision)
 
virtual int numberOfColumns () const
 Number of columns in the table. More...
 
void printOverlaps (int) const
 
virtual void recalculateVisibility ()
 
virtual void recalculateVisibilityNodeRec (int)
 
void setDaughtersSelfVisibility (int i, bool v)
 
virtual ~FWOverlapTableManager ()
 
- Public Member Functions inherited from FWGeometryTableManagerBase
virtual void applyColorTranspToDaughters (int selectedIdx, bool recurse)
 
void applyTransparencyFromEditor ()
 
void cancelEditor (bool)
 
virtual bool cellDataIsSortable () const
 
virtual const char * cellName (const NodeInfo &) const
 
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 ()
 
virtual bool getVisibility (const NodeInfo &nodeInfo) const
 
virtual bool getVisibilityChld (const NodeInfo &nodeInfo) const
 
virtual void implSort (int, bool)
 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
 
virtual int numberOfRows () const
 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)
 
virtual void setVisibility (NodeInfo &, bool)
 
virtual void setVisibilityChld (NodeInfo &, bool)
 
void showEditor (int)
 
virtual const std::string title () const
 
virtual int unsortedRowNumber (int unsorted) const
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data More...
 
virtual ~FWGeometryTableManagerBase ()
 
- 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...
 
 ClassDef (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...
 
virtual ~FWTableManagerBase ()
 

Protected Member Functions

virtual bool nodeIsParent (const NodeInfo &) const
 

Private Member Functions

void addOverlapEntry (TGeoOverlap *, int, int, TGeoHMatrix *)
 
 FWOverlapTableManager (const FWOverlapTableManager &)
 
const FWOverlapTableManageroperator= (const FWOverlapTableManager &)
 

Private Attributes

FWOverlapTableViewm_browser
 
std::multimap< int, int > m_mapNodeOverlaps
 

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 33 of file FWOverlapTableManager.h.

Member Enumeration Documentation

Enumerator
kVisMarker 
kOverlap 
kOverlapChild 

Definition at line 36 of file FWOverlapTableManager.h.

Constructor & Destructor Documentation

FWOverlapTableManager::FWOverlapTableManager ( FWOverlapTableView v)

Definition at line 40 of file FWOverlapTableManager.cc.

40  :
42  m_browser(v)
43 {
44 }
FWOverlapTableView * m_browser
FWOverlapTableManager::~FWOverlapTableManager ( )
virtual

Definition at line 46 of file FWOverlapTableManager.cc.

47 {
48 }
FWOverlapTableManager::FWOverlapTableManager ( const FWOverlapTableManager )
private

Member Function Documentation

void FWOverlapTableManager::addOverlapEntry ( TGeoOverlap *  ,
int  ,
int  ,
TGeoHMatrix *   
)
private

Definition at line 212 of file FWOverlapTableManager.cc.

References Abs(), fwLog, FWGeometryTableViewBase::getMarker(), FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableViewBase::getTopNodeIdx(), i, j, fwlog::kInfo, kOverlap, kOverlapChild, FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, m_browser, FWGeometryTableManagerBase::m_entries, m_mapNodeOverlaps, FWOverlapTableManager::QuadId::m_nodes, and gen::n.

Referenced by importOverlaps().

213 {
214 
215  // printf("add %s \n", ovl->GetTitle());
216  // get doughter indices of overlaps
217  /*
218  TPMERegexp re(" ", "o");
219  re.Split(TString(ovl->GetTitle()));
220  printf("add title %s \n", ovl->GetTitle());
221  */
222  int pcnt = parentIdx+1;
223  int dOff =0;
224  TGeoNode* mothern = m_entries[parentIdx].m_node;
225 
226  QuadId* quid = new QuadId(ovl, parentIdx);
227 
228  for (int i = 0; i < mothern->GetNdaughters(); ++i)
229  {
230  TGeoNode* n = mothern->GetDaughter(i);
231 
232  int cnt = pcnt + i+dOff;
233 
234  if (ovl->IsOverlap()) {
235  if (n->GetVolume() == ovl->GetFirstVolume() && (*(ovl->GetFirstMatrix()) == *(n->GetMatrix())))
236  {
237  // std::string x = re[0].Data();
238  //if (x.find(n->GetName()) == std::string::npos) printf("ERROT \n");
239 
240  m_entries[cnt].setBit(kOverlap);
241  m_entries[cnt].setBit(kVisNodeSelf);
242  m_mapNodeOverlaps.insert(std::pair<int, int>(cnt, ovlIdx));
243  int nno; n->GetOverlaps(nno);
244  nno |= BIT(1); n->SetOverlaps(0, nno);
245  quid->m_nodes.push_back(cnt);
246  }
247  }
248 
249  if (n->GetVolume() == ovl->GetSecondVolume() && (*(ovl->GetSecondMatrix()) == *(n->GetMatrix())))
250  {
251  //printf("-----------------------------------------------\n");
252  // std::string x = re[2].Data();
253  // if (x.find(n->GetName()) == std::string::npos) printf("ERROT \n");
254 
255  m_entries[cnt].setBit(kOverlap);
256  m_entries[cnt].setBit(kVisNodeSelf);
257 
258  m_mapNodeOverlaps.insert(std::pair<int, int>(cnt, ovlIdx));
259  int nno; n->GetOverlaps(nno);
260  nno |= (ovl->IsOverlap() ? BIT(1) : BIT(2));
261  n->SetOverlaps(0, nno);
262 
263  quid->m_nodes.push_back(cnt);
264 
265  }
266 
267 
269  }
270 
271  TPolyMarker3D* pm = ovl->GetPolyMarker();
272  for (int j=0; j<pm->GetN(); ++j )
273  {
274  double pl[3];
275  double pg[3];
276  pm->GetPoint(j, pl[0], pl[1], pl[2]);
277  motherm->LocalToMaster(pl, pg);
278 
279  float dx = TMath::Abs(ovl->GetOverlap());
280  if (dx > 1e5)
281  {
282  fwLog(fwlog::kInfo) << Form("WARNING [%s], overlap size = %.1f \n", ovl->GetTitle(), dx);
283  dx = 10;
284  }
285  float dy = dx, dz = 0;
286  float fp[3]; fp[0] = pg[0];fp[1] = pg[1];fp[2] = pg[2];
287  float bb[12] = {
288  fp[0] +dx, fp[1] -dy, fp[2] -dz,
289  fp[0] +dx, fp[1] +dy, fp[2] +dz,
290  fp[0] -dx, fp[1] +dy, fp[2] +dz,
291  fp[0] -dx, fp[1] -dy, fp[2] -dz
292  };
293  m_browser->getMarker()->AddQuad(&bb[0]);
294  m_browser->getMarker()->QuadId(quid);
295  }
296 
297 
298  int aIdx = parentIdx; int aLev = m_entries[aIdx].m_level;
299  int topNodeIdx = m_browser->getTopNodeIdx();
300 
301  while(aIdx > topNodeIdx)
302  {
303  aIdx--;
304  if (m_entries[aIdx].m_level < aLev)
305  {
306  m_entries[aIdx].setBit(kOverlapChild);
307  m_entries[aIdx].setBit(kVisNodeChld);
308  // printf("stamp %s \n", m_entries[aIdx].name());
309  aLev--;
310  }
311  }
312 }
int i
Definition: DBlmapReader.cc:9
std::multimap< int, int > m_mapNodeOverlaps
FWEveDigitSetScalableMarker * getMarker()
T Abs(T a)
Definition: MathUtil.h:49
int j
Definition: DBlmapReader.cc:9
static void getNNodesTotal(TGeoNode *geoNode, int &off)
#define fwLog(_level_)
Definition: fwLog.h:50
FWOverlapTableView * m_browser
FWTableCellRendererBase * FWOverlapTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const
virtual
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 411 of file FWOverlapTableManager.cc.

References dtNoiseDBValidation_cfg::cerr, data, FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableViewBase::getTopNodeIdx(), FWTextTreeCellRenderer::iconWidth(), FWGeometryTableManagerBase::kExpanded, FWGeometryTableManagerBase::kHighlighted, kOverlap, FWGeometryTableManagerBase::kSelected, FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, testEve_cfg::level, FWOverlapTableView::listAllNodes(), m_browser, FWGeometryTableManagerBase::NodeInfo::m_color, FWGeometryTableManagerBase::m_colorBoxRenderer, FWGeometryTableManagerBase::m_editTransparencyIdx, FWGeometryTableManagerBase::m_entries, FWGeometryTableManagerBase::m_highlightContext, FWGeometryTableManagerBase::NodeInfo::m_level, FWGeometryTableManagerBase::m_levelOffset, m_mapNodeOverlaps, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::m_renderer, FWGeometryTableManagerBase::m_row_to_index, FWGeometryTableManagerBase::NodeInfo::m_transparency, FWGeometryTableManagerBase::NodeInfo::name(), Vispa.Plugins.EdmBrowser.EdmDataAccessor::ne(), nodeIsParent(), FWTextTableCellRenderer::setData(), FWGeometryTableManagerBase::ColorBoxRenderer::setData(), FWTextTreeCellRenderer::setIndentation(), FWTextTreeCellRenderer::setIsOpen(), FWTextTreeCellRenderer::setIsParent(), FWTextTreeCellRenderer::showEditor(), AlCaHLTBitMon_QueryRunRegistry::string, FWGeometryTableManagerBase::NodeInfo::testBit(), and x.

412 {
413  if (m_row_to_index.empty()) return &m_renderer;
414 
415  int unsortedRow = m_row_to_index[iSortedRowNumber];
416 
417  if (unsortedRow < 0) printf("!!!!!!!!!!!!!!!! error %d %d \n",unsortedRow, iSortedRowNumber);
418 
419  // editor state
420  //
421  m_renderer.showEditor(unsortedRow == m_editTransparencyIdx && iCol == 2);
422 
423 
424  // selection state
425  //
426  const NodeInfo& data = m_entries[unsortedRow];
427 
428  bool isSelected = data.testBit(kHighlighted) || data.testBit(kSelected);
429  if (m_browser->listAllNodes()) isSelected = isSelected || data.testBit(kOverlap);
430 
431  if (data.testBit(kSelected))
432  {
433  m_highlightContext->SetBackground(0xc86464);
434  }
435  else if (data.testBit(kHighlighted) )
436  {
437  m_highlightContext->SetBackground(0x6464c8);
438  }
439  else if (m_browser->listAllNodes() && data.testBit(kOverlap) )
440  {
441  m_highlightContext->SetBackground(0xdddddd);
442  }
443 
444 
445  // set column content
446  //
447  if (iCol == 0)
448  {
449  if (unsortedRow == m_browser->getTopNodeIdx())
450  {
451  int no = 0, ne =0;
452  TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());
453  TIter next_ovl(gGeoManager->GetListOfOverlaps());
454  const TGeoOverlap* ovl;
455  while((ovl = (TGeoOverlap*)next_ovl()))
456  ovl->IsOverlap() ? no++ : ne++;
457 
458  m_renderer.setData(Form("%s Ovl[%d] Ext[%d]", data.m_node->GetName(), no, ne), isSelected);
459  }
460  else {
461  m_renderer.setData(data.name(), isSelected);
462  }
464 
466 
467  int level = data.m_level - m_levelOffset;
468  if (nodeIsParent(data))
469  m_renderer.setIndentation(20*level);
470  else
472  }
473  else
474  {
475  m_renderer.setIsParent(false);
477 
478  if (iCol == 5)
479  {
480  if (data.testBit(kOverlap) )
481  {
482  std::string x;
483  std::pair<std::multimap<int, int>::const_iterator, std::multimap<int, int>::const_iterator> ppp;
484  ppp = m_mapNodeOverlaps.equal_range(unsortedRow);
485 
486  TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());
487 
488  for (std::multimap<int, int>::const_iterator it2 = ppp.first;it2 != ppp.second;++it2) {
489  const TGeoOverlap* ovl = (const TGeoOverlap*) gGeoManager->GetListOfOverlaps()->At((*it2).second);
490  if (ovl)
491  x += Form("%s: %g ", ovl->IsOverlap() ? "Ovl" : "Extr", ovl->GetOverlap());
492  else
493  x += "err";
494 
495  }
496  m_renderer.setData(x, isSelected);
497  }
498  else
499  {
500  m_renderer.setData("", isSelected);
501  }
502  }
503  if (iCol == 1)
504  {
505  m_colorBoxRenderer.setData(data.m_color, isSelected);
506  return &m_colorBoxRenderer;
507  }
508  else if (iCol == 2 )
509  {
510  m_renderer.setData(Form("%d", 100 -data.m_transparency), isSelected);
511  }
512  else if (iCol == 3 )
513  {
514  m_renderer.setData(data.testBit(kVisNodeSelf) ? "On" : "-", isSelected );
515 
516  }
517  else if (iCol == 4 )
518  {
519  m_renderer.setData(data.testBit(kVisNodeChld) ? "On" : "-", isSelected);
520 
521  }
522  else if (iCol == 6)
523  {
524  std::cerr << "This shoud not happen! \n" ;
525  }
526  }
527  return &m_renderer;
528 }
std::multimap< int, int > m_mapNodeOverlaps
bool listAllNodes() const
virtual void setIndentation(int indentation=0)
void setData(const std::string &, bool isSelected)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple level
Definition: testEve_cfg.py:34
Definition: DDAxes.h:10
virtual bool nodeIsParent(const NodeInfo &) const
FWOverlapTableView * m_browser
virtual void showEditor(bool value)
void FWOverlapTableManager::getOverlapTitles ( int  idx,
TString &  txt 
) const

Definition at line 369 of file FWOverlapTableManager.cc.

References FWGeometryTableViewManager::getGeoMangeur(), and m_mapNodeOverlaps.

370 {
371 
372  TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());
373  std::pair<std::multimap<int, int>::const_iterator, std::multimap<int, int>::const_iterator> ppp;
374  ppp = m_mapNodeOverlaps.equal_range(idx);
375  for (std::multimap<int, int>::const_iterator it2 = ppp.first;it2 != ppp.second;++it2) {
376  const TGeoOverlap* ovl = (const TGeoOverlap*) gGeoManager->GetListOfOverlaps()->At((*it2).second);
377  {
378  txt += "\n";
379 
380  if (ovl) {
381  txt += Form("%s: %g, ", ovl->IsOverlap() ? "Ovl" : "Extr", ovl->GetOverlap());
382  txt += ovl->GetTitle();
383  }
384  }
385  }
386 }
std::multimap< int, int > m_mapNodeOverlaps
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< std::string > FWOverlapTableManager::getTitles ( ) const
virtual

returns the title names for each column

Reimplemented from FWGeometryTableManagerBase.

Definition at line 52 of file FWOverlapTableManager.cc.

References numberOfColumns().

53 {
54  std::vector<std::string> returnValue;
55  returnValue.reserve(numberOfColumns());
56 
57  returnValue.push_back("Name");
58  returnValue.push_back("Color");
59  returnValue.push_back("Opcty");
60  returnValue.push_back("RnrSelf");
61  returnValue.push_back("RnrChildren");
62  returnValue.push_back("Overlap");
63  returnValue.push_back("RnrMarker");
64  return returnValue;
65 }
virtual int numberOfColumns() const
Number of columns in the table.
void FWOverlapTableManager::importOverlaps ( std::string  path,
double  precision 
)

Definition at line 71 of file FWOverlapTableManager.cc.

References addOverlapEntry(), relativeConstraints::geom, FWGeometryTableViewManager::getGeoMangeur(), FWGeometryTableViewBase::getMarker(), FWGeometryTableViewBase::getTopNodeIdx(), i, kOverlap, kOverlapChild, kVisMarker, FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, m_browser, FWGeometryTableManagerBase::NodeInfo::m_color, FWGeometryTableManagerBase::m_entries, FWGeometryTableManagerBase::NodeInfo::m_level, m_mapNodeOverlaps, FWGeometryTableManagerBase::NodeInfo::m_node, FWGeometryTableManagerBase::NodeInfo::m_parent, FWGeometryTableManagerBase::NodeInfo::m_transparency, python.Node::node, getGTfromDQMFile::obj, analyzePatCleaning_cfg::overlaps, and FWGeometryTableManagerBase::NodeInfo::resetBit().

Referenced by FWOverlapTableView::recalculate().

72 {
73  m_entries.clear();
74  m_mapNodeOverlaps.clear();
75  m_browser->getMarker()->Reset(TEveQuadSet::kQT_FreeQuad, kFALSE, 32 );
76 
77  TEveGeoManagerHolder mangeur( FWGeometryTableViewManager::getGeoMangeur());
78  // gGeoManager->cd();
79  NodeInfo topNodeInfo;
80  topNodeInfo.m_node = gGeoManager->GetTopNode();
81  topNodeInfo.m_level = 0;
82  topNodeInfo.m_color = gGeoManager->GetTopNode()->GetVolume()->GetLineColor();
83  topNodeInfo.m_transparency = gGeoManager->GetTopNode()->GetVolume()->GetTransparency();
84  topNodeInfo.m_parent = -1;
85  topNodeInfo.resetBit(kVisNodeSelf);
86 
87  m_entries.resize(gGeoManager->GetNNodes());
88  m_entries[0] = topNodeInfo;
89 
90  m_entries.resize( gGeoManager->GetNNodes());
91 
92  TGeoVolume* topVol = topNodeInfo.m_node->GetVolume();
93  Int_t icheck = 0;
94  Int_t ncheck = 0;
95  TStopwatch *timer;
96  Int_t i;
97  bool checkingOverlaps = false;
98  TGeoManager *geom = topVol->GetGeoManager();
99  ncheck = topNodeInfo.m_node->CountDaughters(kFALSE);
100  timer = new TStopwatch();
101  geom->ClearOverlaps();
102  geom->SetCheckingOverlaps(kTRUE);
103 
104  int oldS = 0;
105  timer->Start();
106  geom->GetGeomPainter()->OpProgress(topVol->GetName(),icheck,ncheck,timer,kFALSE);
107 // topVol->CheckOverlaps(iPrecision);
108  icheck++;
109  TGeoIterator git(topVol);
110  Entries_i eit = m_entries.begin();
111  /*
112  if (gGeoManager->GetListOfOverlaps()->GetEntriesFast()) {
113  int newCnt = gGeoManager->GetListOfOverlaps()->GetEntriesFast();
114  for (int i=0; i<newCnt; ++i) {
115  addOverlapEntry((TGeoOverlap*)gGeoManager->GetListOfOverlaps()->At(i), new TGeoHMatrix(*geom->GetCurrentMatrix()), topNode, next);
116  }
117  oldS= newCnt;
118  }*/
119  eit++;
120  TGeoNode *node;
121  icheck = 1;
122 
123  int topNodeIdx = m_browser->getTopNodeIdx();
124 
125  while ((node=git())) {
126  if (!eit->testBit(kOverlap)) eit->resetBit(kVisNodeSelf);
127  eit->m_node = node;
128  eit->m_color = node->GetVolume()->GetLineColor();
129  eit->m_transparency = node->GetVolume()->GetTransparency();
130  eit->m_level = git.GetLevel();
131  eit->m_parent = icheck;
132 
133  if ((topNodeIdx )== icheck || !topNodeIdx ) {
134  // printf("start to check overlaps on topNodeIdx %s \n", eit->name());
135  checkingOverlaps=true;
136  }
137  else if (checkingOverlaps && ( eit->m_level <= m_entries[m_browser->getTopNodeIdx()].m_level))
138  {
139  checkingOverlaps=false;
140  }
141  // parent index
142  Entries_i pit = eit;
143  do
144  {
145  --pit;
146  --(eit->m_parent);
147  if (pit->m_level < eit->m_level)
148  break;
149  } while (pit != m_entries.begin());
150 
151  // overlap bits
152  if ( checkingOverlaps) {
153  if (!node->GetVolume()->IsSelected()) {
154  geom->GetGeomPainter()->OpProgress(node->GetVolume()->GetName(),icheck+1,ncheck,timer,kFALSE);
155  node->GetVolume()->SelectVolume(kFALSE);
156 
157  node->GetVolume()->CheckOverlaps(iPrecision);
158 
159  if (oldS != gGeoManager->GetListOfOverlaps()->GetEntriesFast()) {
160  // printf("mother %s overlaps \n", node->GetName());
161 
162  eit->setBit(kOverlapChild);
163  eit->setBit(kVisNodeChld);
164  eit->setBit(kVisMarker);
165 
166  TGeoHMatrix* motherm = new TGeoHMatrix(*geom->GetCurrentMatrix());
167  {
168  TGeoNode* ni = topNodeInfo.m_node;
169  for (Int_t i=1; i<=git.GetLevel(); i++) {
170  ni = ni->GetDaughter(git.GetIndex(i));
171  motherm->Multiply(ni->GetMatrix());
172  }
173  }
174 
175  int newCnt = gGeoManager->GetListOfOverlaps()->GetEntriesFast();
176 
177  for (int i=oldS; i<newCnt; ++i)
178  {
179  // printf("add %p %p \n", (void*)node->GetVolume(), (void*)m_entries[icheck].m_node->GetVolume());
180  addOverlapEntry((TGeoOverlap*)gGeoManager->GetListOfOverlaps()->At(i), i, icheck, motherm);
181  }
182 
183  oldS = newCnt;
184  }
185  }
186  }
187  eit++;
188  icheck ++;
189  }
190 
191  m_browser->getMarker()->RefitPlex();
192 
193  topVol->SelectVolume(kTRUE);
194  geom->SetCheckingOverlaps(kFALSE);
195  // geom->SortOverlaps();
196  TObjArray *overlaps = geom->GetListOfOverlaps();
197  Int_t novlps = overlaps->GetEntriesFast();
198  TNamed *obj;
199  for (i=0; i<novlps; i++) {
200  obj = (TNamed*)overlaps->At(i);
201  obj->SetName(Form("ov%05d",i));
202  }
203  geom->GetGeomPainter()->OpProgress("Check overlaps:",icheck,ncheck,timer,kTRUE);
204  Info("CheckOverlaps", "Number of illegal overlaps/extrusions : %d\n", novlps);
205  delete timer;
206 }
int i
Definition: DBlmapReader.cc:9
std::multimap< int, int > m_mapNodeOverlaps
FWEveDigitSetScalableMarker * getMarker()
tuple node
Definition: Node.py:50
void addOverlapEntry(TGeoOverlap *, int, int, TGeoHMatrix *)
FWOverlapTableView * m_browser
bool FWOverlapTableManager::nodeIsParent ( const NodeInfo data) const
protectedvirtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 352 of file FWOverlapTableManager.cc.

References kOverlapChild, FWOverlapTableView::listAllNodes(), m_browser, FWGeometryTableManagerBase::NodeInfo::m_node, and FWGeometryTableManagerBase::NodeInfo::testBit().

Referenced by cellRenderer().

353 {
354  return m_browser->listAllNodes() ? data.m_node->GetNdaughters() : data.testBit(kOverlapChild) ;
355 }
bool listAllNodes() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
FWOverlapTableView * m_browser
virtual int FWOverlapTableManager::numberOfColumns ( ) const
inlinevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 64 of file FWOverlapTableManager.h.

Referenced by getTitles().

64 {return 6;}
const FWOverlapTableManager& FWOverlapTableManager::operator= ( const FWOverlapTableManager )
private
void FWOverlapTableManager::printOverlaps ( int  idx) const

Definition at line 357 of file FWOverlapTableManager.cc.

References FWGeometryTableViewManager::getGeoMangeur(), and m_mapNodeOverlaps.

Referenced by FWOverlapTableView::chosenItem().

358 {
359 
360  TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());
361  std::pair<std::multimap<int, int>::const_iterator, std::multimap<int, int>::const_iterator> ppp;
362  ppp = m_mapNodeOverlaps.equal_range(idx);
363  for (std::multimap<int, int>::const_iterator it2 = ppp.first;it2 != ppp.second;++it2) {
364  const TGeoOverlap* ovl = (const TGeoOverlap*) gGeoManager->GetListOfOverlaps()->At((*it2).second);
365  if (ovl) ovl->Print();
366  }
367 }
std::multimap< int, int > m_mapNodeOverlaps
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void FWOverlapTableManager::recalculateVisibility ( )
virtual
void FWOverlapTableManager::recalculateVisibilityNodeRec ( int  pIdx)
virtual

Definition at line 328 of file FWOverlapTableManager.cc.

References data, FWGeometryTableManagerBase::getNNodesTotal(), customizeTrackingMonitorSeedNumber::idx, FWGeometryTableManagerBase::kExpanded, kOverlap, kOverlapChild, FWOverlapTableView::listAllNodes(), m_browser, FWGeometryTableManagerBase::m_entries, FWGeometryTableManagerBase::m_row_to_index, gen::n, FWGeometryTableManagerBase::NodeInfo::testBit(), and FWGeometryTableManagerBase::NodeInfo::testBitAny().

Referenced by recalculateVisibility().

329 {
330  TGeoNode* parentNode = m_entries[pIdx].m_node;
331  int nD = parentNode->GetNdaughters();
332  int dOff=0;
333  for (int n = 0; n != nD; ++n)
334  {
335  int idx = pIdx + 1 + n + dOff;
336  NodeInfo& data = m_entries[idx];
337 
338 
339  if (m_browser->listAllNodes() || data.testBitAny(kOverlap | kOverlapChild))
340  m_row_to_index.push_back(idx);
341 
342  if ((m_browser->listAllNodes() || data.testBit(kOverlapChild)) && data.testBit(kExpanded) )
344 
345  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
346  }
347 }
bool listAllNodes() const
virtual void recalculateVisibilityNodeRec(int)
static void getNNodesTotal(TGeoNode *geoNode, int &off)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
FWOverlapTableView * m_browser
void FWOverlapTableManager::setDaughtersSelfVisibility ( int  i,
bool  v 
)
virtual

Reimplemented from FWGeometryTableManagerBase.

Definition at line 534 of file FWOverlapTableManager.cc.

References data, FWGeometryTableManagerBase::getNNodesTotal(), customizeTrackingMonitorSeedNumber::idx, FWGeometryTableManagerBase::kVisNodeChld, FWGeometryTableManagerBase::kVisNodeSelf, FWGeometryTableManagerBase::m_entries, gen::n, and FWGeometryTableManagerBase::NodeInfo::setBitVal().

535 {
536  int dOff = 0;
537  TGeoNode* parentNode = m_entries[selectedIdx].m_node;
538  int nD = parentNode->GetNdaughters();
539  for (int n = 0; n != nD; ++n)
540  {
541  int idx = selectedIdx + 1 + n + dOff;
542  NodeInfo& data = m_entries[idx];
543 
546 
547 
548  FWGeometryTableManagerBase::getNNodesTotal(parentNode->GetDaughter(n), dOff);
549  }
550 }
static void getNNodesTotal(TGeoNode *geoNode, int &off)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82

Member Data Documentation

FWOverlapTableView* FWOverlapTableManager::m_browser
private
std::multimap<int, int> FWOverlapTableManager::m_mapNodeOverlaps
private