KaliVeda
Toolkit for HIC analysis
KVIDGridManagerGUI.h
1 #include "TGFrame.h"
2 #include "TGMenu.h"
3 #include "KVListView.h"
4 #include "TGButtonGroup.h"
5 #include "TGButton.h"
6 #include "KVIDGrid.h"
7 #include "RQ_OBJECT.h"
8 #include <TGComboBox.h>
9 #include <TGLabel.h>
10 #include <TGNumberEntry.h>
11 #include <TGTextEntry.h>
12 #include <TGProgressBar.h>
13 #include "TGTab.h"
14 #include "TGToolBar.h"
15 #include "TGStatusBar.h"
16 #include "KVIDGridEditor.h"
17 
30 
32  TGPopupMenu* fMenuFile;
33  TGPopupMenu* fMenuEdit;
34  TGPopupMenu* fMenuHelp;
35  enum {
36  M_GRIDS_NEW,
37  M_GRIDS_READ,
38  M_GRIDS_SAVE_SEL,
39  M_GRIDS_SAVE_TAB,
40  M_GRIDS_SAVE_ALL,
41  M_GRIDS_DEL_SEL,
42  M_GRIDS_DEL_TAB,
43  M_GRIDS_DEL_ALL,
44  M_GRIDS_SET_RUNLIST,
45  M_GRIDS_SET_VARX,
46  M_GRIDS_SET_VARY,
47  M_GRIDS_SET_MASSFORM,
48  M_GRIDS_SET_ZID,
49  M_GRIDS_CLEAR,
50  ID_LIST_BOX,
51  M_QUIT
52  };
53  TGLayoutHints* fMenuBarItemLayout;
54  TGLayoutHints* fMenuBarHelpLayout;
55  TGMenuBar* fMenuBar;
56  TGHorizontalFrame* fHframe;
57  TGTab* fGridListTabs;
58  KVListView* fIDGridList;
59  KVListView* fIDLineList;
60  KVListView* fCUTList;
61  KVListView* fCUTInfoList;
62 
63  KVIDGridEditor* fIDGridEditor;
64 
65  TGToolBar* fToolBar;
66  TGButton* fTBbuttons[50];
67  Int_t fNbButtons;
68  TGButton* fTBOpen;
69  TGButton* fTBSave;
70  TGButton* fTBNewG;
71  TGButton* fTBCopyG;
72  TGButton* fTBNewIDL;
73  TGButton* fTBNewIDC;
74  TGButton* fTBNewCut;
75  TGButton* fTBFit;
76  TGButton* fTBTest;
77  TGButton* fTBTestTree;
78  TGButton* fTBDelG;
79  TGButton* fTBSetIDG;
80  TGButton* fTBRefresh;
81  TGButton* fTBStartEditor;
82  TGButton* fTBOpenRoot;
83 
84  TGStatusBar* fStatusBar;
85 
86  Int_t fFirstGrid;
87  Int_t fLastGrid;
88  KVIDGraph* fSelectedGrid;
89  KVIDGraph* fLastSelectedGrid;
90  TString fFileName;
91  KVUnownedList fSelectedEntries;
92 
93  TCollection* GetAllGridsInTab()
94  {
96  if (fIDGridList) return fIDGridList->GetUserItems();
97  return 0;
98  };
99 
100  void SetStatus(const Char_t* text = "")
101  {
103  fStatusBar->SetText(text);
104  };
105  void create_and_fill_id_grid_list(const KVString& tab_label, KVSeqCollection* grid_list = nullptr);
106 
107 public:
108 
111 
112  void CloseWindow() override;
113 
114  void HandleGridsMenu(Int_t id);
115 
116  void CreateAndFillTabs();
117  void UpdateTabs();
118  void RemoveEmptyTabs();
119  void TabSelect(Int_t);
120  void UpdateListOfGrids();
121 
122  void ShowListOfLines();
123  void UpdateListOfLines();
124 
125  void SelectionChanged();
127  {
129  return fSelectedEntries.GetSize();
130  }
131 
132  void NewGrid();
133  void CopyGrid();
134  void MergeGrids();
135  void ClearGrid();
136  void DeleteGrids();
137  void DeleteAllGridsInTab();
138  void SetIDTelescopes();
139 
140  void ActivateToolbarButtons();
141 
142  void SaveGridsAs(const TCollection* /*selected*/ = 0);
143 
144  void OpenFile();
145  void SaveCurrent()
146  {
147  SaveGridsAs();
148  };
149  void NewIDLine();
150  void NewIDContour() {}
151  void NewCut();
152  void FitGrid();
153  void TestGrid();
154  void TestTreeGrid();
155  void DeleteSelectedGrids();
156  void Quit()
157  {
158  CloseWindow();
159  };
160  void StartEditor();
161  void OpenRootFile();
162 
163  ClassDefOverride(KVIDGridManagerGUI, 0) //A GUI for managing identification grids
164  TFile* TestIdentificationWithTree(KVIDGraph* gr, const Char_t* name_of_data_histo);
165  void StartEditor(TObject*);
166 };
int Int_t
char Char_t
Option_t Option_t TPoint TPoint const char text
Base class for particle identification in a 2D map.
Definition: KVIDGraph.h:31
Identification grid editor GUI ,.
Graphical interface tool for managing, creating, testing and fitting identification grids.
void TabSelect(Int_t)
called when a new tab is selected
void SaveGridsAs(const TCollection *=0)
void DeleteSelectedGrids()
warning message and confirmation
void HandleGridsMenu(Int_t id)
Receive signals emitted by items selected in Grids menu.
void DeleteAllGridsInTab()
delete the all grids in currently selected tab
void SetIDTelescopes()
propose to set IDTelescopes parameter using grid names
void ActivateToolbarButtons()
disable all buttons
virtual ~ KVIDGridManagerGUI()
const Char_t * name_of_data_histo
ClassDefOverride(KVIDGridManagerGUI, 0) TFile *TestIdentificationWithTree(KVIDGraph *gr
void ClearGrid()
deletes all lines in currently selected grid(s)
void CloseWindow() override
close viewer
void RemoveEmptyTabs()
Recursively remove any empty tabs.
Enhanced version of ROOT TGListView widget.
Definition: KVListView.h:147
TCollection * GetUserItems()
Definition: KVListView.h:266
KaliVeda extensions to ROOT collection classes.
Int_t GetSize() const override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
Extended TList class which does not own its objects by default.
Definition: KVUnownedList.h:20
virtual void SetText(const char *text, Int_t partidx=0)