Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:41

0001 #ifndef Fireworks_Core_FWOverlapTableManager_h
0002 #define Fireworks_Core_FWOverlapTableManager_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWOverlapTableManager
0007 //
0008 /**\class FWOverlapTableManager FWOverlapTableManager.h Fireworks/Core/interface/FWOverlapTableManager.h
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:
0018 //         Created:  Wed Jan  4 20:34:38 CET 2012
0019 //
0020 
0021 #include "Fireworks/Core/interface/FWGeometryTableManagerBase.h"
0022 #include "TGeoMatrix.h"
0023 #include "TGeoNode.h"
0024 #include "TGeoOverlap.h"
0025 #include <map>
0026 
0027 class FWOverlapTableView;
0028 class TGeoOverlap;
0029 class TGeoIterator;
0030 
0031 class FWOverlapTableManager : public FWGeometryTableManagerBase {
0032 public:
0033   enum OverlapBits { kVisMarker = BIT(5), kOverlap = BIT(6), kOverlapChild = BIT(7) };
0034 
0035   class QuadId : public TNamed {
0036   public:
0037     QuadId() : m_ovl(nullptr), m_parentIdx(-1) {}
0038     QuadId(TGeoOverlap* ovl, int idx) {
0039       m_ovl = ovl;
0040       m_parentIdx = idx;
0041     }
0042 
0043     ~QuadId() override {}
0044     const char* GetName() const override { return m_ovl->GetTitle(); }
0045     const char* GetTitle() const override { return m_ovl->GetTitle(); }
0046 
0047     TGeoOverlap* m_ovl;
0048     int m_parentIdx;
0049     std::vector<int> m_nodes;
0050   };
0051 
0052   FWOverlapTableManager(FWOverlapTableView*);
0053   ~FWOverlapTableManager() override;
0054 
0055   void recalculateVisibility() override;
0056   virtual void recalculateVisibilityNodeRec(int);
0057   void importOverlaps(std::string path, double precision);
0058   int numberOfColumns() const override { return 6; }
0059 
0060   std::vector<std::string> getTitles() const override;
0061 
0062   FWTableCellRendererBase* cellRenderer(int iSortedRowNumber, int iCol) const override;
0063 
0064   void getOverlapTitles(int, TString&) const;
0065   void printOverlaps(int) const;
0066 
0067   void setDaughtersSelfVisibility(int i, bool v) override;
0068 
0069 protected:
0070   bool nodeIsParent(const NodeInfo&) const override;
0071   //   virtual  const char* cellName(const NodeInfo& data) const;
0072 
0073 public:
0074   FWOverlapTableManager(const FWOverlapTableManager&) = delete;                   // stop default
0075   const FWOverlapTableManager& operator=(const FWOverlapTableManager&) = delete;  // stop default
0076 
0077 private:
0078   void addOverlapEntry(TGeoOverlap*, int, int, TGeoHMatrix*);
0079   FWOverlapTableView* m_browser;
0080 
0081   std::multimap<int, int> m_mapNodeOverlaps;
0082 };
0083 
0084 #endif