KaliVeda
Toolkit for HIC analysis
KVDataAnalysisLauncher.h
1 #ifndef KVDataAnalysisLauncher_h
2 #define KVDataAnalysisLauncher_h
3 
4 #include "TROOT.h"
5 #include "TSystem.h"
6 #include "TGClient.h"
7 #include "TGButton.h"
8 #include "TGTextEntry.h"
9 #include "TGComboBox.h"
10 #include "TGSlider.h"
11 #include "TGListBox.h"
12 #include "TGNumberEntry.h"
13 #include "TSortedList.h"
14 #include "TGLabel.h"
15 #include "TGTab.h"
16 #include "TEnv.h"
17 #include "TApplication.h"
18 
19 
20 #include "KVDBSystem.h"
21 #include "KVNumberList.h"
22 #include "KVDataSetAnalyser.h"
23 #include "KVListView.h"
24 #include "KVConfig.h"
25 
32 class KVGFileList : public TGTransientFrame {
33  enum ElementId {
34  B_Add,
35  B_Remove,
36  B_AllRemove,
37  LB_Files,
38  TE_FileName
39  };
40 
41 protected:
42  TGListBox* lbFileList;
43  TGTextEntry* teFileName;
44  TGTextButton* boutAdd;
45  TGTextButton* boutRem;
46  TGTextButton* boutAllRem;
47  Int_t entryMax;
48  KVString fileListString;
49  TString fileDialogDir;
50 
51  virtual void Init(const TString& fileList, const TString& title);
52  void InitFileList();
53 
54 public:
55  KVGFileList(const TString& st, const TString& titre = "File list",
56  const TGWindow* p = 0, const TGWindow* main = 0, Bool_t ok = kTRUE);
57  ~KVGFileList();
58 
59  void AddFile();
60  void RemoveFiles();
61  void RemoveAllFiles();
62  void Done();
63  virtual TString GetFileFromDialog();
64  virtual Bool_t CanAdd(const TString& s);
65 
67 };
68 
76 class KVGDirectoryList : public KVGFileList {
77 
78 protected:
79  void Init(const TString& fileList, const TString& title) override;
80 public:
81  KVGDirectoryList(const TString& st, const TString& titre = "File list",
82  const TGWindow* p = 0, const TGWindow* main = 0, Bool_t ok = kTRUE);
83 
84  TString GetFileFromDialog(void) override;
85  Bool_t CanAdd(const TString& s) override;
86 
88 };
89 
100 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
101  void RemoveAll(TGComboBox* box) override;
102  void RemoveAll(TGListBox* box) override;
103 #endif
104  enum ElementId {
105  CB_DataRepository,
106  CB_AnalysisTask,
107  CB_DataSet,
108  CB_System,
109  CB_Trigger,
110  LB_Runs,
111  B_Libs,
112  B_Incs,
113  B_Process,
114  B_Quit
115  };
116 
118 protected:
119  TEnv* GUIenv;
120  KVList ResourceNames;
121  Int_t NbResNames;
122  void SetResource(const TString& name, const TString& value);
123  TString GetResource(const TString& name, const TString& defaultvalue = "");
124  void BuildResourceName(const TString& name, TString&, TString&);
125 
126  run_index_list listOfRuns;
127  run_index_list listOfSystemRuns;
128 
129  TGComboBox* cbRepository;
130  TGComboBox* cbTask;
131  TGComboBox* cbDataSet;
132  KVListView* lvSystems;
133  KVDBSystem* lastSelectedSystem;
134  KVUnownedList listofSelectedSystems;
135  KVListView* lvRuns;
136  TGLabel* selectedRuns;
137  Int_t entryMax;
138  Bool_t selAll;
139  KVList list_of_runs;
140 
141  KVDataSet* current_dataset = nullptr;
142  KVExpDB* current_database = nullptr;
143 
144  KVDataSetAnalyser* ia;
145  TGCompositeFrame* cfAnalysis;
146  TGComboBox* cbUserClass;
147  TGPictureButton* btEditClass;
148  TGLabel* fUserClassLabel;
149  TGTextEntry* teUserOptions;
150  TGNumberEntry* teNbToRead;
151  TGTextButton* withBatch;
152  TGTextButton* doBatchParams;
153  TGTextButton* bStageSelect;
154  KVString source_type, output_type;
155  KVNameValueList fStageSelections;
156 
157  TString fUserLibraries;
158  TString fUserIncludes;
159  Bool_t checkCompilation;
160  Bool_t noSystems;
161  KVNameValueList fBatchParameters;
162  KVDataSetAnalyser* GetDataAnalyser(KVDataAnalysisTask* task = 0);
163 
164  TList* UserClassNames;
165  void FillListOfUserClasses();
166  void SetUserClassList();
167  void SetUserClass(const Char_t*);
168  TString GetUserClass();
169  void DisableUserClassList();
170  void EnableUserClassList();
171  void GenerateNewUserClass();
172  TString SystemBatchName();
173 
174  UInt_t fMainGuiWidth;
175  UInt_t fMainGuiHeight;
176 
177 public:
178  TString GetSavedResource(const TString& name, const TString& defaultvalue = "");
179  KVDataAnalysisLauncher(const TGWindow* p = 0, UInt_t w = 200, UInt_t h = 400);
181 
182  virtual void Exit(void)
183  {
186  }
187  void SetRepositoryList(void);
189  void SetDataSetList(const TString& repository);
190  void SelectedDataSet(Int_t);
191  void SetTaskList(const TString& s);
192  void SetSystemList(Int_t s);
193  void SetRunsList();
194  void SelectedUserClass(Int_t);
195  void UserClassSelected(const TString&);
196  void SelectAll(void);
197  void DeselectAll(void);
198  void Process(void);
199  void EnterRunlist(void);
200 
201  void SystemSelectionChanged();
202 
203  TString GetRepository(void);
204  TString GetDataSet(void);
205  TString GetTask(void);
206  TString GetSystem(void);
207  TString GetRuns(void);
208 
209  void SetRepository(const TString& r = "");
210  void SetDataSet(const TString& ds = "");
211  void SetTask(const TString& t = "");
212  void SetSystem(const TString& s = "");
213  void SetRuns(const TString& s = "");
214 
216  {
217  return withBatch->IsDown();
218  }
219  void SetBatch();
221 
222  void SetUserLibraries(void);
223  void SetUserIncludes(void);
224 
225  Bool_t WarningBox(const char* title = "Warning", const char* msg = "Warning", Bool_t confirm = kFALSE);
228  void EditUserClassFiles();
229 
231  void DoStageSelection();
232  void UpdateAvailableRuns();
233 
234  ClassDefOverride(KVDataAnalysisLauncher, 0) //Graphical interface for launching analysis tasks: KaliVedaGUI
235 };
236 
237 #endif
int Int_t
unsigned int UInt_t
bool Bool_t
char Char_t
constexpr Bool_t kTRUE
#define ClassDef(name, id)
#define ClassDefOverride(name, id)
R__EXTERN TApplication * gApplication
winID w
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Database class used to store information on different colliding systems studied during an experiment....
Definition: KVDBSystem.h:51
GUI for running data analysis tasks.
void SetRepositoryList(void)
Sets the list of all possible repositories in the repository combo box.
void DeselectAll(void)
Deselect all runs currently in the displayed list of runs.
void SetSystem(const TString &s="")
void Process(void)
Run the analysis task.
void SetTaskList(const TString &s)
void SetDataSet(const TString &ds="")
void UpdateAvailableRuns()
Update available runs for current selected task (=datatype)
void SetUserIncludes(void)
Set the User's includes.
void SetTask(const TString &t="")
void SetDataSetList(const TString &repository)
Sets the list of all available data sets in the data sets combo box.
void UserClassSelected(const TString &)
void ClearListOfSelectedRuns()
Empty displayed list of selected runs.
TString GetSavedResource(const TString &name, const TString &defaultvalue="")
Bool_t WarningBox(const char *title="Warning", const char *msg="Warning", Bool_t confirm=kFALSE)
void SelectAll(void)
Select all runs currently in the displayed list of runs.
KVDataAnalysisLauncher(const TGWindow *p=0, UInt_t w=200, UInt_t h=400)
void SetRuns(const TString &s="")
void SetUserLibraries(void)
Set the User's libraries.
void SetRepository(const TString &r="")
Define and manage data analysis tasks.
Pilots user analysis of experimental data.
Manage an experimental dataset corresponding to a given experiment or campaign.
Definition: KVDataSet.h:146
Base class to describe database of an experiment ,,.
Definition: KVExpDB.h:61
Directory dialogue box for KVDataAnalysisLauncher.
KVGDirectoryList(const TString &st, const TString &titre="File list", const TGWindow *p=0, const TGWindow *main=0, Bool_t ok=kTRUE)
Createur.
TString GetFileFromDialog(void) override
Gets the file name from a TGFileDialog.
Bool_t CanAdd(const TString &s) override
tells whether the file in ths string fn can be added to the list box
File dialogue box for KVDataAnalysisLauncher.
KVGFileList(const TString &st, const TString &titre="File list", const TGWindow *p=0, const TGWindow *main=0, Bool_t ok=kTRUE)
Createur.
void RemoveFiles()
Remove all the selected files from the TGListBox.
~KVGFileList()
Destructeur.
virtual TString GetFileFromDialog()
Gets the file name from a TGFileDialog.
void Done()
build the file list string from the content of the TGListBox
void RemoveAllFiles()
Remove all the files from the TGListBox.
virtual Bool_t CanAdd(const TString &s)
tells whether the file in ths string fn can be added to the list box
Enhanced version of ROOT TGListView widget.
Definition: KVListView.h:147
Extended TList class which owns its objects by default.
Definition: KVList.h:22
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
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 Terminate(Int_t status=0)
void SetReturnFromRun(Bool_t ret)
virtual Bool_t IsDown() const
virtual void RemoveAll()
List of runfiles specified by run number and file index ,.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
int main(int argc, char **argv)
TH1 * h