KaliVeda
Toolkit for HIC analysis
KVDataAnalysisLauncher.cpp
1 #include "KVDataAnalysisLauncher.h"
2 #include "TGLabel.h"
3 #include "TGMsgBox.h"
4 #include "TColor.h"
5 #include "TGButtonGroup.h"
6 #include "TGFileDialog.h"
7 #include "TObjString.h"
8 #include "TDatime.h"
9 #include "TApplication.h"
10 #include "TSocket.h"
11 #include "TGToolTip.h"
12 #include "TGFileDialog.h"
13 #include "Riostream.h"
14 #include "TClass.h"
15 #include "KVDataRepositoryManager.h"
16 #include "KVDataRepository.h"
17 #include "KVDataSetManager.h"
18 #include "KVDataSet.h"
19 #include "KVDataAnalysisTask.h"
20 #include "KV2Body.h"
21 #include "KVNucleus.h"
22 #include "KVExpDB.h"
23 #include "KVBatchSystemManager.h"
24 #include "TSystemDirectory.h"
25 #include "KVInputDialog.h"
26 #include "KVBatchSystemGUI.h"
27 #include "KVBatchSystemParametersGUI.h"
28 #include <KVRunFile.h>
29 
30 #define TTDELAY 750
31 
32 //maximum length of runlist shown next to "Selected Runs :"
33 #define MAX_LENGTH_SELECTED_RUNS 40
34 
35 //#define KVDAL_DEBUG
36 
37 using namespace std;
38 
40 
41 //__________________________________________
42 
43 
46 void KVGFileList::Init(TString& fileList, const Char_t* title)
47 {
48  // Init window
51  1, 1, 1, 1);
54  1, 1, 1, 1);
55 
56  // File list TGListBox
57  lbFileList = new TGListBox(this, LB_Files);
58  lbFileList->SetMultipleSelections(kTRUE);
59  lbFileList->Resize(350, 96);
60  this->AddFrame(lbFileList, eXeY);
61 
62  // File Name TGTextEntry
63  teFileName = new TGTextEntry(this, "");
64  this->AddFrame(teFileName, eX);
65 
66  // buttons
67  TGCompositeFrame* cf = new TGCompositeFrame(this, 1200, 350, kHorizontalFrame);
68  boutAdd = new TGTextButton(cf, "Add File");
69  boutAdd->SetToolTipText("Add a file to the list", TTDELAY);
70  boutAdd->Connect("Clicked()",
71  "KVGFileList",
72  this,
73  "AddFile()");
74  cf->AddFrame(boutAdd, eX);
75 
76  boutRem = new TGTextButton(cf, "Remove File");
77  boutRem->SetToolTipText("Remove the selected file from the list", TTDELAY);
78  boutRem->Connect("Clicked()",
79  "KVGFileList",
80  this,
81  "RemoveFiles()");
82  cf->AddFrame(boutRem, eX);
83 
84  boutAllRem = new TGTextButton(cf, "Remove All File");
85  boutAllRem->SetToolTipText("Remove all files from the list", TTDELAY);
86  boutAllRem->Connect("Clicked()",
87  "KVGFileList",
88  this,
89  "RemoveAllFiles()");
90  cf->AddFrame(boutAllRem, eX);
91 
92  this->AddFrame(cf, eX);
93 
94  TGTextButton* bout = new TGTextButton(this, "Done");
95  bout->SetToolTipText("Close window", TTDELAY);
96  bout->Connect("Clicked()",
97  "KVGFileList",
98  this,
99  "Done()");
100  this->AddFrame(bout, eX);
101 
102  // Map all widgets
103  MapSubwindows();
104  Resize(GetDefaultSize());
105  SetWindowName(title);
106  SetIconName(title);
107 
108  fileListString = &fileList;
109  fileDialogDir = gSystem->Getenv("PWD");
110 
111  entryMax = 0;
112 }
113 
114 
115 
118 
119 KVGFileList::KVGFileList(TString& fileList, const Char_t* title,
120  const TGWindow* p, const TGWindow* main,
121  Bool_t ok):
122  TGTransientFrame(p, main, 10, 10)
123 {
124  // Createur
125 
126  if (ok) {
127  Init(fileList, title);
128  InitFileList();
129  MapRaised();
130  fClient->WaitFor(this);
131  }
132 }
133 
134 
135 
138 
140 {
141  // Destructeur
142  delete lbFileList;
143  delete teFileName;
144  delete boutAdd;
145  delete boutRem;
146  delete boutAllRem;
147 }
148 
149 
150 
154 
156 {
157  // Init the file name list box from a TString. Add all fields separated by a
158  // white space.
159  TObjArray* oa = fileListString->Tokenize(" ");
160  TIter next(oa);
161  TObjString* ost = 0;
162  while ((ost = (TObjString*)next())) {
163  TString fileName = ost->GetString();
164  if (fileName.Length() && !lbFileList->FindEntry(fileName.Data())) {
165  lbFileList->AddEntry(new TGString(fileName.Data()), entryMax);
166  entryMax++;
167  }
168  }
169  oa->SetOwner(kTRUE);
170  delete oa;
172  lbFileList->Layout();
173 }
174 
175 
176 
180 
182 {
183  // Add a file to the listbox. If the TGTextEntry is ampty, a file open dialog
184  // appears
185  TString fileName = teFileName->GetText();
186  if (!fileName.Length()) {
187  if (Char_t* fn = this->GetFileFromDialog()) {
188  fileName = fn;
189  }
190  else {
191  fileName = "";
192  }
193  }
194  if (fileName.Length() &&
195  !lbFileList->FindEntry(fileName.Data()) &&
196  this->CanAdd(fileName.Data())) {
197  lbFileList->AddEntry(new TGString(fileName.Data()), entryMax);
198  entryMax++;
199  }
201  lbFileList->Layout();
202 }
203 
204 
205 
208 
210 {
211  // Remove all the selected files from the TGListBox
212  TList* sel = new TList();
214  TIter next(sel);
215  TGLBEntry* e = 0;
216  while ((e = (TGLBEntry*)next())) {
217  gSystem->Unload(((TGTextLBEntry*)e)->GetText()->GetString());
218  lbFileList->RemoveEntry(e->EntryId());
219  }
221  lbFileList->Layout();
222 }
223 
224 
225 
228 
230 {
231  // Remove all the files from the TGListBox
233  entryMax = 0;
235  lbFileList->Layout();
236 }
237 
238 
239 
242 
244 {
245  // build the file list string from the content of the TGListBox
246  (*fileListString) = "";
247  for (Int_t i = 0; i < entryMax; i++) {
249  if (fileListString->Length())(*fileListString) += " ";
250  (*fileListString) += e->GetText()->GetString();
251  }
252  }
253  this->CloseWindow();
254 }
255 
256 
257 
260 
262 {
263  // Gets the file name from a TGFileDialog
264  TGFileInfo* fil = new TGFileInfo();
265  const char* filTypes[] = {"Shared Object Files", "*.so",
266  0, 0
267  };
268  fil->fFileTypes = filTypes;
269  fil->fIniDir = StrDup(fileDialogDir.Data());
270  new TGFileDialog(gClient->GetRoot(), this, kFDOpen, fil);
271  fileDialogDir = fil->fIniDir;
272  return fil->fFilename;
273 }
274 
275 
276 
279 
281 {
282  // tells whether the file in ths string fn can be added to the list box
283  Bool_t ok = kTRUE;
284 
285  FileStat_t fs;
286  TString tmp = fn;
287  gSystem->ExpandPathName(tmp);
288  if (gSystem->GetPathInfo(tmp.Data(), fs)) {
289  ok = kFALSE;
290  new TGMsgBox(gClient->GetRoot(), this,
291  "File does not exist",
292  Form("The file \"%s\" does not exist. Nothing added.",
293  fn),
295  }
296  else {
297  TString fname = fn;
298  if (!fname.EndsWith(".so")) {
299  ok = kFALSE;
300  new TGMsgBox(gClient->GetRoot(), this,
301  "Not a share object",
302  Form("The file \"%s\" is not a shared object. Nothing added.",
303  fn),
305 
306  }
307  }
308  return ok;
309 }
310 
311 
312 
314 
315 
316 
319 void KVGDirectoryList::Init(TString& fileList, const Char_t* title)
320 {
321  // init window
322  KVGFileList::Init(fileList, title);
323 
324  boutAdd->SetText("Add Directory");
325  boutAdd->SetToolTipText("Add a directory to the list.", TTDELAY);
326  boutAdd->Layout();
327 
328  boutRem->SetText("Remove Directory");
329  boutRem->SetToolTipText("Remove the selected directories from the list.", TTDELAY);
330  boutRem->Layout();
331 
332  boutAllRem->SetText("Remove All Directories");
333  boutAllRem->SetToolTipText("Remove all directories from the list.", TTDELAY);
334  boutAllRem->Layout();
335 }
336 
337 
338 
341 
343  const TGWindow* p, const TGWindow* main,
344  Bool_t ok):
345  KVGFileList(fileList, title, p, main, kFALSE)
346 {
347  // Createur
348 
349  if (ok) {
350  Init(fileList, title);
351  InitFileList();
352  MapRaised();
353  fClient->WaitFor(this);
354  }
355 }
356 
357 
358 
361 
363 {
364  // Destructeur
365 }
366 
367 
368 
369 
372 
374 {
375  // Gets the file name from a TGFileDialog
376  TGFileInfo* fil = new TGFileInfo();
377  const char* filTypes[] = {"Include Files", "*.[h,H]*",
378  0, 0
379  };
380  fil->fFileTypes = filTypes;
381  fil->fIniDir = StrDup(fileDialogDir.Data());
382  new TGFileDialog(gClient->GetRoot(), this, kFDOpen, fil);
383  fileDialogDir = fil->fIniDir;
384  if (fil->fFilename)
385  return fil->fIniDir;
386  else
387  return 0;
388 }
389 
390 
391 
394 
396 {
397  // tells whether the file in ths string fn can be added to the list box
398  Bool_t ok = kTRUE;
399 
400  FileStat_t fs;
401  TString tmp = fn;
402  gSystem->ExpandPathName(tmp);
403  if (gSystem->GetPathInfo(tmp.Data(), fs)) {
404  ok = kFALSE;
405  new TGMsgBox(gClient->GetRoot(), this,
406  "Directory does not exist",
407  Form("The directory \"%s\" does not exist. Nothing added.",
408  fn),
410  }
411  else {
412  if (!(fs.fMode & kS_IFDIR)) {
413  ok = kFALSE;
414  new TGMsgBox(gClient->GetRoot(), this,
415  "Not a directory",
416  Form("The path \"%s\" is not a directory. Nothing added.",
417  fn),
419 
420  }
421  }
422  return ok;
423 }
424 
425 
427 
428 
429 
437 {
438  // Main window width and height can be set using .kvrootrc variables:
439  // KaliVedaGUI.MainGUIWidth: 800
440  // KaliVedaGUI.MainGUIHeight: 600
441  // Maximum column width of runlist can be set using:
442  // KaliVedaGUI.MaxColWidth: 500
443 
444  entryMax = -1;
445  //Initialisation of resource file
446  GUIenv = new TEnv(".KVDataAnalysisGUIrc");
447  //initialisation of list used by Get/SetResource
448  ResourceNames = new TList;
449  ResourceNames->Add(new TNamed("Repository", ""));
450  ResourceNames->Add(new TNamed("DataSet", ""));
451  ResourceNames->Add(new TNamed("Task", ""));
452  ResourceNames->Add(new TNamed("System", ""));
453  ResourceNames->Add(new TNamed("Trigger", ""));
454  NbResNames = ResourceNames->GetEntries();
455 
456  // list of user analysis classes present in working directory
457  UserClassNames = new TList;
458  UserClassNames->SetOwner(kTRUE);
459 
460  //initialise repositories, datasets, etc.
461  if (!gDataRepositoryManager) {
463  gDataRepositoryManager->Init();
464  }
465  if (gDataRepositoryManager->GetListOfRepositories()->GetEntries() == 0) {
466  exit(1);
467  }
468  ia = 0;
469  GetDataAnalyser();//this will set up gBatchSystemManager
470  gBatchSystemManager->GetDefaultBatchSystem()->cd();
471 
472  // Creation de l'environnement d'affichage et ajout des 2 boutons a cet
473  // environnement
474 
477  1, 1, 1, 1);
480  1, 1, 1, 1);
482  1, 1, 1, 1);
484  1, 1, 1, 1);
485  fMainGuiWidth = gEnv->GetValue("KaliVedaGUI.MainGUIWidth", 400);
486  fMainGuiHeight = gEnv->GetValue("KaliVedaGUI.MainGUIHeight", 600);
487 
488  // Creation des 3 frames dans la fenetre
489  TGCompositeFrame* cfSelect = new TGCompositeFrame(this, fMainGuiWidth, 350, kVerticalFrame);
490 
491  Int_t justMode = kTextBottom | kTextRight;
492  TGCompositeFrame* cf = new TGCompositeFrame(cfSelect, fMainGuiWidth, 350, kHorizontalFrame);
493  // Label du Repository
494  TGLabel* lab = new TGLabel(cf, "DATA REPOSITORY : ");
495  lab->Resize(150, 20);
496  lab->SetTextJustify(justMode);
497  cf->AddFrame(lab);
498  // ComboBox du Repository
499  cbRepository = new TGComboBox(cf, CB_DataRepository);
500  cbRepository->Select(-1);
501  cbRepository->Resize(150, 20);
502  cbRepository->Connect("Selected(char*)",
503  "KVDataAnalysisLauncher",
504  this,
505  "SetDataSetList(char*)");
506  cf->AddFrame(cbRepository, LHtopleft);
507 
508  // Label du Data Set
509  lab = new TGLabel(cf, "DATASET : ");
510  lab->Resize(150, 20);
511  lab->SetTextJustify(justMode);
513  20, 1, 1, 1));
514  // ComboBox du Data Set
515  cbDataSet = new TGComboBox(cf, CB_DataSet);
516  cbDataSet->Select(-1);
517  cbDataSet->Resize(150, 20);
518  cbDataSet->Connect("Selected(char*)",
519  "KVDataAnalysisLauncher",
520  this,
521  "SetTaskList(char*)");
522  cf->AddFrame(cbDataSet, LHtopleft);
523  cfSelect->AddFrame(cf, centerX);
524 
525  cf = new TGCompositeFrame(cfSelect, fMainGuiWidth, 350, kHorizontalFrame);
526  // Label du Task
527  lab = new TGLabel(cf, "ANALYSIS TASK : ");
528  lab->SetTextJustify(justMode);
529  lab->Resize(150, 20);
531  1, 1, 1, 1));
532  // ComboBox du Task
533  cbTask = new TGComboBox(cf, CB_AnalysisTask);
534  cbTask->Select(-1);
535  cbTask->Resize(350, 20);
536  cbTask->Connect("Selected(int)",
537  "KVDataAnalysisLauncher",
538  this,
539  "SetSystemList(int)");
540  cf->AddFrame(cbTask, LHtopleft);
541  cfSelect->AddFrame(cf, centerX);
542 
543  AddFrame(cfSelect, new TGLayoutHints(kLHintsLeft | kLHintsTop
545  10, 10, 1, 1));
546  // Systems list
547  lvSystems = new KVListView(KVDBSystem::Class(), this, fMainGuiWidth, 250);
548  lvSystems->SetDataColumns(6);
549  lvSystems->SetMaxColumnSize(gEnv->GetValue("KaliVedaGUI.MaxColWidth", 200));
550  lvSystems->SetDataColumn(1, "Zproj");
551  lvSystems->SetDataColumn(2, "Ztarget");
552  lvSystems->SetDataColumn(3, "Ebeam");
553  lvSystems->GetDataColumn(3)->SetDataFormat("%4.1lf");
554  lvSystems->SetDataColumn(4, "Runs", "GetNumberRuns");
555  lvSystems->SetDataColumn(5, "Events");
556  lvSystems->SetDataColumn(0, "System", "GetName");
557  lvSystems->ActivateSortButtons();
558  // disable context menu, Browse & multi-select functions
559  lvSystems->AllowBrowse(kFALSE);
560  lvSystems->AllowContextMenu(kFALSE);
561  lvSystems->AllowMultipleSelection(kFALSE);
562  lvSystems->Connect("SelectionChanged()", "KVDataAnalysisLauncher", this, "SystemSelectionChanged()");
563  AddFrame(lvSystems, new TGLayoutHints(kLHintsExpandX,
564  10, 10, 15, 15));
565 
566  // Frame pour la liste des runs
567 
568  TGCompositeFrame* cfRuns = new TGCompositeFrame(this, fMainGuiWidth, 400, kVerticalFrame);
569  lvRuns = new KVListView(KVRunFile::Class(), cfRuns, fMainGuiWidth, 300);
570  lvRuns->SetDataColumns(9);
571  lvRuns->SetMaxColumnSize(gEnv->GetValue("KaliVedaGUI.MaxColWidth", 200));
572  int iicc = 0;
573  lvRuns->SetDataColumn(iicc++, "Run", "GetRunNumber");
574  lvRuns->SetDataColumn(iicc++, "Index", "GetIndexString");
575  lvRuns->SetDataColumn(iicc++, "Events", "", kTextRight);
576  lvRuns->SetDataColumn(iicc++, "File", "GetName");
577  lvRuns->SetDataColumn(iicc++, "Date", "GetFileWritten");
578  lvRuns->SetDataColumn(iicc++, "Comments", "", kTextLeft);
579  lvRuns->SetDataColumn(iicc++, "Trigger", "");
580  lvRuns->SetDataColumn(iicc++, "Version");
581  lvRuns->SetDataColumn(iicc++, "User");
582  lvRuns->ActivateSortButtons();
583  // disable context menu & Browse functions
584  lvRuns->AllowBrowse(kFALSE);
585  lvRuns->AllowContextMenu(kFALSE);
586  lvRuns->Connect("SelectionChanged()", "KVDataAnalysisLauncher", this, "UpdateListOfSelectedRuns()");
587  cfRuns->AddFrame(lvRuns, new TGLayoutHints(kLHintsLeft | kLHintsTop |
589  10, 10, 15, 15));
590 
591  // Boutons de selection
592  TGCompositeFrame* cfSelAll = new TGCompositeFrame(cfRuns, fMainGuiWidth, 20, kHorizontalFrame);
593  TGTextButton* bout = new TGTextButton(cfSelAll, "Select All");
594  bout->SetToolTipText("Select all runs for the analysis.", TTDELAY);
595  bout->Connect("Clicked()",
596  "KVDataAnalysisLauncher",
597  this,
598  "SelectAll()");
599  cfSelAll->AddFrame(bout, eX);
600  bout = new TGTextButton(cfSelAll, "Deselect All");
601  bout->SetToolTipText("Deselect all runs.", TTDELAY);
602  bout->Connect("Clicked()",
603  "KVDataAnalysisLauncher",
604  this,
605  "DeselectAll()");
606  cfSelAll->AddFrame(bout, eX);
607  bout = new TGTextButton(cfSelAll, "Runlist");
608  bout->SetToolTipText("Enter list of runs to analyse.", TTDELAY);
609  bout->Connect("Clicked()",
610  "KVDataAnalysisLauncher",
611  this,
612  "EnterRunlist()");
613  cfSelAll->AddFrame(bout, eX);
614  cfRuns->AddFrame(cfSelAll, eX);
615 
616  TGHorizontalFrame* runs_and_nbevents = new TGHorizontalFrame(cfRuns, fMainGuiWidth, 20);
617  selectedRuns = new TGLabel(runs_and_nbevents, "Selected Runs :");
618  runs_and_nbevents->AddFrame(selectedRuns, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 2, 0, 0));
619  TGHorizontalFrame* bidule = new TGHorizontalFrame(runs_and_nbevents);
620  TGLabel* nevents = new TGLabel(bidule, "Events : ");
621  bidule->AddFrame(nevents, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 2, 0, 0));
622  teNbToRead = new TGNumberEntry(bidule, 0);
623 #ifdef __WITHOUT_TGNUMBERENTRY_SETNUMSTYLE
624  teNbToRead->SetFormat(TGNumberFormat::kNESInteger, teNbToRead->GetNumAttr());
625 #else
626  teNbToRead->SetNumStyle(TGNumberFormat::kNESInteger);
627 #endif
628 #ifdef __WITHOUT_TGNUMBERENTRY_SETNUMATTR
629  teNbToRead->SetFormat(teNbToRead->GetNumStyle(), TGNumberFormat::kNEANonNegative);
630 #else
631  teNbToRead->SetNumAttr(TGNumberFormat::kNEANonNegative);
632 #endif
633  teNbToRead->GetNumberEntry()->SetToolTipText("Number of events to read [0 => all events]", TTDELAY);
634  teNbToRead->Resize(150, 20);
635  bidule->AddFrame(teNbToRead, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 2, 2, 0, 0));
636  runs_and_nbevents->AddFrame(bidule, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
637  cfRuns->AddFrame(runs_and_nbevents, eX);
638 
639  AddFrame(cfRuns, eXeY);
640 
641  // UserClass
642  cfAnalysis = new TGCompositeFrame(this, fMainGuiWidth, 20, kVerticalFrame);
643  cf = new TGCompositeFrame(cfAnalysis, fMainGuiWidth, 20, kHorizontalFrame);
644  // Label for User Class name
645  fUserClassLabel = new TGLabel(cf, "User Class");
646  cf->AddFrame(fUserClassLabel, eX);
647  // Label du Task
648  lab = new TGLabel(cf, "User class options");
649  cf->AddFrame(lab, eX);
650 
651  cfAnalysis->AddFrame(cf, eX);
652 
653  cf = new TGCompositeFrame(cfAnalysis, fMainGuiWidth, 20, kHorizontalFrame);
654  cbUserClass = new TGComboBox(cf);
655  cbUserClass->Select(-1);
656  cbUserClass->Resize(150, 20);
657  cf->AddFrame(cbUserClass, eX);
658  cbUserClass->Connect("Selected(char*)", "KVDataAnalysisLauncher", this,
659  "UserClassSelected(char*)");
660  btEditClass = new TGPictureButton(cf, "query_new.xpm");
661  btEditClass->SetEnabled(kFALSE);
662  btEditClass->Connect("Clicked()", "KVDataAnalysisLauncher", this, "EditUserClassFiles()");
663  btEditClass->SetToolTipText(Form("Open analysis class source files in %s", gSystem->Getenv("EDITOR")), TTDELAY);
664  cf->AddFrame(btEditClass, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2));
665 
666  teUserOptions = new TGTextEntry(cf, "");
667  teUserOptions->SetToolTipText("Comma-separated list of options for user analysis class: PAR1=VAL1,PAR2=VAL2,etc.", TTDELAY);
668  cf->AddFrame(teUserOptions, eX);
669 
670  cfAnalysis->AddFrame(cf, eX);
671 
672  AddFrame(cfAnalysis, eX);
673 
674  cf = new TGCompositeFrame(this, fMainGuiWidth, 20, kHorizontalFrame);
675  // Frame for the user's libraries
676  bout = new TGTextButton(cf, "User's libraries", B_Libs);
677  bout->Connect("Clicked()",
678  "KVDataAnalysisLauncher",
679  this,
680  "SetUserLibraries()");
681  cf->AddFrame(bout, eX);
682 
683  bout = new TGTextButton(cf, "User's includes", B_Incs);
684  bout->Connect("Clicked()",
685  "KVDataAnalysisLauncher",
686  this,
687  "SetUserIncludes()");
688  cf->AddFrame(bout, eX);
689 
690  this->AddFrame(cf, eX);
691 
692  // Process et Quit
693 #ifdef KVDAL_DEBUG
694  cout << "Creation Process/Quit" << endl;
695 #endif
696  TGCompositeFrame* cfProcess = new TGCompositeFrame(this, fMainGuiWidth, 20, kHorizontalFrame);
697  withBatch = new TGTextButton(cfProcess, "BatchMode");
698  withBatch->SetToolTipText(gBatchSystem->GetTitle());
699  withBatch->AllowStayDown(kTRUE);
700  withBatch->Connect("Clicked()", "KVDataAnalysisLauncher", this, "SetBatch()");
701  cfProcess->AddFrame(withBatch, eX);
702  doBatchParams = new TGTextButton(cfProcess, "Batch Parameters");
703  doBatchParams->SetToolTipText("Set parameters of batch jobs");
704  doBatchParams->Connect("Clicked()", "KVDataAnalysisLauncher", this, "SetBatchParameters()");
705  cfProcess->AddFrame(doBatchParams, eX);
706  // Bouton de process
707  bout = new TGTextButton(cfProcess, "&Process", B_Process);
708  bout->SetToolTipText("Run the analysis.", TTDELAY);
709  bout->Connect("Clicked()", "KVDataAnalysisLauncher", this, "Process()");
710  // bout->Associate(this);
711  cfProcess->AddFrame(bout, eX);
712  // Bouton de sortie
713  bout = new TGTextButton(cfProcess, "&Quit", B_Quit);
714  bout->SetToolTipText("Close GUI and quit.", TTDELAY);
715  bout->Connect("Clicked()", "KVDataAnalysisLauncher", this, "Exit()");
716  // bout->Associate(this);
717  cfProcess->AddFrame(bout, eX);
718 
719  this->AddFrame(cfProcess, eX);
720  // On affiche tout le monde maintenant
721  MapSubwindows();
722 
723  Resize(GetDefaultSize());
724 
725  SetWindowName(Form("KaliVeda Analysis Launcher on %s", gSystem->HostName()));
726  SetIconName(Form("KaliVeda Analysis Launcher on %s", gSystem->HostName()));
727 
728  MapWindow();
729  SetWMSize(fMainGuiWidth, fMainGuiHeight);
730 
731  SetRepositoryList();
732 
733  FillListOfUserClasses();
734  //fill drop down list of user classes in working directory
735  SetUserClassList();
736  checkCompilation = kFALSE;
737 
738  // Reset last known state of interface
739  TString tmp(GetResource("Repository", ""));
740  SetRepository(tmp.Data());
741 
742  if (GUIenv->GetValue("KVDataAnalysisLauncher.Batch", kFALSE))
743  withBatch->SetState(kButtonDown);
744  else
745  withBatch->SetState(kButtonUp);
746  SetBatch();
747 
748  fUserLibraries = GUIenv->GetValue("KVDataAnalysisLauncher.UserLibraries", "");
749  fUserIncludes = GUIenv->GetValue("KVDataAnalysisLauncher.UserIncludes", "");
750 
751 }
752 
753 
754 
757 
759 {
760  // Destructeur
761  if (ia) delete ia;
762  if (GUIenv) delete GUIenv;
763  delete ResourceNames;
764  delete UserClassNames;
765 }
766 
767 
768 
771 
773 {
774  // Sets the list of all possible repositories in the repository combo box
775 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
777 #else
779 #endif
780  cbRepository->Select(-1);
781  TIter next((TList*)gDataRepositoryManager->GetListOfRepositories());
782  TObject* o = 0;
783  Int_t i = 0;
784  while ((o = next())) {
785  cbRepository->AddEntry(o->GetName(), i);
786  i++;
787  }
788 
789  cbRepository->Layout();
790 
791 }
792 
793 
794 
797 
799 {
800  // Sets the list of all available data sets in the data sets combo box
801  SetResource("Repository", repository);
802 
803  TString ds = GetSavedResource("DataSet", "");
804 
805 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
807 #else
808  cbDataSet->RemoveAll();
809 #endif
810  cbDataSet->Select(-1);
811  gDataRepositoryManager->GetRepository(repository)->cd();
812  Int_t nbds = gDataSetManager->GetNavailable();
813  Int_t i = 0;
814  while (i < nbds) {
815  cbDataSet->AddEntry(gDataSetManager->GetAvailableDataSet(i + 1)->GetName(), i);
816  i++;
817  }
818 
819  cbDataSet->Layout();
820 
821  if (ds.Length()) {
822  SetDataSet(ds.Data());
823  }
824  else {
825  SetTask();
826  }
827 
828 }
829 
830 
831 
835 
837 {
838  // Sets the list of all possible tasks in the tasks combo box
839  // Called when a new dataset is selected in the dropdown list
840 
841  SetResource("DataSet", dataset);
842 
843  TString ds = GetSavedResource("Task", "");
844 
845 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
846  RemoveAll(cbTask);
847 #else
848  cbTask->RemoveAll();
849 #endif
850  cbTask->Select(-1);
851 #ifdef KVDAL_DEBUG
852  cout << "DataSet : [" << dataset << "]" << endl;
853 #endif
854  gDataSetManager->GetDataSet(dataset)->cd();
855  Int_t nbt = gDataSet->GetNtasks();
856 
857  GetDataAnalyser()->SetDataSet(gDataSet);
858 
859  noSystems = (!gExpDB || !gExpDB->GetSystems()->GetSize());
860  if (noSystems) lvSystems->RemoveAll();
861 
862  Int_t i = 0;
863  while (i < nbt) {
864  cbTask->AddEntry(gDataSet->GetAnalysisTask(i + 1)->GetType(), i);
865  i++;
866  }
867 
868  cbTask->Layout();
869 
870  if (ds.Length()) {
871  SetTask(ds.Data());
872  }
873  else {
874  SetSystem();
875  }
876 }
877 
878 
879 
883 
885 {
886  //Get analyser for task
887  //If task = 0 we return the current analyser
888 
889  if (!task) {
890  if (!ia) ia = new KVDataSetAnalyser;
891  }
892  else {
893  if (ia) delete ia;
895  if (!ia) ia = new KVDataSetAnalyser;
896  ia->SetAnalysisTask(task);
897  }
898  return ia;
899 }
900 
901 
902 
912 
914 {
915  // Sets the list of all possible systems in the system list.
916  // Called every time a task is selected.
917  //
918  // The choice of task may lead to a change of batch system:
919  // - if the current system is PROOFLite but the data to be read by the task is
920  // not in a TFile (i.e. not in a TTree) then we switch to Xterm batch system.
921  // - if the current system is Xterm but the data to be read by the task *is*
922  // in a TFile (i.e. in a TTree) then we switch to PROOFLite batch system
923 
924  KVDataAnalysisTask* task = gDataSet->GetAnalysisTask(itask + 1);
925 
926  TString current_batch = gBatchSystem->GetName();
927  TString data_reader = gDataSet->GetDataSetEnv(Form("DataSet.RunFileClass.%s", task->GetPrereq()));
928 
929  if (current_batch == "PROOFLite" && data_reader != "TFile") {
930  gBatchSystemManager->GetBatchSystem("Xterm")->cd();
931  withBatch->SetToolTipText(gBatchSystem->GetTitle());
932  Info("SetSystemList", "Switched batch system to %s: %s", gBatchSystem->GetName(), gBatchSystem->GetTitle());
933  }
934  else if (current_batch == "Xterm" && data_reader == "TFile") {
935  gBatchSystemManager->GetBatchSystem("PROOFLite")->cd();
936  withBatch->SetToolTipText(gBatchSystem->GetTitle());
937  Info("SetSystemList", "Switched batch system to %s: %s", gBatchSystem->GetName(), gBatchSystem->GetTitle());
938  }
939 
940  GetDataAnalyser(task);
941 
942  SetResource("Task", task->GetTitle());
943 
944  if (!task->WithUserClass()) {
945  //no user class required
947  }
948  else {
949  //user class required
951  }
952  //update display
953  cfAnalysis->Layout();
954 
955  TString ds = GetSavedResource("System", "");
956  lastSelectedSystem = 0;
957  if (!noSystems) {
958  auto sys_list = gDataSet->GetListOfAvailableSystems(task);
959  if (sys_list) {
960  lvSystems->Display(sys_list.get());
961  }
962  }
963  if (ds.Length()) {
964  SetSystem(ds.Data());
965  }
966  else {
967  SetRunsList();
968  }
969 }
970 
971 
972 
975 
977 {
978  // Sets the list of all available runs in the runs list box
979 
980  SetResource("Trigger", "All");
981  listOfRuns.Clear();
982  listOfSystemRuns.Clear();
983  if (entryMax > -1) {
984  lvRuns->RemoveAll();
985  entryMax = -1;
986  }
987 
988  KVDataAnalysisTask* task = gDataSet->GetAnalysisTask(cbTask->GetSelected() + 1);
989  KVDBSystem* system = 0;
990  if (!noSystems || !strcmp(task->GetPrereq(), "*")) {
991  // case where systems are defined for dataset and user has
992  // selected a specific system
993  // OR for online analysis (prereq data type="*")
994  system = lastSelectedSystem;
995  GetDataAnalyser()->SetSystem(system);
996  if (!system) {
997  // no system selected
998  // clear runs list
999  SetRuns();
1000  return;
1001  }
1002  }
1003 
1004  //Setting name of system in ressources file
1005  if (!noSystems) {
1006  // dataset with defined systems
1007  if (system) {
1008  // user has chosen a system
1009  SetResource("System", system->GetName());
1010  }
1011  else {
1012  // user chose "All" for system
1013  SetResource("System", "All");
1014  }
1015  }
1016  else {
1017  // no systems defined for dataset
1018  SetResource("System", "Unknown");
1019  }
1020 
1021  auto run_list = gDataSet->GetRunList(task->GetPrereq(), system);
1022  lvRuns->RemoveAll();
1023  list_of_runs = gDataSet->GetListOfAvailableSystems(task, system);
1024  entryMax = list_of_runs->GetEntries();
1025  listOfSystemRuns = run_list;
1026  lvRuns->Display(list_of_runs.get());
1027 
1028  TString ds = GetSavedResource("RunsList", "");
1029  SetRuns(ds.Data());
1030 
1031  // Set saved user class, number of events for current
1032  // repository, dataset, task, system, trigger & runs
1033  ds = GetSavedResource("UserClass", "");
1034  SetUserClass(ds.Data());
1035  ds = GetSavedResource("NbEventsToRead", "");
1036  teNbToRead->SetIntNumber(ds.Atoi());
1037 }
1038 
1039 
1040 
1041 
1044 
1046 {
1047  // Select all runs currently in the displayed list of runs
1048  lvRuns->SelectAll();
1050 }
1051 
1052 
1053 
1056 
1058 {
1059  // Deselect all runs currently in the displayed list of runs
1060  lvRuns->UnSelectAll();
1062 }
1063 
1064 
1065 
1068 
1070 {
1071  // Run the analysis task
1072 
1073  TString oriIncludePath = gSystem->GetIncludePath();
1074 
1075  if (gDataRepository->IsRemote()) {
1076  cout << "Checking connection to remote repository." << endl;
1077  if (!gDataRepository->IsConnected()) {
1078  cout << "Connection to server refused" << endl;
1079  cout << "Process aborted." << endl;
1080  WarningBox("Connection refused", "Connection to server refused\nProcess aborted.");
1081  return;
1082  }
1083  }
1084 
1085  KVDataAnalysisTask* task = gDataSet->GetAnalysisTask(cbTask->GetSelected() + 1);
1086  KVDataSetAnalyser* datan = GetDataAnalyser(task);
1087  bool online_analysis = !strcmp(task->GetPrereq(), "*");
1088 
1089  //set global pointer to analyser
1090  gDataAnalyser = datan;
1091 
1092  datan->SetDataSet(gDataSet);
1093  datan->SetAnalysisTask(task);
1094  if (listOfRuns.GetNValues()) {
1095  datan->SetRuns(listOfRuns, kFALSE);
1096  datan->SetFullRunList(listOfRuns);
1097  }
1098  else if (!online_analysis) {
1099  WarningBox("Empty Run List", "The list of runs to process is empty.");
1100  return;
1101  }
1102 
1103  if (fUserIncludes.Length()) {
1105  }
1106  if (fUserLibraries.Length()) {
1108  }
1109 
1110  //Need a user class for the analysis ?
1111  TString kvs(GetUserClass());
1112  if (task->WithUserClass()) {
1113  //read user's class name from input box
1114  if (kvs.Length()) {
1116  datan->SetUserClass({kvs}, checkCompilation);
1117  if (datan->IsUserClassValid())
1119  else {
1120  // compilation failed. abort processing.
1121  delete ia;
1122  ia = 0;
1124  if (WarningBox("Compilation failed", "Please correct mistakes in user analysis class", kTRUE)) EditUserClassFiles();
1125  return;
1126  }
1127  }
1128  else {
1129  delete ia;
1130  ia = 0;
1132  WarningBox("No User Class", "Please enter the user analysis class name.");
1133  return;
1134  }
1135  }
1136  else if (strcmp(task->GetUserBaseClass(), "")) {
1137  //task with default "user" class (i.e. UserClass=no but UserClass.BaseClass!="")
1138  datan->SetUserClass({task->GetUserBaseClass()}, kFALSE);
1139  }
1140  Long64_t nbEventRead = (Long64_t)teNbToRead->GetIntNumber();
1141  // if in batch and nbEventRead>0, ask confirmation
1142  if (IsBatch() && nbEventRead) {
1143  if (!WarningBox("Read all events in batch mode?",
1144  "This will submit batch jobs which will not read all events.\nAre you sure that is what you want?",
1145  kTRUE)) {
1146  delete ia;
1147  ia = 0;
1148  return;
1149  }
1150  }
1151  // check batch parameters have been set
1152  if (IsBatch()
1153  && (!fBatchParameters.GetNpar() // never set
1154  // previously set with MultiJobsMode turned off (perhaps to read a single run), whereas we now have many runs to read
1155  || (fBatchParameters.HasBoolParameter("MultiJobsMode") && !fBatchParameters.GetBoolValue("MultiJobsMode") && listOfRuns.GetNValues() > 1))
1156  ) {
1157  if (!SetBatchParameters()) return; //abort analysis if user pressed cancel
1158  }
1160  SetResource("RunsList", listOfRuns.AsString());
1161  SetResource("UserClassOptions", teUserOptions->GetText());
1162  SetResource("NbEventsToRead", Form("%.0f", teNbToRead->GetNumber()));
1164  if (IsBatch()) {
1165  gBatchSystem->Clear();
1167  datan->SetBatchSystem(gBatchSystem);
1168  }
1169  else {
1170  datan->SetBatchSystem(nullptr);
1171  }
1172  datan->Run();
1173 
1174  gSystem->SetIncludePath(oriIncludePath.Data());
1175 }
1176 
1177 
1178 
1180 
1182 {
1184  return e->GetText()->GetString();
1185  }
1186  else {
1187  return "";
1188  }
1189 }
1190 
1191 
1192 
1194 
1196 {
1198  return e->GetText()->GetString();
1199  }
1200  else {
1201  return "";
1202  }
1203 }
1204 
1205 
1206 
1208 
1210 {
1212  return e->GetText()->GetString();
1213  }
1214  else {
1215  return "";
1216  }
1217 }
1218 
1219 
1220 
1222 
1224 {
1225  if (noSystems) return "";
1227  if (sys)
1228  return sys->GetName();
1229  else
1230  return "";
1231 }
1232 
1233 
1234 
1235 
1237 
1239 {
1240  return listOfRuns.AsString();
1241 }
1242 
1243 
1244 
1246 
1248 {
1249  TGLBEntry* e = 0;
1250  if ((e = cbRepository->FindEntry(r))) {
1251  Int_t i = e->EntryId();
1252 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1253  cbRepository->Select(i);
1254 #else
1255  cbRepository->Select(i, kFALSE);
1256 #endif
1257  SetDataSetList((Char_t*)r);
1258  }
1259  else {
1260  SetDataSet();
1261  }
1262 }
1263 
1264 
1265 
1267 
1269 {
1270  if (!strcmp(r, "")) {
1271  //remove all datasets because no repository has been chosen yet
1272 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1274 #else
1275  cbDataSet->RemoveAll();
1276 #endif
1277  cbDataSet->Select(-1);
1278  SetResource("Repository", "");
1279  SetTask();
1280  }
1281  else {
1282  TGLBEntry* e = 0;
1283  if ((e = cbDataSet->FindEntry(r))) {
1284  Int_t i = e->EntryId();
1285 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1286  cbDataSet->Select(i);
1287 #else
1288  cbDataSet->Select(i, kFALSE);
1289 #endif
1290  SetTaskList((Char_t*)r);
1291  }
1292  else {
1293  SetTask();
1294  }
1295  }
1296 }
1297 
1298 
1299 
1301 
1303 {
1304  if (!strcmp(r, "")) {
1305  //remove all tasks from list because no dataset chosen yet
1306 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1307  RemoveAll(cbTask);
1308 #else
1309  cbTask->RemoveAll();
1310 #endif
1311  cbTask->Select(-1);
1312  SetResource("DataSet", "");
1313  SetSystem();
1314  }
1315  else {
1316  TGLBEntry* e = 0;
1317  if ((e = cbTask->FindEntry(r))) {
1318  Int_t i = e->EntryId();
1319 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1320  cbTask->Select(i);
1321 #else
1322  cbTask->Select(i, kFALSE);
1323 #endif
1324  SetSystemList(i);
1325  }
1326  else {
1327  SetSystem();
1328  }
1329  }
1330 }
1331 
1332 
1333 
1335 
1337 {
1338  if (!strcmp(r, "")) {
1339  //remove all systems from list because no task chosen yet
1340  lvSystems->RemoveAll();
1341  SetResource("Task", "");
1342  //empty list of analysis classes and disable it
1344  SetRuns();
1345  lvRuns->RemoveAll();
1346  }
1347  else {
1350  }
1351 }
1352 
1353 
1354 
1356 
1358 {
1360  if (system == lastSelectedSystem) return;
1361  lastSelectedSystem = system;
1362  GetDataAnalyser()->SetSystem(system);
1363  SetRunsList();
1364 }
1365 
1366 
1367 
1369 
1371 {
1372  if (!strcmp(r, "")) {
1374  SetResource("Trigger", "All");
1375  SetResource("RunsList", "");
1376  }
1377  else {
1378  listOfRuns.SetList(r);
1380 
1381  if (listOfRuns.GetNValues()) {
1382  lvRuns->ActivateItemsWithColumnData("Run", listOfRuns.GetRunNumberList());
1383  SetResource("RunsList", listOfRuns.AsString());
1384  }
1386  }
1387 }
1388 
1389 
1390 
1394 
1396 {
1397  // Set the resource KVDataAnalysisLauncher.Batch according
1398  // to whether button 'Batch' is down or up
1399 
1400  if (IsBatch()) withBatch->SetText("BatchMode: On");
1401  else withBatch->SetText("BatchMode: Off");
1402  GUIenv->SetValue("KVDataAnalysisLauncher.Batch", IsBatch());
1405 }
1406 
1407 
1408 
1412 
1414 {
1415  // Open dialog to set batch parameters for job
1416  // returns kFALSE if cancel is pressed
1417 
1419  // use saved values of batch parameters
1420  fBatchParameters.SetFromEnv(GUIenv, "KVDataAnalysisLauncher");
1421  Bool_t cancel;
1422  // make sure runlist is set in analyser (controls multijobs mode)
1423  GetDataAnalyser()->SetDataSet(gDataSet);
1426  if (!cancel) {
1427  // update saved batch parameter resources
1428  fBatchParameters.WriteToEnv(GUIenv, "KVDataAnalysisLauncher");
1430  }
1431  return !cancel;
1432 }
1433 
1434 
1435 
1436 
1439 
1441 {
1442  // Set the User's libraries
1443  TString ori = fUserLibraries.Data();
1444  new KVGFileList(fUserLibraries, "User's Libraries",
1445  gClient->GetRoot(), this);
1446  GUIenv->SetValue("KVDataAnalysisLauncher.UserLibraries", fUserLibraries.Data());
1449 }
1450 
1451 
1452 
1455 
1457 {
1458  // Set the User's includes
1459  TString ori = fUserIncludes.Data();
1460  new KVGDirectoryList(fUserIncludes, "User's Includes",
1461  gClient->GetRoot(), this);
1462  GUIenv->SetValue("KVDataAnalysisLauncher.UserIncludes", fUserIncludes.Data());
1465 }
1466 
1467 
1468 
1469 
1475 
1476 Bool_t KVDataAnalysisLauncher::WarningBox(const char* title, const char* msg, Bool_t confirm)
1477 {
1478  // Warning box in case of problems
1479  // if confirm=kTRUE we ask for a yes/no answer from the user:
1480  // if 'yes' is pressed, we return kTRUE, if 'no', kFALSE.
1481  // by default, only a 'dismiss' button is shown, and this method always returns kTRUE.
1482 
1483  Bool_t reply = kTRUE;
1484  if (!confirm)
1485  new TGMsgBox(gClient->GetRoot(), this, title, msg, kMBIconExclamation);
1486  else {
1487  Int_t ret_code = 0;
1488  new TGMsgBox(gClient->GetRoot(), this, title, msg, kMBIconExclamation, kMBYes | kMBNo, &ret_code);
1489  reply = (ret_code & kMBYes);
1490  }
1491  return reply;
1492 }
1493 
1494 
1495 
1496 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1497 
1500 
1502 {
1503  //replaces functionality of TGComboBox::RemoveAll for ROOT versions < 5.11/02
1504 
1505  Int_t n = box->GetListBox()->GetNumberOfEntries();
1506  if (n) box->RemoveEntries(0, n - 1);
1507  if (box->GetSelectedEntry()) {
1508  ((TGTextLBEntry*)box->GetSelectedEntry())->SetTitle("");
1509  fClient->NeedRedraw(box->GetSelectedEntry());
1510  }
1511  else {
1512  box->GetTextEntry()->SetTitle("");
1513  fClient->NeedRedraw(box->GetTextEntry());
1514  }
1515 }
1516 
1518 
1519 
1522 {
1523  //replaces functionality of TGListBox::RemoveAll for ROOT versions < 5.11/02
1524 
1525  Int_t n = box->GetNumberOfEntries();
1526  if (n) box->RemoveEntries(0, n - 1);
1527  if (box->GetSelectedEntry()) {
1528  ((TGTextLBEntry*)box->GetSelectedEntry())->SetTitle("");
1529  fClient->NeedRedraw(box->GetSelectedEntry());
1530  }
1531 }
1532 
1533 #endif
1534 
1535 
1536 
1567 
1568 void KVDataAnalysisLauncher::SetResource(const Char_t* name, const Char_t* value)
1569 {
1570  // Handles resource file ".KVDataAnalysisGUIrc"
1571  // We store the current state of the interface using the following resource names:
1572  //
1573  // Repository KVDataAnalysisLauncher.Repository
1574  // DataSet KVDataAnalysisLauncher.DataSet
1575  // Task KVDataAnalysisLauncher.Task
1576  // System KVDataAnalysisLauncher.System
1577  // Trigger KVDataAnalysisLauncher.Trigger
1578  // RunsList KVDataAnalysisLauncher.RunsList
1579  // UserClass KVDataAnalysisLauncher.UserClass
1580  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector
1581  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead
1582  //
1583  // We also keep a "memory" of all selected configurations using the following
1584  // resource names:
1585  //
1586  // DataSet KVDataAnalysisLauncher.DataSet.[repository]
1587  // Task KVDataAnalysisLauncher.Task.[repository].[dataset]
1588  // System KVDataAnalysisLauncher.System.[repository].[dataset].[task]
1589  // Trigger KVDataAnalysisLauncher.Trigger.[repository].[dataset].[task].[system]
1590  // RunsList KVDataAnalysisLauncher.RunsList.[repository].[dataset].[task].[system].[trigger]
1591  // UserClass KVDataAnalysisLauncher.UserClass.[repository].[dataset].[task].[system].[trigger]
1592  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector.[repository].[dataset].[task].[system].[trigger]
1593  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead.[repository].[dataset].[task].[system].[trigger]
1594  //
1595  // N.B. [task]: it is the NAME of the task which is used in the resource name.
1596  // N.B.2. [system]: it is the name given by SystemBatchName() which is used in the resource name.
1597  // N.B.3. [trigger]: for the resource name we take "M > 4", "M>=8" "All" etc. and replace all ' ', '>' or '=' by ''
1598  // to give "M4", "M8", "All", etc.
1599 
1600  TString res, ful_res;
1601 
1602  BuildResourceName(name, res, ful_res);
1603 
1604  // save current value of resource
1605  GUIenv->SetValue(res.Data(), value);
1606 
1607  // save resource for future use if possible
1608  if (ful_res.Length()) GUIenv->SetValue(ful_res.Data(), value);
1609 
1611 }
1612 
1613 
1614 
1615 
1620 
1621 const Char_t* KVDataAnalysisLauncher::GetResource(const Char_t* name, const Char_t* defaultvalue)
1622 {
1623  // Handles resource file ".KVDataAnalysisGUIrc"
1624  //
1625  // We return the current value of the resource "name"
1626 
1627  TString res = name;
1628  res.Prepend("KVDataAnalysisLauncher.");
1629  return GUIenv->GetValue(res.Data(), defaultvalue);
1630 }
1631 
1632 
1633 
1634 
1649 
1650 const Char_t* KVDataAnalysisLauncher::GetSavedResource(const Char_t* name, const Char_t* defaultvalue)
1651 {
1652  // Handles resource file ".KVDataAnalysisGUIrc"
1653  //
1654  // We look for a stored value of the resource "name" corresponding to the current
1655  // values of all the resources which come before "name" in the list :
1656  // Repository
1657  // DataSet
1658  // Task
1659  // System
1660  // Trigger
1661  // These values are stored in resources with names like:
1662  // KVDataAnalysisLauncher.[name].[repository].[dataset]...
1663  //
1664  // If no stored value is found, the defaultvalue is returned
1665 
1666  TString res, ful_res;
1667 
1668  BuildResourceName(name, res, ful_res);
1669 
1670  if (!ful_res.Length()) {
1671  return GUIenv->GetValue(res.Data(), defaultvalue);
1672  }
1673 
1674  return GUIenv->GetValue(ful_res.Data(), defaultvalue);
1675 }
1676 
1677 
1678 
1679 
1682 
1684 {
1685  // Get the system name for the batch name
1686 
1687  TString tmp = GetSystem();
1688  if (tmp == "All") return GetSystem();
1689  return GetDataAnalyser()->SystemBatchName();
1690 }
1691 
1692 
1693 
1694 
1735 
1736 void KVDataAnalysisLauncher::BuildResourceName(const Char_t* name, TString& cur_res, TString& saved_res)
1737 {
1738  // Build the full resource names for storing DataSet, Task, etc.
1739  //
1740  // We store the current state of the interface using the following resource names:
1741  //
1742  // "name" "cur_res"
1743  // Repository KVDataAnalysisLauncher.Repository
1744  // DataSet KVDataAnalysisLauncher.DataSet
1745  // Task KVDataAnalysisLauncher.Task
1746  // System KVDataAnalysisLauncher.System
1747  // Trigger KVDataAnalysisLauncher.Trigger
1748  // RunsList KVDataAnalysisLauncher.RunsList
1749  // UserClass KVDataAnalysisLauncher.UserClass
1750  // UserClassOptions KVDataAnalysisLauncher.UserClassOptions
1751  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector
1752  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead
1753  //
1754  // We also keep a "memory" of all selected configurations using the following
1755  // resource names:
1756  //
1757  // "name" "saved_res"
1758  // DataSet KVDataAnalysisLauncher.DataSet.[repository]
1759  // Task KVDataAnalysisLauncher.Task.[repository].[dataset]
1760  // System KVDataAnalysisLauncher.System.[repository].[dataset].[task]
1761  // Trigger KVDataAnalysisLauncher.Trigger.[repository].[dataset].[task].[system]
1762  // RunsList KVDataAnalysisLauncher.RunsList.[repository].[dataset].[task].[system].[trigger]
1763  // UserClass KVDataAnalysisLauncher.UserClass.[repository].[dataset].[task].[system].[trigger]
1764  // UserClassOptions KVDataAnalysisLauncher.UserClassOptions.[repository].[dataset].[task].[system].[trigger].[class]
1765  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector.[repository].[dataset].[task].[system].[trigger]
1766  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead.[repository].[dataset].[task].[system].[trigger]
1767  //
1768  // N.B. [task]: it is the NAME of the task which is used in the resource name.
1769  // N.B.2. [system]: it is the name given by SystemBatchName() which is used in the resource name.
1770  // N.B.3. [trigger]: for the resource name we take "M > 4", "M>=8" "All" etc. and replace all ' ', '>' or '=' by ''
1771  // to give "M4", "M8", "All", etc.
1772  //
1773  // If name = "Repository", saved_res="" as we do not save it.
1774  // If the resource cannot be saved because one of the resources that is needed to form the
1775  // full resource name has not been set, saved_res="".
1776 
1777  //Resource name for current value
1778  cur_res = name;
1779  cur_res.Prepend("KVDataAnalysisLauncher.");
1780 
1781  //Build full name for save
1782  Int_t index = -1;
1783  saved_res = "";
1784  // look for resource name in list ResourceNames
1785  TObject* resource = 0;
1786  if ((resource = ResourceNames->FindObject(name))) {
1787  //get index in resource table
1788  index = ResourceNames->IndexOf(resource);
1789  }
1790 
1791  if (index == 0) { // resource name = "Repository"; nothing more to do
1792  return;
1793  }
1794 
1795  if (index == -1) index = NbResNames; // force loop to end of list
1796 
1797  // resource name is written in format KVDataAnalysisLauncher.[name].[repository]....
1798  // where the suffixed resource values are all those in the list before the named resource
1799  // i.e. for name = "Task" we write the resource KVDataAnalysisLauncher.Task.[repository].[dataset]
1800 
1801  saved_res = cur_res;
1802  TIter next_res(ResourceNames);
1803  Int_t i = 0;
1804  Bool_t ok = kTRUE;
1805 
1806  while ((resource = next_res()) && (i++ < index)) {
1807 
1808  TString tmp(GetResource(resource->GetName()));
1809  TString res;
1810  if (tmp == "") {
1811  // one of required resources is not set - none of following resources will be set either
1812  // we cannot save this resource
1813  ok = kFALSE;
1814  break;
1815  }
1816  if (!strcmp(resource->GetName(), "Task") && gDataSet) {
1817  // translate title to name for task
1818  KVDataAnalysisTask* tsk = gDataSet->GetAnalysisTask(tmp.Data());
1819  if (tsk) res.Form(".%s", tsk->GetName());
1820  }
1821  else if (!strcmp(resource->GetName(), "System")) {
1822  // use SystemBatchName
1823  res.Form(".%s", SystemBatchName().Data());
1824  }
1825  else if (!strcmp(resource->GetName(), "Trigger")) {
1826  // turn "M > 4" into "M4"
1827  tmp.ReplaceAll(" ", "");
1828  tmp.ReplaceAll(">", "");
1829  tmp.ReplaceAll("=", "");
1830  res.Form(".%s", tmp.Data());
1831  }
1832  else {
1833  res.Form(".%s", GetResource(resource->GetName()));
1834  }
1835  saved_res += res;
1836  }
1837  if (!strcmp(name, "UserClassOptions")) {
1838  if (strcmp("", GetResource("UserClass", ""))) saved_res += Form(".%s", GetResource("UserClass", ""));
1839  else ok = kFALSE;
1840  }
1841 
1842  if (!ok) saved_res = "";
1843 }
1844 
1845 
1846 
1847 
1855 
1857 {
1858  // Look at files in working directory & deduce list of user analysis classes.
1859  // We look for any file ending in '.h'. If we can find a corresponding '.cpp' or '.C' or '.cxx',
1860  // we consider that it is a user analysis class. This list is used to fill the "User Class"
1861  // drop-down list.
1862  // We add "[NEW]" at the end of the list: if selected, this will generate a new user analysis
1863  // class for the currently selected data & analysis task
1864 
1865  TSystemDirectory dir("LocDir", ".");
1866  unique_ptr<TList> lf(dir.GetListOfFiles());
1867  if (!lf.get()) return;
1868  UserClassNames->Clear();
1869  //loop over file names
1870  TIter next(lf.get());
1871  while (TObject* file = next()) {
1872 
1873  // fill list with all '.h' files
1874  TString tmp(file->GetName());
1875  if (tmp.EndsWith(".h")) {
1876  //strip '.h' from filename
1877  tmp.Remove(tmp.Index(".h"));
1878  UserClassNames->Add(new TNamed(tmp.Data(), tmp.Data()));
1879  }
1880 
1881  }
1882 
1883  // now check that implementation files exist for all '.h' we found
1884  TIter next_cl(UserClassNames);
1885  KVString imp, dec;
1886  while (TNamed* clh = (TNamed*)next_cl()) {
1887  if (!KVBase::FindClassSourceFiles(clh->GetName(), imp, dec)) clh->SetName("_INVALID_");
1888  }
1889  // remove all invalid class names
1890  while (TObject* obj = UserClassNames->FindObject("_INVALID_")) {
1891  UserClassNames->Remove(obj);
1892  delete obj;
1893  }
1894  // add [NEW] to list
1895  UserClassNames->Add(new TNamed("[NEW]", "[NEW]"));
1896 }
1897 
1898 
1899 
1900 
1903 
1905 {
1906  // Sets the list of all available user classes in the drop down list
1907 
1908 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1910 #else
1912 #endif
1913  cbUserClass->Select(-1);
1914 
1915  Int_t nbcl = UserClassNames->GetEntries();
1916  Int_t i = 0;
1917  cbUserClass->AddEntry("", i++);
1918  while (i < nbcl + 1) {
1919  cbUserClass->AddEntry(UserClassNames->At(i - 1)->GetName(), i);
1920  i++;
1921  }
1922  cbUserClass->Layout();
1923 }
1924 
1925 
1926 
1927 
1931 
1933 {
1934  // Called when a user class is selected in the combo box.
1935  // Updates batch name if 'auto batch name' is selected.
1936 
1937  if (!strcmp(class_name, "[NEW]")) {
1939  return;
1940  }
1941 
1942  // save resource
1943  SetResource("UserClassOptions", teUserOptions->GetText());
1944  SetResource("UserClass", class_name);
1945  teUserOptions->SetText(GetSavedResource("UserClassOptions", ""));
1946  SetResource("UserClassOptions", teUserOptions->GetText());
1947  if (strcmp("", class_name)) {
1950  }
1951  else btEditClass->SetEnabled(kFALSE);
1953 }
1954 
1955 
1956 
1963 
1965 {
1966  // called when user selects [NEW] in user class list
1967  // we generate a new analysis class for currently selected data & task
1968  // the source files are opened in the $EDITOR
1969  // the new class is selected for the analysis
1970 
1971  // Get name of new class
1972  TString classname;
1973  Bool_t ok;
1974  new KVInputDialog(this, "Enter name of new analysis class", &classname, &ok, "Enter name of new analysis class");
1975  // check new classname is not name of existing class
1976  KVString impfile, decfile;
1977  if (KVBase::FindClassSourceFiles(classname, impfile, decfile)) {
1978  ok = ok && WarningBox("Replacing existing class",
1979  Form("%s is the name of an existing class defined in [%s,%s].\nDo you want to overwrite this class?\n(All existing code will be lost)",
1980  classname.Data(), decfile.Data(), impfile.Data()),
1981  kTRUE);
1982  }
1983  if (ok) {
1984  gDataSet->MakeAnalysisClass(GetTask(), classname);
1986  }
1987  SetUserClassList();
1988  if (ok) {
1989  SetUserClass(classname);
1991  }
1992 }
1993 
1994 
1995 
1996 
2001 
2003 {
2004  // Sets selected user class in combo box according to e.g. a previously stored resource value.
2005  // We update the resource corresponding to the current state of the interface.
2006 
2007  // look for user class in list
2008  TGLBEntry* e = cbUserClass->FindEntry(class_name);
2009 
2010  if (e) {
2011  Int_t i = e->EntryId();
2012 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
2013  cbUserClass->Select(i);
2014 #else
2015  cbUserClass->Select(i, kFALSE);
2016 #endif
2017  // save current user class options
2018  // save current user class
2019  SetResource("UserClass", class_name);
2020  teUserOptions->SetText(GetSavedResource("UserClassOptions", ""));
2022  }
2023 
2024  else
2025  // unknown user class
2026  {
2027  cbUserClass->Select(-1);
2028  SetResource("UserClass", "");
2029 
2031  }
2033 }
2034 
2035 
2036 
2037 
2040 
2042 {
2043  // Returns currently selected user class name
2044 
2046  return e->GetText()->GetString();
2047  }
2048  else {
2049  return "";
2050  }
2051 }
2052 
2053 
2054 
2055 
2058 
2060 {
2061  // Remove all entries from user class combo box & disable text entry
2062 
2063 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
2065 #else
2067 #endif
2068  cbUserClass->Select(-1);
2071 }
2072 
2073 
2074 
2075 
2080 
2082 {
2083  // Reenable user class combo box & text entry,
2084  // fill list with all known user classes & select the one corresponding
2085  // to the current environment
2086 
2087 
2088  SetUserClassList();
2089  SetUserClass(GetSavedResource("UserClass", ""));
2092 }
2093 
2094 
2095 
2100 
2102 {
2103  // If environment variable $EDITOR is set, and if the currently selected
2104  // user class has available source files, we open them in the
2105  // user's favourite editor
2106 
2107  TString editor = gSystem->Getenv("EDITOR");
2108  if (editor == "") return;
2109  TString uclass = GetUserClass();
2110  if (uclass == "") return;
2111  KVString imp, dec;
2112  if (!KVBase::FindClassSourceFiles(uclass, imp, dec)) return;
2113  gSystem->Exec(Form("%s %s %s &", editor.Data(), imp.Data(), dec.Data()));
2114 }
2115 
2116 
2117 
2118 
2123 
2125 {
2126  // Called when user presses "Runlist" button.
2127  // Open dialogue box in which a runlist can be entered.
2128  // The runs in the runlist will be selected.
2129 
2130  TString runs = listOfRuns.AsString();
2131  Bool_t ok = kFALSE;
2132  new KVInputDialog(this, "Enter list of runs", &runs, &ok);
2133  if (ok) {
2134  DeselectAll();
2135  SetRuns(runs.Data());
2136  }
2137 }
2138 
2139 
2140 
2141 
2146 
2148 {
2149  // Called when the selected runs in TGListView lvRuns change.
2150  // We update the KVNumberList listOfRuns according to the current selection
2151  // we modify the limits of the 'runs per job' widget
2152 
2153  listOfRuns.Clear();
2154  TList* novolist = lvRuns->GetSelectedObjects();
2155  if (novolist->GetEntries() > 0) {
2156  TIter nxt(novolist);
2157  KVRunFile* s = 0;
2158  while ((s = (KVRunFile*)nxt())) listOfRuns.Add(s->GetRunIndex());
2159  }
2160  delete novolist;
2161  SetResource("RunsList", listOfRuns.AsString());
2162  if (listOfRuns.GetNValues())
2163  selectedRuns->SetText(Form(" Selected Runs : %s", listOfRuns.AsString(MAX_LENGTH_SELECTED_RUNS).Data()));
2164  else
2165  selectedRuns->SetText(" Selected Runs : [NONE]");
2167 }
2168 
2169 
2170 
2171 
2174 
2176 {
2177  // Empty displayed list of selected runs
2178  listOfRuns.Clear();
2179  SetResource("RunsList", "");
2180  selectedRuns->SetText(Form(" Selected Runs : %s", listOfRuns.AsString(MAX_LENGTH_SELECTED_RUNS).Data()));
2182 }
2183 
2184 
int Int_t
unsigned int UInt_t
kVerticalFrame
kHorizontalFrame
ROOT::R::TRInterface & r
#define e(i)
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
R__EXTERN TEnv * gEnv
kEnvUser
kButtonDown
kButtonUp
#define gClient
kFDOpen
kLHintsRight
kLHintsExpandY
kLHintsLeft
kLHintsCenterY
kLHintsCenterX
kLHintsTop
kLHintsExpandX
kMBNo
kMBYes
kMBIconExclamation
kTextLeft
kTextBottom
kTextRight
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
char name[80]
char * Form(const char *fmt,...)
char * StrDup(const char *str)
R__EXTERN TSystem * gSystem
kS_IFDIR
virtual const Char_t * GetType() const
Definition: KVBase.h:176
static Bool_t FindClassSourceFiles(const KVString &class_name, KVString &imp_file, KVString &dec_file, const KVString &dir_name=".")
Definition: KVBase.cpp:1072
KVBatchSystem * GetDefaultBatchSystem() const
KVBatchSystem * GetBatchSystem(const Char_t *name)
Get batch system by name.
Utility GUI used for setting batch system parameters.
void Clear(Option_t *opt="") override
void cd()
Make this the default batch system.
virtual void SetBatchSystemParameters(const KVNameValueList &)
Use the parameters in the list to set all relevant parameters for batch system.
virtual void GetBatchSystemParameterList(KVNameValueList &)
Database class used to store information on different colliding systems studied during an experiment....
Definition: KVDBSystem.h:52
virtual void Run()
Check all task variables, then run analyser.
void SetBatchSystem(KVBatchSystem *bs)
void SetUserClassOptions(const Char_t *o="")
void SetUserLibraries(const Char_t *libs=0)
void SetAnalysisTask(KVDataAnalysisTask *at)
void SetUserClass(const UserClass &kvs, Bool_t check=kTRUE)
static KVDataAnalyser * GetAnalyser(const Char_t *plugin)
void SetUserIncludes(const Char_t *incDirs=0)
Bool_t IsUserClassValid() const
void SetNbEventToRead(Long64_t nb=0)
GUI for running data analysis tasks.
const Char_t * GetRepository(void)
TList * UserClassNames
list of user classes present in working directory
void SetUserClassList()
Sets the list of all available user classes in the drop down list.
const Char_t * GetSavedResource(const Char_t *name, const Char_t *defaultvalue="")
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 Process(void)
Run the analysis task.
void SetUserClass(const Char_t *)
Int_t NbResNames
number of names in list
void DisableUserClassList()
Remove all entries from user class combo box & disable text entry.
TList * ResourceNames
used by Get/SetResource
void SetUserIncludes(void)
Set the User's includes.
TString SystemBatchName()
Get the system name for the batch name.
void SetRepository(const Char_t *r="")
void SetRuns(const Char_t *s="")
void SetRunsList()
Sets the list of all available runs in the runs list box.
const Char_t * GetResource(const Char_t *name, const Char_t *defaultvalue="")
void ClearListOfSelectedRuns()
Empty displayed list of selected runs.
void SetResource(const Char_t *name, const Char_t *value)
std::unique_ptr< TList > list_of_runs
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.
void BuildResourceName(const Char_t *name, TString &, TString &)
KVDataSetAnalyser * GetDataAnalyser(KVDataAnalysisTask *task=0)
const Char_t * GetUserClass()
Returns currently selected user class name.
void SetDataSet(const Char_t *ds="")
void SetUserLibraries(void)
Set the User's libraries.
TEnv * GUIenv
Declaration des boutons de la fenetre principale.
void SetSystem(const Char_t *s="")
void SetDataSetList(Char_t *s)
Sets the list of all available data sets in the data sets combo box.
void SetTask(const Char_t *t="")
Define and manage data analysis tasks.
virtual Bool_t WithUserClass() const
virtual const Char_t * GetDataAnalyser() const
virtual const Char_t * GetUserBaseClass() const
virtual const Char_t * GetPrereq() const
Manages access to one or more data repositories.
KVDataRepository * GetRepository(const Char_t *name) const
const TList * GetListOfRepositories() const
virtual Bool_t IsRemote() const
Returns kTRUE for remote repositories, kFALSE for local repositories.
virtual Bool_t IsConnected()
Always returns kTRUE for local repositories.
Pilots user analysis of experimental data.
void SetDataSet(KVDataSet *ds)
void SetRuns(const run_index_list &nl, Bool_t check=kTRUE)
void SetSystem(KVDBSystem *syst)
Set the System used in the analysis.
TString SystemBatchName() const
void SetFullRunList(const run_index_list &nl)
virtual Int_t GetNavailable() const
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
virtual KVDataSet * GetAvailableDataSet(Int_t) const
run_index_list GetRunList(const Char_t *data_type, const KVDBSystem *sys=0) const
Definition: KVDataSet.cpp:1728
KVDataAnalysisTask * GetAnalysisTask(Int_t) const
Definition: KVDataSet.cpp:617
virtual std::unique_ptr< TList > GetListOfAvailableSystems(const Char_t *datatype, KVDBSystem *systol=0)
Definition: KVDataSet.cpp:641
virtual Int_t GetNtasks() const
Definition: KVDataSet.cpp:602
KVString GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Definition: KVDataSet.cpp:784
virtual void MakeAnalysisClass(const Char_t *task, const Char_t *classname)
Definition: KVDataSet.cpp:1830
void cd() const
Definition: KVDataSet.cpp:762
virtual KVSeqCollection * GetSystems() const
Definition: KVExpDB.h:113
Directory dialogue box for KVDataAnalysisLauncher.
Bool_t CanAdd(const Char_t *s) override
tells whether the file in ths string fn can be added to the list box
Char_t * GetFileFromDialog(void) override
Gets the file name from a TGFileDialog.
KVGDirectoryList(TString &st, const Char_t *titre="File list", const TGWindow *p=0, const TGWindow *main=0, Bool_t ok=kTRUE)
Createur.
void Init(TString &fileList, const Char_t *title) override
init window
File dialogue box for KVDataAnalysisLauncher.
TGTextEntry * teFileName
TGTextButton * boutRem
virtual void Done(void)
build the file list string from the content of the TGListBox
~KVGFileList()
Destructeur.
virtual Bool_t CanAdd(const Char_t *s)
tells whether the file in ths string fn can be added to the list box
virtual void AddFile(void)
TString * fileListString
virtual void Init(TString &fileList, const Char_t *title)
Init window.
virtual Char_t * GetFileFromDialog(void)
Gets the file name from a TGFileDialog.
TGTextButton * boutAllRem
virtual void RemoveFiles(void)
Remove all the selected files from the TGListBox.
TGTextButton * boutAdd
KVGFileList(TString &st, const Char_t *titre="File list", const TGWindow *p=0, const TGWindow *main=0, Bool_t ok=kTRUE)
Createur.
virtual void RemoveAllFiles(void)
Remove all the files from the TGListBox.
TGListBox * lbFileList
virtual void InitFileList()
General purpose dialog box asking for some input in the form of a string.
Definition: KVInputDialog.h:24
Enhanced version of ROOT TGListView widget.
Definition: KVListView.h:146
virtual void SelectAll()
Definition: KVListView.h:182
virtual void UnSelectAll()
Definition: KVListView.h:186
virtual void Display(const TCollection *l)
Definition: KVListView.h:173
TObject * GetLastSelectedObject() const
Definition: KVListView.h:231
void ActivateItemsWithColumnData(const Char_t *colname, KVNumberList data, Bool_t activate=kTRUE)
Definition: KVListView.h:227
void ActivateItemWithColumnData(const Char_t *colname, const Char_t *data, Bool_t activate=kTRUE)
Definition: KVListView.h:215
TList * GetSelectedObjects() const
Definition: KVListView.h:245
virtual void RemoveAll()
Definition: KVListView.h:190
void SetFromEnv(TEnv *tenv, const TString &prefix="")
Int_t GetNpar() const
return the number of stored parameters
Bool_t HasBoolParameter(const Char_t *name) const
Bool_t GetBoolValue(const Char_t *name) const
void WriteToEnv(TEnv *tenv, const TString &prefix="")
Description of an individual data file in an experimental dataset.
Definition: KVRunFile.h:19
Int_t GetSize() const override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
virtual void SaveLevel(EEnvLevel level)
static TClass * Class()
virtual void SetToolTipText(const char *text, Long_t delayms=400)
virtual void SetEnabled(Bool_t e=kTRUE)
void WaitFor(TGWindow *w)
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
virtual Int_t GetSelected() const
void Layout() override
void RemoveAll() override
virtual TGLBEntry * GetSelectedEntry() const
virtual void Select(Int_t id, Bool_t emit=kTRUE)
virtual void SetEnabled(Bool_t on=kTRUE)
virtual TGLBEntry * FindEntry(const char *s) const
virtual void AddEntry(const char *s, Int_t id)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
void MapSubwindows() override
void Layout() override
virtual void RemoveAll()
char * fFilename
const char ** fFileTypes
char * fIniDir
virtual void Resize(TGDimension size)
void MapRaised() override
void SetTextJustify(Int_t tmode)
void SetText(const char *newText)
virtual void RemoveEntry(Int_t id=-1)
virtual void AddEntry(const char *s, Int_t id)
void Layout() override
virtual TGLBEntry * GetEntry(Int_t id) const
virtual void GetSelectedEntries(TList *selected)
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
virtual TGLBEntry * FindEntry(const char *s) const
virtual void CloseWindow()
virtual void SetIntNumber(Long_t val, Bool_t emit=kTRUE)
virtual Long_t GetIntNumber() const
virtual Double_t GetNumber() const
TGClient * fClient
virtual void SetText(const TString &new_label)
const char * GetText() const
void SetEnabled(Bool_t flag=kTRUE)
virtual void SetText(const char *text, Bool_t emit=kTRUE)
void Clear(Option_t *option="") override
TObject * FindObject(const char *name) const override
void Add(TObject *obj) override
TObject * Remove(const TObjLinkPtr_t &lnk)
TObject * At(Int_t idx) const override
const char * GetName() const override
const char * GetTitle() const override
static TClass * Class()
const TString & GetString() const
virtual const char * GetName() const
virtual void Info(const char *method, const char *msgfmt,...) const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
virtual Int_t IndexOf(const TObject *obj) const
Ssiz_t Length() const
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Int_t Atoi() const
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
TString & Prepend(char c, Ssiz_t rep=1)
void Form(const char *fmt,...)
TString & Remove(EStripType s, char c)
TString & ReplaceAll(const char *s1, const char *s2)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual TList * GetListOfFiles() const
virtual void Unload(const char *module)
virtual const char * Getenv(const char *env)
virtual const char * GetIncludePath()
virtual Int_t Exec(const char *shellcmd)
virtual void SetIncludePath(const char *includePath)
virtual int GetPathInfo(const char *path, FileStat_t &buf)
virtual const char * HostName()
virtual char * ExpandPathName(const char *path)
long long Long64_t
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
int main(int argc, char **argv)
const Int_t n
ClassImp(TPyArg)