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(5);
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(0, "System", "GetName");
556  lvSystems->ActivateSortButtons();
557  // disable context menu, Browse & multi-select functions
558  lvSystems->AllowBrowse(kFALSE);
559  lvSystems->AllowContextMenu(kFALSE);
560  lvSystems->AllowMultipleSelection(kFALSE);
561  lvSystems->Connect("SelectionChanged()", "KVDataAnalysisLauncher", this, "SystemSelectionChanged()");
562  AddFrame(lvSystems, new TGLayoutHints(kLHintsExpandX,
563  10, 10, 15, 15));
564 
565  // Frame pour la liste des runs
566 
567  TGCompositeFrame* cfRuns = new TGCompositeFrame(this, fMainGuiWidth, 400, kVerticalFrame);
568  lvRuns = new KVListView(KVRunFile::Class(), cfRuns, fMainGuiWidth, 300);
569  lvRuns->SetDataColumns(8);
570  lvRuns->SetMaxColumnSize(gEnv->GetValue("KaliVedaGUI.MaxColWidth", 200));
571  int iicc = 0;
572  lvRuns->SetDataColumn(iicc++, "Run", "GetRunNumber");
573  lvRuns->SetDataColumn(iicc++, "Trigger", "");
574  lvRuns->SetDataColumn(iicc++, "Events", "", kTextRight);
575  lvRuns->SetDataColumn(iicc++, "File", "GetName");
576  lvRuns->SetDataColumn(iicc++, "Date", "GetFileWritten");
577  lvRuns->SetDataColumn(iicc++, "Comments", "", kTextLeft);
578  lvRuns->SetDataColumn(iicc++, "Version");
579  lvRuns->SetDataColumn(iicc++, "User");
580  lvRuns->ActivateSortButtons();
581  // disable context menu & Browse functions
582  lvRuns->AllowBrowse(kFALSE);
583  lvRuns->AllowContextMenu(kFALSE);
584  lvRuns->Connect("SelectionChanged()", "KVDataAnalysisLauncher", this, "UpdateListOfSelectedRuns()");
585  cfRuns->AddFrame(lvRuns, new TGLayoutHints(kLHintsLeft | kLHintsTop |
587  10, 10, 15, 15));
588 
589  // Boutons de selection
590  TGCompositeFrame* cfSelAll = new TGCompositeFrame(cfRuns, fMainGuiWidth, 20, kHorizontalFrame);
591  TGTextButton* bout = new TGTextButton(cfSelAll, "Select All");
592  bout->SetToolTipText("Select all runs for the analysis.", TTDELAY);
593  bout->Connect("Clicked()",
594  "KVDataAnalysisLauncher",
595  this,
596  "SelectAll()");
597  cfSelAll->AddFrame(bout, eX);
598  bout = new TGTextButton(cfSelAll, "Deselect All");
599  bout->SetToolTipText("Deselect all runs.", TTDELAY);
600  bout->Connect("Clicked()",
601  "KVDataAnalysisLauncher",
602  this,
603  "DeselectAll()");
604  cfSelAll->AddFrame(bout, eX);
605  bout = new TGTextButton(cfSelAll, "Runlist");
606  bout->SetToolTipText("Enter list of runs to analyse.", TTDELAY);
607  bout->Connect("Clicked()",
608  "KVDataAnalysisLauncher",
609  this,
610  "EnterRunlist()");
611  cfSelAll->AddFrame(bout, eX);
612  cfRuns->AddFrame(cfSelAll, eX);
613 
614  TGHorizontalFrame* runs_and_nbevents = new TGHorizontalFrame(cfRuns, fMainGuiWidth, 20);
615  selectedRuns = new TGLabel(runs_and_nbevents, "Selected Runs :");
616  runs_and_nbevents->AddFrame(selectedRuns, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY, 2, 2, 0, 0));
617  TGHorizontalFrame* bidule = new TGHorizontalFrame(runs_and_nbevents);
618  TGLabel* nevents = new TGLabel(bidule, "Events : ");
619  bidule->AddFrame(nevents, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 2, 2, 0, 0));
620  teNbToRead = new TGNumberEntry(bidule, 0);
621 #ifdef __WITHOUT_TGNUMBERENTRY_SETNUMSTYLE
622  teNbToRead->SetFormat(TGNumberFormat::kNESInteger, teNbToRead->GetNumAttr());
623 #else
624  teNbToRead->SetNumStyle(TGNumberFormat::kNESInteger);
625 #endif
626 #ifdef __WITHOUT_TGNUMBERENTRY_SETNUMATTR
627  teNbToRead->SetFormat(teNbToRead->GetNumStyle(), TGNumberFormat::kNEANonNegative);
628 #else
629  teNbToRead->SetNumAttr(TGNumberFormat::kNEANonNegative);
630 #endif
631  teNbToRead->GetNumberEntry()->SetToolTipText("Number of events to read [0 => all events]", TTDELAY);
632  teNbToRead->Resize(150, 20);
633  bidule->AddFrame(teNbToRead, new TGLayoutHints(kLHintsRight | kLHintsCenterY, 2, 2, 0, 0));
634  runs_and_nbevents->AddFrame(bidule, new TGLayoutHints(kLHintsRight, 2, 2, 0, 0));
635  cfRuns->AddFrame(runs_and_nbevents, eX);
636 
637  AddFrame(cfRuns, eXeY);
638 
639  // UserClass
640  cfAnalysis = new TGCompositeFrame(this, fMainGuiWidth, 20, kVerticalFrame);
641  cf = new TGCompositeFrame(cfAnalysis, fMainGuiWidth, 20, kHorizontalFrame);
642  // Label for User Class name
643  fUserClassLabel = new TGLabel(cf, "User Class");
644  cf->AddFrame(fUserClassLabel, eX);
645  // Label du Task
646  lab = new TGLabel(cf, "User class options");
647  cf->AddFrame(lab, eX);
648 
649  cfAnalysis->AddFrame(cf, eX);
650 
651  cf = new TGCompositeFrame(cfAnalysis, fMainGuiWidth, 20, kHorizontalFrame);
652  cbUserClass = new TGComboBox(cf);
653  cbUserClass->Select(-1);
654  cbUserClass->Resize(150, 20);
655  cf->AddFrame(cbUserClass, eX);
656  cbUserClass->Connect("Selected(char*)", "KVDataAnalysisLauncher", this,
657  "UserClassSelected(char*)");
658  btEditClass = new TGPictureButton(cf, "query_new.xpm");
659  btEditClass->SetEnabled(kFALSE);
660  btEditClass->Connect("Clicked()", "KVDataAnalysisLauncher", this, "EditUserClassFiles()");
661  btEditClass->SetToolTipText(Form("Open analysis class source files in %s", gSystem->Getenv("EDITOR")), TTDELAY);
662  cf->AddFrame(btEditClass, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2));
663 
664  teUserOptions = new TGTextEntry(cf, "");
665  teUserOptions->SetToolTipText("Comma-separated list of options for user analysis class: PAR1=VAL1,PAR2=VAL2,etc.", TTDELAY);
666  cf->AddFrame(teUserOptions, eX);
667 
668  cfAnalysis->AddFrame(cf, eX);
669 
670  AddFrame(cfAnalysis, eX);
671 
672  cf = new TGCompositeFrame(this, fMainGuiWidth, 20, kHorizontalFrame);
673  // Frame for the user's libraries
674  bout = new TGTextButton(cf, "User's libraries", B_Libs);
675  bout->Connect("Clicked()",
676  "KVDataAnalysisLauncher",
677  this,
678  "SetUserLibraries()");
679  cf->AddFrame(bout, eX);
680 
681  bout = new TGTextButton(cf, "User's includes", B_Incs);
682  bout->Connect("Clicked()",
683  "KVDataAnalysisLauncher",
684  this,
685  "SetUserIncludes()");
686  cf->AddFrame(bout, eX);
687 
688  this->AddFrame(cf, eX);
689 
690  // Process et Quit
691 #ifdef KVDAL_DEBUG
692  cout << "Creation Process/Quit" << endl;
693 #endif
694  TGCompositeFrame* cfProcess = new TGCompositeFrame(this, fMainGuiWidth, 20, kHorizontalFrame);
695  withBatch = new TGTextButton(cfProcess, "BatchMode");
696  withBatch->SetToolTipText(gBatchSystem->GetTitle());
697  withBatch->AllowStayDown(kTRUE);
698  withBatch->Connect("Clicked()", "KVDataAnalysisLauncher", this, "SetBatch()");
699  cfProcess->AddFrame(withBatch, eX);
700  doBatchParams = new TGTextButton(cfProcess, "Batch Parameters");
701  doBatchParams->SetToolTipText("Set parameters of batch jobs");
702  doBatchParams->Connect("Clicked()", "KVDataAnalysisLauncher", this, "SetBatchParameters()");
703  cfProcess->AddFrame(doBatchParams, eX);
704  // Bouton de process
705  bout = new TGTextButton(cfProcess, "&Process", B_Process);
706  bout->SetToolTipText("Run the analysis.", TTDELAY);
707  bout->Connect("Clicked()", "KVDataAnalysisLauncher", this, "Process()");
708  // bout->Associate(this);
709  cfProcess->AddFrame(bout, eX);
710  // Bouton de sortie
711  bout = new TGTextButton(cfProcess, "&Quit", B_Quit);
712  bout->SetToolTipText("Close GUI and quit.", TTDELAY);
713  bout->Connect("Clicked()", "KVDataAnalysisLauncher", this, "Exit()");
714  // bout->Associate(this);
715  cfProcess->AddFrame(bout, eX);
716 
717  this->AddFrame(cfProcess, eX);
718  // On affiche tout le monde maintenant
719  MapSubwindows();
720 
721  Resize(GetDefaultSize());
722 
723  SetWindowName(Form("KaliVeda Analysis Launcher on %s", gSystem->HostName()));
724  SetIconName(Form("KaliVeda Analysis Launcher on %s", gSystem->HostName()));
725 
726  MapWindow();
727  SetWMSize(fMainGuiWidth, fMainGuiHeight);
728 
729  SetRepositoryList();
730 
731  FillListOfUserClasses();
732  //fill drop down list of user classes in working directory
733  SetUserClassList();
734  checkCompilation = kFALSE;
735 
736  // Reset last known state of interface
737  TString tmp(GetResource("Repository", ""));
738  SetRepository(tmp.Data());
739 
740  if (GUIenv->GetValue("KVDataAnalysisLauncher.Batch", kFALSE))
741  withBatch->SetState(kButtonDown);
742  else
743  withBatch->SetState(kButtonUp);
744  SetBatch();
745 
746  fUserLibraries = GUIenv->GetValue("KVDataAnalysisLauncher.UserLibraries", "");
747  fUserIncludes = GUIenv->GetValue("KVDataAnalysisLauncher.UserIncludes", "");
748 
749 }
750 
751 
752 
755 
757 {
758  // Destructeur
759  if (ia) delete ia;
760  if (GUIenv) delete GUIenv;
761  delete ResourceNames;
762  delete UserClassNames;
763 }
764 
765 
766 
769 
771 {
772  // Sets the list of all possible repositories in the repository combo box
773 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
775 #else
777 #endif
778  cbRepository->Select(-1);
779  TIter next((TList*)gDataRepositoryManager->GetListOfRepositories());
780  TObject* o = 0;
781  Int_t i = 0;
782  while ((o = next())) {
783  cbRepository->AddEntry(o->GetName(), i);
784  i++;
785  }
786 
787  cbRepository->Layout();
788 
789 }
790 
791 
792 
795 
797 {
798  // Sets the list of all available data sets in the data sets combo box
799  SetResource("Repository", repository);
800 
801  TString ds = GetSavedResource("DataSet", "");
802 
803 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
805 #else
806  cbDataSet->RemoveAll();
807 #endif
808  cbDataSet->Select(-1);
809  gDataRepositoryManager->GetRepository(repository)->cd();
810  Int_t nbds = gDataSetManager->GetNavailable();
811  Int_t i = 0;
812  while (i < nbds) {
813  cbDataSet->AddEntry(gDataSetManager->GetAvailableDataSet(i + 1)->GetName(), i);
814  i++;
815  }
816 
817  cbDataSet->Layout();
818 
819  if (ds.Length()) {
820  SetDataSet(ds.Data());
821  }
822  else {
823  SetTask();
824  }
825 
826 }
827 
828 
829 
833 
835 {
836  // Sets the list of all possible tasks in the tasks combo box
837  // Called when a new dataset is selected in the dropdown list
838 
839  SetResource("DataSet", dataset);
840 
841  TString ds = GetSavedResource("Task", "");
842 
843 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
844  RemoveAll(cbTask);
845 #else
846  cbTask->RemoveAll();
847 #endif
848  cbTask->Select(-1);
849 #ifdef KVDAL_DEBUG
850  cout << "DataSet : [" << dataset << "]" << endl;
851 #endif
852  gDataSetManager->GetDataSet(dataset)->cd();
853  Int_t nbt = gDataSet->GetNtasks();
854 
855  GetDataAnalyser()->SetDataSet(gDataSet);
856 
857  noSystems = (!gExpDB || !gExpDB->GetSystems()->GetSize());
858  if (noSystems) lvSystems->RemoveAll();
859 
860  Int_t i = 0;
861  while (i < nbt) {
862  cbTask->AddEntry(gDataSet->GetAnalysisTask(i + 1)->GetType(), i);
863  i++;
864  }
865 
866  cbTask->Layout();
867 
868  if (ds.Length()) {
869  SetTask(ds.Data());
870  }
871  else {
872  SetSystem();
873  }
874 }
875 
876 
877 
881 
883 {
884  //Get analyser for task
885  //If task = 0 we return the current analyser
886 
887  if (!task) {
888  if (!ia) ia = new KVDataSetAnalyser;
889  }
890  else {
891  if (ia) delete ia;
893  if (!ia) ia = new KVDataSetAnalyser;
894  ia->SetAnalysisTask(task);
895  }
896  return ia;
897 }
898 
899 
900 
910 
912 {
913  // Sets the list of all possible systems in the system list.
914  // Called every time a task is selected.
915  //
916  // The choice of task may lead to a change of batch system:
917  // - if the current system is PROOFLite but the data to be read by the task is
918  // not in a TFile (i.e. not in a TTree) then we switch to Xterm batch system.
919  // - if the current system is Xterm but the data to be read by the task *is*
920  // in a TFile (i.e. in a TTree) then we switch to PROOFLite batch system
921 
922  KVDataAnalysisTask* task = gDataSet->GetAnalysisTask(itask + 1);
923 
924  TString current_batch = gBatchSystem->GetName();
925  TString data_reader = gDataSet->GetDataSetEnv(Form("DataSet.RunFileClass.%s", task->GetPrereq()));
926 
927  if (current_batch == "PROOFLite" && data_reader != "TFile") {
928  gBatchSystemManager->GetBatchSystem("Xterm")->cd();
929  withBatch->SetToolTipText(gBatchSystem->GetTitle());
930  Info("SetSystemList", "Switched batch system to %s: %s", gBatchSystem->GetName(), gBatchSystem->GetTitle());
931  }
932  else if (current_batch == "Xterm" && data_reader == "TFile") {
933  gBatchSystemManager->GetBatchSystem("PROOFLite")->cd();
934  withBatch->SetToolTipText(gBatchSystem->GetTitle());
935  Info("SetSystemList", "Switched batch system to %s: %s", gBatchSystem->GetName(), gBatchSystem->GetTitle());
936  }
937 
938  GetDataAnalyser(task);
939 
940  SetResource("Task", task->GetTitle());
941 
942  if (!task->WithUserClass()) {
943  //no user class required
945  }
946  else {
947  //user class required
949  }
950  //update display
951  cfAnalysis->Layout();
952 
953  TString ds = GetSavedResource("System", "");
954  lastSelectedSystem = 0;
955  if (!noSystems) {
956  TList* sys_list = gDataSet->GetListOfAvailableSystems(task);
957  if (sys_list) {
958  lvSystems->Display(sys_list);
959  delete sys_list;
960  }
961  }
962  if (ds.Length()) {
963  SetSystem(ds.Data());
964  }
965  else {
966  SetRunsList();
967  }
968 }
969 
970 
971 
974 
976 {
977  // Sets the list of all available runs in the runs list box
978 
979  SetResource("Trigger", "All");
980  listOfRuns.Clear();
982  if (entryMax > -1) {
983  lvRuns->RemoveAll();
984  entryMax = -1;
985  }
986 
987  KVDataAnalysisTask* task = gDataSet->GetAnalysisTask(cbTask->GetSelected() + 1);
988  KVDBSystem* system = 0;
989  if (!noSystems || !strcmp(task->GetPrereq(), "*")) {
990  // case where systems are defined for dataset and user has
991  // selected a specific system
992  // OR for online analysis (prereq data type="*")
993  system = lastSelectedSystem;
994  GetDataAnalyser()->SetSystem(system);
995  if (!system) {
996  // no system selected
997  // clear runs list
998  SetRuns();
999  return;
1000  }
1001  }
1002 
1003  //Setting name of system in ressources file
1004  if (!noSystems) {
1005  // dataset with defined systems
1006  if (system) {
1007  // user has chosen a system
1008  SetResource("System", system->GetName());
1009  }
1010  else {
1011  // user chose "All" for system
1012  SetResource("System", "All");
1013  }
1014  }
1015  else {
1016  // no systems defined for dataset
1017  SetResource("System", "Unknown");
1018  }
1019 
1020  KVNumberList run_list = gDataSet->GetRunList(task->GetPrereq(), system);
1021  lvRuns->RemoveAll();
1022  list_of_runs.reset(gDataSet->GetListOfAvailableSystems(task, system));
1023  entryMax = list_of_runs->GetEntries();
1024  listOfSystemRuns = run_list;
1025  lvRuns->Display(list_of_runs.get());
1026 
1027  TString ds = GetSavedResource("RunsList", "");
1028  SetRuns(ds.Data());
1029 
1030  // Set saved user class, number of events for current
1031  // repository, dataset, task, system, trigger & runs
1032  ds = GetSavedResource("UserClass", "");
1033  SetUserClass(ds.Data());
1034  ds = GetSavedResource("NbEventsToRead", "");
1035  teNbToRead->SetIntNumber(ds.Atoi());
1036 }
1037 
1038 
1039 
1040 
1043 
1045 {
1046  // Select all runs currently in the displayed list of runs
1047  lvRuns->SelectAll();
1049 }
1050 
1051 
1052 
1055 
1057 {
1058  // Deselect all runs currently in the displayed list of runs
1059  lvRuns->UnSelectAll();
1061 }
1062 
1063 
1064 
1067 
1069 {
1070  // Run the analysis task
1071 
1072  TString oriIncludePath = gSystem->GetIncludePath();
1073 
1074  if (gDataRepository->IsRemote()) {
1075  cout << "Checking connection to remote repository." << endl;
1076  if (!gDataRepository->IsConnected()) {
1077  cout << "Connection to server refused" << endl;
1078  cout << "Process aborted." << endl;
1079  WarningBox("Connection refused", "Connection to server refused\nProcess aborted.");
1080  return;
1081  }
1082  }
1083 
1084  KVDataAnalysisTask* task = gDataSet->GetAnalysisTask(cbTask->GetSelected() + 1);
1085  KVDataSetAnalyser* datan = GetDataAnalyser(task);
1086  bool online_analysis = !strcmp(task->GetPrereq(), "*");
1087 
1088  //set global pointer to analyser
1089  gDataAnalyser = datan;
1090 
1091  datan->SetDataSet(gDataSet);
1092  datan->SetAnalysisTask(task);
1093  if (listOfRuns.GetNValues()) {
1094  datan->SetRuns(listOfRuns, kFALSE);
1095  datan->SetFullRunList(listOfRuns);
1096  }
1097  else if (!online_analysis) {
1098  WarningBox("Empty Run List", "The list of runs to process is empty.");
1099  return;
1100  }
1101 
1102  if (fUserIncludes.Length()) {
1104  }
1105  if (fUserLibraries.Length()) {
1107  }
1108 
1109  //Need a user class for the analysis ?
1110  TString kvs(GetUserClass());
1111  if (task->WithUserClass()) {
1112  //read user's class name from input box
1113  if (kvs.Length()) {
1115  datan->SetUserClass(kvs.Data(), checkCompilation);
1116  if (datan->IsUserClassValid())
1118  else {
1119  // compilation failed. abort processing.
1120  delete ia;
1121  ia = 0;
1123  if (WarningBox("Compilation failed", "Please correct mistakes in user analysis class", kTRUE)) EditUserClassFiles();
1124  return;
1125  }
1126  }
1127  else {
1128  delete ia;
1129  ia = 0;
1131  WarningBox("No User Class", "Please enter the user analysis class name.");
1132  return;
1133  }
1134  }
1135  else if (strcmp(task->GetUserBaseClass(), "")) {
1136  //task with default "user" class (i.e. UserClass=no but UserClass.BaseClass!="")
1137  datan->SetUserClass(task->GetUserBaseClass(), kFALSE);
1138  }
1139  Long64_t nbEventRead = (Long64_t)teNbToRead->GetIntNumber();
1140  // if in batch and nbEventRead>0, ask confirmation
1141  if (IsBatch() && nbEventRead) {
1142  if (!WarningBox("Read all events in batch mode?",
1143  "This will submit batch jobs which will not read all events.\nAre you sure that is what you want?",
1144  kTRUE)) {
1145  delete ia;
1146  ia = 0;
1147  return;
1148  }
1149  }
1150  // check batch parameters have been set
1151  if (IsBatch()
1152  && (!fBatchParameters.GetNpar() // never set
1153  // previously set with MultiJobsMode turned off (perhaps to read a single run), whereas we now have many runs to read
1154  || (fBatchParameters.HasBoolParameter("MultiJobsMode") && !fBatchParameters.GetBoolValue("MultiJobsMode") && listOfRuns.GetNValues() > 1))
1155  ) {
1156  if (!SetBatchParameters()) return; //abort analysis if user pressed cancel
1157  }
1159  SetResource("RunsList", listOfRuns.AsString());
1160  SetResource("UserClassOptions", teUserOptions->GetText());
1161  SetResource("NbEventsToRead", Form("%.0f", teNbToRead->GetNumber()));
1163  if (IsBatch()) {
1164  gBatchSystem->Clear();
1166  datan->SetBatchSystem(gBatchSystem);
1167  }
1168  else {
1169  datan->SetBatchSystem(nullptr);
1170  }
1171  datan->Run();
1172 
1173  gSystem->SetIncludePath(oriIncludePath.Data());
1174 }
1175 
1176 
1177 
1179 
1181 {
1183  return e->GetText()->GetString();
1184  }
1185  else {
1186  return "";
1187  }
1188 }
1189 
1190 
1191 
1193 
1195 {
1197  return e->GetText()->GetString();
1198  }
1199  else {
1200  return "";
1201  }
1202 }
1203 
1204 
1205 
1207 
1209 {
1211  return e->GetText()->GetString();
1212  }
1213  else {
1214  return "";
1215  }
1216 }
1217 
1218 
1219 
1221 
1223 {
1224  if (noSystems) return "";
1226  if (sys)
1227  return sys->GetName();
1228  else
1229  return "";
1230 }
1231 
1232 
1233 
1234 
1236 
1238 {
1239  return listOfRuns.AsString();
1240 }
1241 
1242 
1243 
1245 
1247 {
1248  TGLBEntry* e = 0;
1249  if ((e = cbRepository->FindEntry(r))) {
1250  Int_t i = e->EntryId();
1251 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1252  cbRepository->Select(i);
1253 #else
1254  cbRepository->Select(i, kFALSE);
1255 #endif
1256  SetDataSetList((Char_t*)r);
1257  }
1258  else {
1259  SetDataSet();
1260  }
1261 }
1262 
1263 
1264 
1266 
1268 {
1269  if (!strcmp(r, "")) {
1270  //remove all datasets because no repository has been chosen yet
1271 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1273 #else
1274  cbDataSet->RemoveAll();
1275 #endif
1276  cbDataSet->Select(-1);
1277  SetResource("Repository", "");
1278  SetTask();
1279  }
1280  else {
1281  TGLBEntry* e = 0;
1282  if ((e = cbDataSet->FindEntry(r))) {
1283  Int_t i = e->EntryId();
1284 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1285  cbDataSet->Select(i);
1286 #else
1287  cbDataSet->Select(i, kFALSE);
1288 #endif
1289  SetTaskList((Char_t*)r);
1290  }
1291  else {
1292  SetTask();
1293  }
1294  }
1295 }
1296 
1297 
1298 
1300 
1302 {
1303  if (!strcmp(r, "")) {
1304  //remove all tasks from list because no dataset chosen yet
1305 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1306  RemoveAll(cbTask);
1307 #else
1308  cbTask->RemoveAll();
1309 #endif
1310  cbTask->Select(-1);
1311  SetResource("DataSet", "");
1312  SetSystem();
1313  }
1314  else {
1315  TGLBEntry* e = 0;
1316  if ((e = cbTask->FindEntry(r))) {
1317  Int_t i = e->EntryId();
1318 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1319  cbTask->Select(i);
1320 #else
1321  cbTask->Select(i, kFALSE);
1322 #endif
1323  SetSystemList(i);
1324  }
1325  else {
1326  SetSystem();
1327  }
1328  }
1329 }
1330 
1331 
1332 
1334 
1336 {
1337  if (!strcmp(r, "")) {
1338  //remove all systems from list because no task chosen yet
1339  lvSystems->RemoveAll();
1340  SetResource("Task", "");
1341  //empty list of analysis classes and disable it
1343  SetRuns();
1344  lvRuns->RemoveAll();
1345  }
1346  else {
1349  }
1350 }
1351 
1352 
1353 
1355 
1357 {
1359  if (system == lastSelectedSystem) return;
1360  lastSelectedSystem = system;
1361  GetDataAnalyser()->SetSystem(system);
1362  SetRunsList();
1363 }
1364 
1365 
1366 
1368 
1370 {
1371  if (!strcmp(r, "")) {
1373  SetResource("Trigger", "All");
1374  SetResource("RunsList", "");
1375  }
1376  else {
1377  listOfRuns.SetList(r);
1379 
1380  if (listOfRuns.GetNValues()) {
1382  SetResource("RunsList", listOfRuns.AsString());
1383  }
1385  }
1386 }
1387 
1388 
1389 
1393 
1395 {
1396  // Set the resource KVDataAnalysisLauncher.Batch according
1397  // to whether button 'Batch' is down or up
1398 
1399  if (IsBatch()) withBatch->SetText("BatchMode: On");
1400  else withBatch->SetText("BatchMode: Off");
1401  GUIenv->SetValue("KVDataAnalysisLauncher.Batch", IsBatch());
1404 }
1405 
1406 
1407 
1411 
1413 {
1414  // Open dialog to set batch parameters for job
1415  // returns kFALSE if cancel is pressed
1416 
1418  // use saved values of batch parameters
1419  fBatchParameters.SetFromEnv(GUIenv, "KVDataAnalysisLauncher");
1420  Bool_t cancel;
1421  // make sure runlist is set in analyser (controls multijobs mode)
1422  GetDataAnalyser()->SetDataSet(gDataSet);
1425  if (!cancel) {
1426  // update saved batch parameter resources
1427  fBatchParameters.WriteToEnv(GUIenv, "KVDataAnalysisLauncher");
1429  }
1430  return !cancel;
1431 }
1432 
1433 
1434 
1435 
1438 
1440 {
1441  // Set the User's libraries
1442  TString ori = fUserLibraries.Data();
1443  new KVGFileList(fUserLibraries, "User's Libraries",
1444  gClient->GetRoot(), this);
1445  GUIenv->SetValue("KVDataAnalysisLauncher.UserLibraries", fUserLibraries.Data());
1448 }
1449 
1450 
1451 
1454 
1456 {
1457  // Set the User's includes
1458  TString ori = fUserIncludes.Data();
1459  new KVGDirectoryList(fUserIncludes, "User's Includes",
1460  gClient->GetRoot(), this);
1461  GUIenv->SetValue("KVDataAnalysisLauncher.UserIncludes", fUserIncludes.Data());
1464 }
1465 
1466 
1467 
1468 
1474 
1475 Bool_t KVDataAnalysisLauncher::WarningBox(const char* title, const char* msg, Bool_t confirm)
1476 {
1477  // Warning box in case of problems
1478  // if confirm=kTRUE we ask for a yes/no answer from the user:
1479  // if 'yes' is pressed, we return kTRUE, if 'no', kFALSE.
1480  // by default, only a 'dismiss' button is shown, and this method always returns kTRUE.
1481 
1482  Bool_t reply = kTRUE;
1483  if (!confirm)
1484  new TGMsgBox(gClient->GetRoot(), this, title, msg, kMBIconExclamation);
1485  else {
1486  Int_t ret_code = 0;
1487  new TGMsgBox(gClient->GetRoot(), this, title, msg, kMBIconExclamation, kMBYes | kMBNo, &ret_code);
1488  reply = (ret_code & kMBYes);
1489  }
1490  return reply;
1491 }
1492 
1493 
1494 
1495 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1496 
1499 
1501 {
1502  //replaces functionality of TGComboBox::RemoveAll for ROOT versions < 5.11/02
1503 
1504  Int_t n = box->GetListBox()->GetNumberOfEntries();
1505  if (n) box->RemoveEntries(0, n - 1);
1506  if (box->GetSelectedEntry()) {
1507  ((TGTextLBEntry*)box->GetSelectedEntry())->SetTitle("");
1508  fClient->NeedRedraw(box->GetSelectedEntry());
1509  }
1510  else {
1511  box->GetTextEntry()->SetTitle("");
1512  fClient->NeedRedraw(box->GetTextEntry());
1513  }
1514 }
1515 
1517 
1518 
1521 {
1522  //replaces functionality of TGListBox::RemoveAll for ROOT versions < 5.11/02
1523 
1524  Int_t n = box->GetNumberOfEntries();
1525  if (n) box->RemoveEntries(0, n - 1);
1526  if (box->GetSelectedEntry()) {
1527  ((TGTextLBEntry*)box->GetSelectedEntry())->SetTitle("");
1528  fClient->NeedRedraw(box->GetSelectedEntry());
1529  }
1530 }
1531 
1532 #endif
1533 
1534 
1535 
1566 
1567 void KVDataAnalysisLauncher::SetResource(const Char_t* name, const Char_t* value)
1568 {
1569  // Handles resource file ".KVDataAnalysisGUIrc"
1570  // We store the current state of the interface using the following resource names:
1571  //
1572  // Repository KVDataAnalysisLauncher.Repository
1573  // DataSet KVDataAnalysisLauncher.DataSet
1574  // Task KVDataAnalysisLauncher.Task
1575  // System KVDataAnalysisLauncher.System
1576  // Trigger KVDataAnalysisLauncher.Trigger
1577  // RunsList KVDataAnalysisLauncher.RunsList
1578  // UserClass KVDataAnalysisLauncher.UserClass
1579  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector
1580  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead
1581  //
1582  // We also keep a "memory" of all selected configurations using the following
1583  // resource names:
1584  //
1585  // DataSet KVDataAnalysisLauncher.DataSet.[repository]
1586  // Task KVDataAnalysisLauncher.Task.[repository].[dataset]
1587  // System KVDataAnalysisLauncher.System.[repository].[dataset].[task]
1588  // Trigger KVDataAnalysisLauncher.Trigger.[repository].[dataset].[task].[system]
1589  // RunsList KVDataAnalysisLauncher.RunsList.[repository].[dataset].[task].[system].[trigger]
1590  // UserClass KVDataAnalysisLauncher.UserClass.[repository].[dataset].[task].[system].[trigger]
1591  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector.[repository].[dataset].[task].[system].[trigger]
1592  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead.[repository].[dataset].[task].[system].[trigger]
1593  //
1594  // N.B. [task]: it is the NAME of the task which is used in the resource name.
1595  // N.B.2. [system]: it is the name given by SystemBatchName() which is used in the resource name.
1596  // N.B.3. [trigger]: for the resource name we take "M > 4", "M>=8" "All" etc. and replace all ' ', '>' or '=' by ''
1597  // to give "M4", "M8", "All", etc.
1598 
1599  TString res, ful_res;
1600 
1601  BuildResourceName(name, res, ful_res);
1602 
1603  // save current value of resource
1604  GUIenv->SetValue(res.Data(), value);
1605 
1606  // save resource for future use if possible
1607  if (ful_res.Length()) GUIenv->SetValue(ful_res.Data(), value);
1608 
1610 }
1611 
1612 
1613 
1614 
1619 
1620 const Char_t* KVDataAnalysisLauncher::GetResource(const Char_t* name, const Char_t* defaultvalue)
1621 {
1622  // Handles resource file ".KVDataAnalysisGUIrc"
1623  //
1624  // We return the current value of the resource "name"
1625 
1626  TString res = name;
1627  res.Prepend("KVDataAnalysisLauncher.");
1628  return GUIenv->GetValue(res.Data(), defaultvalue);
1629 }
1630 
1631 
1632 
1633 
1648 
1649 const Char_t* KVDataAnalysisLauncher::GetSavedResource(const Char_t* name, const Char_t* defaultvalue)
1650 {
1651  // Handles resource file ".KVDataAnalysisGUIrc"
1652  //
1653  // We look for a stored value of the resource "name" corresponding to the current
1654  // values of all the resources which come before "name" in the list :
1655  // Repository
1656  // DataSet
1657  // Task
1658  // System
1659  // Trigger
1660  // These values are stored in resources with names like:
1661  // KVDataAnalysisLauncher.[name].[repository].[dataset]...
1662  //
1663  // If no stored value is found, the defaultvalue is returned
1664 
1665  TString res, ful_res;
1666 
1667  BuildResourceName(name, res, ful_res);
1668 
1669  if (!ful_res.Length()) {
1670  return GUIenv->GetValue(res.Data(), defaultvalue);
1671  }
1672 
1673  return GUIenv->GetValue(ful_res.Data(), defaultvalue);
1674 }
1675 
1676 
1677 
1678 
1681 
1683 {
1684  // Get the system name for the batch name
1685 
1686  TString tmp = GetSystem();
1687  if (tmp == "All") return GetSystem();
1688  return GetDataAnalyser()->SystemBatchName();
1689 }
1690 
1691 
1692 
1693 
1734 
1735 void KVDataAnalysisLauncher::BuildResourceName(const Char_t* name, TString& cur_res, TString& saved_res)
1736 {
1737  // Build the full resource names for storing DataSet, Task, etc.
1738  //
1739  // We store the current state of the interface using the following resource names:
1740  //
1741  // "name" "cur_res"
1742  // Repository KVDataAnalysisLauncher.Repository
1743  // DataSet KVDataAnalysisLauncher.DataSet
1744  // Task KVDataAnalysisLauncher.Task
1745  // System KVDataAnalysisLauncher.System
1746  // Trigger KVDataAnalysisLauncher.Trigger
1747  // RunsList KVDataAnalysisLauncher.RunsList
1748  // UserClass KVDataAnalysisLauncher.UserClass
1749  // UserClassOptions KVDataAnalysisLauncher.UserClassOptions
1750  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector
1751  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead
1752  //
1753  // We also keep a "memory" of all selected configurations using the following
1754  // resource names:
1755  //
1756  // "name" "saved_res"
1757  // DataSet KVDataAnalysisLauncher.DataSet.[repository]
1758  // Task KVDataAnalysisLauncher.Task.[repository].[dataset]
1759  // System KVDataAnalysisLauncher.System.[repository].[dataset].[task]
1760  // Trigger KVDataAnalysisLauncher.Trigger.[repository].[dataset].[task].[system]
1761  // RunsList KVDataAnalysisLauncher.RunsList.[repository].[dataset].[task].[system].[trigger]
1762  // UserClass KVDataAnalysisLauncher.UserClass.[repository].[dataset].[task].[system].[trigger]
1763  // UserClassOptions KVDataAnalysisLauncher.UserClassOptions.[repository].[dataset].[task].[system].[trigger].[class]
1764  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector.[repository].[dataset].[task].[system].[trigger]
1765  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead.[repository].[dataset].[task].[system].[trigger]
1766  //
1767  // N.B. [task]: it is the NAME of the task which is used in the resource name.
1768  // N.B.2. [system]: it is the name given by SystemBatchName() which is used in the resource name.
1769  // N.B.3. [trigger]: for the resource name we take "M > 4", "M>=8" "All" etc. and replace all ' ', '>' or '=' by ''
1770  // to give "M4", "M8", "All", etc.
1771  //
1772  // If name = "Repository", saved_res="" as we do not save it.
1773  // If the resource cannot be saved because one of the resources that is needed to form the
1774  // full resource name has not been set, saved_res="".
1775 
1776  //Resource name for current value
1777  cur_res = name;
1778  cur_res.Prepend("KVDataAnalysisLauncher.");
1779 
1780  //Build full name for save
1781  Int_t index = -1;
1782  saved_res = "";
1783  // look for resource name in list ResourceNames
1784  TObject* resource = 0;
1785  if ((resource = ResourceNames->FindObject(name))) {
1786  //get index in resource table
1787  index = ResourceNames->IndexOf(resource);
1788  }
1789 
1790  if (index == 0) { // resource name = "Repository"; nothing more to do
1791  return;
1792  }
1793 
1794  if (index == -1) index = NbResNames; // force loop to end of list
1795 
1796  // resource name is written in format KVDataAnalysisLauncher.[name].[repository]....
1797  // where the suffixed resource values are all those in the list before the named resource
1798  // i.e. for name = "Task" we write the resource KVDataAnalysisLauncher.Task.[repository].[dataset]
1799 
1800  saved_res = cur_res;
1801  TIter next_res(ResourceNames);
1802  Int_t i = 0;
1803  Bool_t ok = kTRUE;
1804 
1805  while ((resource = next_res()) && (i++ < index)) {
1806 
1807  TString tmp(GetResource(resource->GetName()));
1808  TString res;
1809  if (tmp == "") {
1810  // one of required resources is not set - none of following resources will be set either
1811  // we cannot save this resource
1812  ok = kFALSE;
1813  break;
1814  }
1815  if (!strcmp(resource->GetName(), "Task") && gDataSet) {
1816  // translate title to name for task
1817  KVDataAnalysisTask* tsk = gDataSet->GetAnalysisTask(tmp.Data());
1818  if (tsk) res.Form(".%s", tsk->GetName());
1819  }
1820  else if (!strcmp(resource->GetName(), "System")) {
1821  // use SystemBatchName
1822  res.Form(".%s", SystemBatchName().Data());
1823  }
1824  else if (!strcmp(resource->GetName(), "Trigger")) {
1825  // turn "M > 4" into "M4"
1826  tmp.ReplaceAll(" ", "");
1827  tmp.ReplaceAll(">", "");
1828  tmp.ReplaceAll("=", "");
1829  res.Form(".%s", tmp.Data());
1830  }
1831  else {
1832  res.Form(".%s", GetResource(resource->GetName()));
1833  }
1834  saved_res += res;
1835  }
1836  if (!strcmp(name, "UserClassOptions")) {
1837  if (strcmp("", GetResource("UserClass", ""))) saved_res += Form(".%s", GetResource("UserClass", ""));
1838  else ok = kFALSE;
1839  }
1840 
1841  if (!ok) saved_res = "";
1842 }
1843 
1844 
1845 
1846 
1854 
1856 {
1857  // Look at files in working directory & deduce list of user analysis classes.
1858  // We look for any file ending in '.h'. If we can find a corresponding '.cpp' or '.C' or '.cxx',
1859  // we consider that it is a user analysis class. This list is used to fill the "User Class"
1860  // drop-down list.
1861  // We add "[NEW]" at the end of the list: if selected, this will generate a new user analysis
1862  // class for the currently selected data & analysis task
1863 
1864  TSystemDirectory dir("LocDir", ".");
1865  unique_ptr<TList> lf(dir.GetListOfFiles());
1866  if (!lf.get()) return;
1867  UserClassNames->Clear();
1868  //loop over file names
1869  TIter next(lf.get());
1870  while (TObject* file = next()) {
1871 
1872  // fill list with all '.h' files
1873  TString tmp(file->GetName());
1874  if (tmp.EndsWith(".h")) {
1875  //strip '.h' from filename
1876  tmp.Remove(tmp.Index(".h"));
1877  UserClassNames->Add(new TNamed(tmp.Data(), tmp.Data()));
1878  }
1879 
1880  }
1881 
1882  // now check that implementation files exist for all '.h' we found
1883  TIter next_cl(UserClassNames);
1884  KVString imp, dec;
1885  while (TNamed* clh = (TNamed*)next_cl()) {
1886  if (!KVBase::FindClassSourceFiles(clh->GetName(), imp, dec)) clh->SetName("_INVALID_");
1887  }
1888  // remove all invalid class names
1889  while (TObject* obj = UserClassNames->FindObject("_INVALID_")) {
1890  UserClassNames->Remove(obj);
1891  delete obj;
1892  }
1893  // add [NEW] to list
1894  UserClassNames->Add(new TNamed("[NEW]", "[NEW]"));
1895 }
1896 
1897 
1898 
1899 
1902 
1904 {
1905  // Sets the list of all available user classes in the drop down list
1906 
1907 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1909 #else
1911 #endif
1912  cbUserClass->Select(-1);
1913 
1914  Int_t nbcl = UserClassNames->GetEntries();
1915  Int_t i = 0;
1916  cbUserClass->AddEntry("", i++);
1917  while (i < nbcl + 1) {
1918  cbUserClass->AddEntry(UserClassNames->At(i - 1)->GetName(), i);
1919  i++;
1920  }
1921  cbUserClass->Layout();
1922 }
1923 
1924 
1925 
1926 
1930 
1932 {
1933  // Called when a user class is selected in the combo box.
1934  // Updates batch name if 'auto batch name' is selected.
1935 
1936  if (!strcmp(class_name, "[NEW]")) {
1938  return;
1939  }
1940 
1941  // save resource
1942  SetResource("UserClassOptions", teUserOptions->GetText());
1943  SetResource("UserClass", class_name);
1944  teUserOptions->SetText(GetSavedResource("UserClassOptions", ""));
1945  SetResource("UserClassOptions", teUserOptions->GetText());
1946  if (strcmp("", class_name)) {
1948  GetDataAnalyser()->SetUserClass(class_name, kFALSE);
1949  }
1950  else btEditClass->SetEnabled(kFALSE);
1952 }
1953 
1954 
1955 
1962 
1964 {
1965  // called when user selects [NEW] in user class list
1966  // we generate a new analysis class for currently selected data & task
1967  // the source files are opened in the $EDITOR
1968  // the new class is selected for the analysis
1969 
1970  // Get name of new class
1971  TString classname;
1972  Bool_t ok;
1973  new KVInputDialog(this, "Enter name of new analysis class", &classname, &ok, "Enter name of new analysis class");
1974  // check new classname is not name of existing class
1975  KVString impfile, decfile;
1976  if (KVBase::FindClassSourceFiles(classname, impfile, decfile)) {
1977  ok = ok && WarningBox("Replacing existing class",
1978  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)",
1979  classname.Data(), decfile.Data(), impfile.Data()),
1980  kTRUE);
1981  }
1982  if (ok) {
1983  gDataSet->MakeAnalysisClass(GetTask(), classname);
1985  }
1986  SetUserClassList();
1987  if (ok) {
1988  SetUserClass(classname);
1990  }
1991 }
1992 
1993 
1994 
1995 
2000 
2002 {
2003  // Sets selected user class in combo box according to e.g. a previously stored resource value.
2004  // We update the resource corresponding to the current state of the interface.
2005 
2006  // look for user class in list
2007  TGLBEntry* e = cbUserClass->FindEntry(class_name);
2008 
2009  if (e) {
2010  Int_t i = e->EntryId();
2011 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
2012  cbUserClass->Select(i);
2013 #else
2014  cbUserClass->Select(i, kFALSE);
2015 #endif
2016  // save current user class options
2017  // save current user class
2018  SetResource("UserClass", class_name);
2019  teUserOptions->SetText(GetSavedResource("UserClassOptions", ""));
2021  }
2022 
2023  else
2024  // unknown user class
2025  {
2026  cbUserClass->Select(-1);
2027  SetResource("UserClass", "");
2028 
2030  }
2032 }
2033 
2034 
2035 
2036 
2039 
2041 {
2042  // Returns currently selected user class name
2043 
2045  return e->GetText()->GetString();
2046  }
2047  else {
2048  return "";
2049  }
2050 }
2051 
2052 
2053 
2054 
2057 
2059 {
2060  // Remove all entries from user class combo box & disable text entry
2061 
2062 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
2064 #else
2066 #endif
2067  cbUserClass->Select(-1);
2070 }
2071 
2072 
2073 
2074 
2079 
2081 {
2082  // Reenable user class combo box & text entry,
2083  // fill list with all known user classes & select the one corresponding
2084  // to the current environment
2085 
2086 
2087  SetUserClassList();
2088  SetUserClass(GetSavedResource("UserClass", ""));
2091 }
2092 
2093 
2094 
2099 
2101 {
2102  // If environment variable $EDITOR is set, and if the currently selected
2103  // user class has available source files, we open them in the
2104  // user's favourite editor
2105 
2106  TString editor = gSystem->Getenv("EDITOR");
2107  if (editor == "") return;
2108  TString uclass = GetUserClass();
2109  if (uclass == "") return;
2110  KVString imp, dec;
2111  if (!KVBase::FindClassSourceFiles(uclass, imp, dec)) return;
2112  gSystem->Exec(Form("%s %s %s &", editor.Data(), imp.Data(), dec.Data()));
2113 }
2114 
2115 
2116 
2117 
2122 
2124 {
2125  // Called when user presses "Runlist" button.
2126  // Open dialogue box in which a runlist can be entered.
2127  // The runs in the runlist will be selected.
2128 
2129  TString runs = listOfRuns.AsString();
2130  Bool_t ok = kFALSE;
2131  new KVInputDialog(this, "Enter list of runs", &runs, &ok);
2132  if (ok) {
2133  DeselectAll();
2134  SetRuns(runs.Data());
2135  }
2136 }
2137 
2138 
2139 
2140 
2145 
2147 {
2148  // Called when the selected runs in TGListView lvRuns change.
2149  // We update the KVNumberList listOfRuns according to the current selection
2150  // we modify the limits of the 'runs per job' widget
2151 
2152  listOfRuns.Clear();
2153  TList* novolist = lvRuns->GetSelectedObjects();
2154  if (novolist->GetEntries() > 0) {
2155  TIter nxt(novolist);
2156  KVRunFile* s = 0;
2157  while ((s = (KVRunFile*)nxt())) listOfRuns.Add(s->GetRunNumber());
2158  }
2159  delete novolist;
2160  SetResource("RunsList", listOfRuns.AsString());
2161  if (listOfRuns.GetNValues())
2162  selectedRuns->SetText(Form(" Selected Runs : %s", listOfRuns.AsString(MAX_LENGTH_SELECTED_RUNS)));
2163  else
2164  selectedRuns->SetText(" Selected Runs : [NONE]");
2166 }
2167 
2168 
2169 
2170 
2173 
2175 {
2176  // Empty displayed list of selected runs
2177  listOfRuns.Clear();
2178  SetResource("RunsList", "");
2179  selectedRuns->SetText(Form(" Selected Runs : %s", listOfRuns.AsString(MAX_LENGTH_SELECTED_RUNS)));
2181 }
2182 
2183 
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:177
static Bool_t FindClassSourceFiles(const Char_t *class_name, KVString &imp_file, KVString &dec_file, const Char_t *dir_name=".")
Definition: KVBase.cpp:1102
KVBatchSystem * GetDefaultBatchSystem() const
KVBatchSystem * GetBatchSystem(const Char_t *name)
Get batch system by name.
Utility GUI used for setting batch system parameters.
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 &)
virtual void Clear(Option_t *opt="")
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 SetUserClass(const Char_t *kvs, Bool_t check=kTRUE)
void SetAnalysisTask(KVDataAnalysisTask *at)
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.
virtual const Char_t * GetDataSet(void)
virtual 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="")
virtual void SetRepositoryList(void)
Sets the list of all possible repositories in the repository combo box.
virtual void DeselectAll(void)
Deselect all runs currently in the displayed list of runs.
virtual 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
virtual void SetUserIncludes(void)
Set the User's includes.
TString SystemBatchName()
Get the system name for the batch name.
virtual void SetRepository(const Char_t *r="")
virtual void SetRuns(const Char_t *s="")
virtual 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.
virtual void SetSystemList(Int_t s)
void SetResource(const Char_t *name, const Char_t *value)
std::unique_ptr< TList > list_of_runs
virtual Bool_t WarningBox(const char *title="Warning", const char *msg="Warning", Bool_t confirm=kFALSE)
virtual void SelectAll(void)
Select all runs currently in the displayed list of runs.
virtual const Char_t * GetRuns(void)
void BuildResourceName(const Char_t *name, TString &, TString &)
KVDataSetAnalyser * GetDataAnalyser(KVDataAnalysisTask *task=0)
virtual const Char_t * GetTask(void)
virtual Bool_t IsBatch(void)
const Char_t * GetUserClass()
Returns currently selected user class name.
virtual void SetDataSet(const Char_t *ds="")
virtual void SetUserLibraries(void)
Set the User's libraries.
TEnv * GUIenv
Declaration des boutons de la fenetre principale.
virtual const Char_t * GetSystem(void)
virtual void SetSystem(const Char_t *s="")
virtual void SetDataSetList(Char_t *s)
Sets the list of all available data sets in the data sets combo box.
virtual void SetTaskList(Char_t *s)
virtual 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 SetFullRunList(const KVNumberList &nl)
void SetDataSet(KVDataSet *ds)
void SetRuns(const KVNumberList &nl, Bool_t check=kTRUE)
void SetSystem(KVDBSystem *syst)
Set the System used in the analysis.
TString SystemBatchName() const
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
virtual TList * GetListOfAvailableSystems(const Char_t *datatype, KVDBSystem *systol=0)
Definition: KVDataSet.cpp:623
KVDataAnalysisTask * GetAnalysisTask(Int_t) const
Definition: KVDataSet.cpp:598
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Definition: KVDataSet.cpp:767
virtual Int_t GetNtasks() const
Definition: KVDataSet.cpp:583
KVNumberList GetRunList(const Char_t *data_type, const KVDBSystem *sys=0) const
Definition: KVDataSet.cpp:1699
virtual void MakeAnalysisClass(const Char_t *task, const Char_t *classname)
Definition: KVDataSet.cpp:1802
void cd() const
Definition: KVDataSet.cpp:745
virtual KVSeqCollection * GetSystems() const
Definition: KVExpDB.h:89
Directory dialogue box for KVDataAnalysisLauncher.
virtual void Init(TString &fileList, const Char_t *title)
init window
virtual Char_t * GetFileFromDialog(void)
Gets the file name from a TGFileDialog.
virtual Bool_t CanAdd(const Char_t *s)
tells whether the file in ths string fn can be added to the list box
KVGDirectoryList(TString &st, const Char_t *titre="File list", const TGWindow *p=0, const TGWindow *main=0, Bool_t ok=kTRUE)
Createur.
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="")
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
void Inter(const KVNumberList &list)
const Char_t * AsString(Int_t maxchars=0) const
Int_t GetNValues() const
void SetList(const TString &)
void Add(Int_t)
Add value 'n' to the list.
void Clear(Option_t *="")
Empty number list, reset it to initial state.
Description of an individual run file in an experimental dataset.
Definition: KVRunFile.h:19
virtual Int_t GetSize() const
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)