KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVDataAnalysisLauncher.cpp
Go to the documentation of this file.
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"
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"
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) {
464  }
466  exit(1);
467  }
468  ia = 0;
469  GetDataAnalyser();//this will set up gBatchSystemManager
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);
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();
811  Int_t i = 0;
812  while (i < nbds) {
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 
856 
857  noSystems = (!gExpDB || !gExpDB->GetSystems()->GetSize());
858  if (noSystems) lvSystems->RemoveAll();
859 
860  Int_t i = 0;
861  while (i < nbt) {
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 
904 
906 {
907  // Sets the list of all possible systems in the system list
908  // Called every time a task is selected
909 
910  KVDataAnalysisTask* task = gDataSet->GetAnalysisTask(itask + 1);
911 
912  GetDataAnalyser(task);
913 
914  SetResource("Task", task->GetTitle());
915 
916  if (!task->WithUserClass()) {
917  //no user class required
919  }
920  else {
921  //user class required
923  }
924  //update display
925  cfAnalysis->Layout();
926 
927  TString ds = GetSavedResource("System", "");
928  lastSelectedSystem = 0;
929  if (!noSystems) {
930  TList* sys_list = gDataSet->GetListOfAvailableSystems(task);
931  if (sys_list) {
932  lvSystems->Display(sys_list);
933  delete sys_list;
934  }
935  }
936  if (ds.Length()) {
937  SetSystem(ds.Data());
938  }
939  else {
940  SetRunsList();
941  }
942 }
943 
944 
945 
948 
950 {
951  // Sets the list of all available runs in the runs list box
952 
953  SetResource("Trigger", "All");
954  listOfRuns.Clear();
956  if (entryMax > -1) {
957  lvRuns->RemoveAll();
958  entryMax = -1;
959  }
960 
962  KVDBSystem* system = 0;
963  if (!noSystems || !strcmp(task->GetPrereq(), "*")) {
964  // case where systems are defined for dataset and user has
965  // selected a specific system
966  // OR for online analysis (prereq data type="*")
967  system = lastSelectedSystem;
968  GetDataAnalyser()->SetSystem(system);
969  if (!system) {
970  // no system selected
971  // clear runs list
972  SetRuns();
973  return;
974  }
975  }
976 
977  //Setting name of system in ressources file
978  if (!noSystems) {
979  // dataset with defined systems
980  if (system) {
981  // user has chosen a system
982  SetResource("System", system->GetName());
983  }
984  else {
985  // user chose "All" for system
986  SetResource("System", "All");
987  }
988  }
989  else {
990  // no systems defined for dataset
991  SetResource("System", "Unknown");
992  }
993 
994  KVNumberList run_list = gDataSet->GetRunList(task->GetPrereq(), system);
995  lvRuns->RemoveAll();
996  list_of_runs.reset(gDataSet->GetListOfAvailableSystems(task, system));
997  entryMax = list_of_runs->GetEntries();
998  listOfSystemRuns = run_list;
999  lvRuns->Display(list_of_runs.get());
1000 
1001  TString ds = GetSavedResource("RunsList", "");
1002  SetRuns(ds.Data());
1003 
1004  // Set saved user class, number of events for current
1005  // repository, dataset, task, system, trigger & runs
1006  ds = GetSavedResource("UserClass", "");
1007  SetUserClass(ds.Data());
1008  ds = GetSavedResource("NbEventsToRead", "");
1009  teNbToRead->SetIntNumber(ds.Atoi());
1010 }
1011 
1012 
1013 
1014 
1017 
1019 {
1020  // Select all runs currently in the displayed list of runs
1021  lvRuns->SelectAll();
1023 }
1024 
1025 
1026 
1029 
1031 {
1032  // Deselect all runs currently in the displayed list of runs
1033  lvRuns->UnSelectAll();
1035 }
1036 
1037 
1038 
1041 
1043 {
1044  // Run the analysis task
1045 
1046  TString oriIncludePath = gSystem->GetIncludePath();
1047 
1048  if (gDataRepository->IsRemote()) {
1049  cout << "Checking connection to remote repository." << endl;
1050  if (!gDataRepository->IsConnected()) {
1051  cout << "Connection to server refused" << endl;
1052  cout << "Process aborted." << endl;
1053  WarningBox("Connection refused", "Connection to server refused\nProcess aborted.");
1054  return;
1055  }
1056  }
1057 
1059  KVDataSetAnalyser* datan = GetDataAnalyser(task);
1060  bool online_analysis = !strcmp(task->GetPrereq(), "*");
1061 
1062  //set global pointer to analyser
1063  gDataAnalyser = datan;
1064 
1065  datan->SetDataSet(gDataSet);
1066  datan->SetAnalysisTask(task);
1067  if (listOfRuns.GetNValues()) {
1068  datan->SetRuns(listOfRuns, kFALSE);
1069  datan->SetFullRunList(listOfRuns);
1070  }
1071  else if (!online_analysis) {
1072  WarningBox("Empty Run List", "The list of runs to process is empty.");
1073  return;
1074  }
1075 
1076  if (fUserIncludes.Length()) {
1078  }
1079  if (fUserLibraries.Length()) {
1081  }
1082 
1083  //Need a user class for the analysis ?
1084  TString kvs(GetUserClass());
1085  if (task->WithUserClass()) {
1086  //read user's class name from input box
1087  if (kvs.Length()) {
1089  datan->SetUserClass(kvs.Data(), checkCompilation);
1090  if (datan->IsUserClassValid())
1092  else {
1093  // compilation failed. abort processing.
1094  delete ia;
1095  ia = 0;
1097  if (WarningBox("Compilation failed", "Please correct mistakes in user analysis class", kTRUE)) EditUserClassFiles();
1098  return;
1099  }
1100  }
1101  else {
1102  delete ia;
1103  ia = 0;
1105  WarningBox("No User Class", "Please enter the user analysis class name.");
1106  return;
1107  }
1108  }
1109  else if (strcmp(task->GetUserBaseClass(), "")) {
1110  //task with default "user" class (i.e. UserClass=no but UserClass.BaseClass!="")
1111  datan->SetUserClass(task->GetUserBaseClass(), kFALSE);
1112  }
1113  Long64_t nbEventRead = (Long64_t)teNbToRead->GetIntNumber();
1114  // if in batch and nbEventRead>0, ask confirmation
1115  if (IsBatch() && nbEventRead) {
1116  if (!WarningBox("Read all events in batch mode?",
1117  "This will submit batch jobs which will not read all events.\nAre you sure that is what you want?",
1118  kTRUE)) {
1119  delete ia;
1120  ia = 0;
1121  return;
1122  }
1123  }
1124  // check batch parameters have been set
1125  if (IsBatch()
1126  && (!fBatchParameters.GetNpar() // never set
1127  // previously set with MultiJobsMode turned off (perhaps to read a single run), whereas we now have many runs to read
1128  || (fBatchParameters.HasBoolParameter("MultiJobsMode") && !fBatchParameters.GetBoolValue("MultiJobsMode") && listOfRuns.GetNValues() > 1))
1129  ) {
1130  if (!SetBatchParameters()) return; //abort analysis if user pressed cancel
1131  }
1133  SetResource("RunsList", listOfRuns.AsString());
1134  SetResource("UserClassOptions", teUserOptions->GetText());
1135  SetResource("NbEventsToRead", Form("%.0f", teNbToRead->GetNumber()));
1137  if (IsBatch()) {
1139  gBatchSystem->Clear();
1141  datan->SetBatchSystem(gBatchSystem);
1142  }
1143  else {
1144  datan->SetBatchSystem(nullptr);
1145  }
1146  datan->Run();
1147 
1148  gSystem->SetIncludePath(oriIncludePath.Data());
1149 }
1150 
1151 
1152 
1154 
1156 {
1158  return e->GetText()->GetString();
1159  }
1160  else {
1161  return "";
1162  }
1163 }
1164 
1165 
1166 
1168 
1170 {
1172  return e->GetText()->GetString();
1173  }
1174  else {
1175  return "";
1176  }
1177 }
1178 
1179 
1180 
1182 
1184 {
1186  return e->GetText()->GetString();
1187  }
1188  else {
1189  return "";
1190  }
1191 }
1192 
1193 
1194 
1196 
1198 {
1199  if (noSystems) return "";
1201  if (sys)
1202  return sys->GetName();
1203  else
1204  return "";
1205 }
1206 
1207 
1208 
1209 
1211 
1213 {
1214  return listOfRuns.AsString();
1215 }
1216 
1217 
1218 
1220 
1222 {
1223  TGLBEntry* e = 0;
1224  if ((e = cbRepository->FindEntry(r))) {
1225  Int_t i = e->EntryId();
1226 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1227  cbRepository->Select(i);
1228 #else
1229  cbRepository->Select(i, kFALSE);
1230 #endif
1231  SetDataSetList((Char_t*)r);
1232  }
1233  else {
1234  SetDataSet();
1235  }
1236 }
1237 
1238 
1239 
1241 
1243 {
1244  if (!strcmp(r, "")) {
1245  //remove all datasets because no repository has been chosen yet
1246 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1248 #else
1249  cbDataSet->RemoveAll();
1250 #endif
1251  cbDataSet->Select(-1);
1252  SetResource("Repository", "");
1253  SetTask();
1254  }
1255  else {
1256  TGLBEntry* e = 0;
1257  if ((e = cbDataSet->FindEntry(r))) {
1258  Int_t i = e->EntryId();
1259 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1260  cbDataSet->Select(i);
1261 #else
1262  cbDataSet->Select(i, kFALSE);
1263 #endif
1264  SetTaskList((Char_t*)r);
1265  }
1266  else {
1267  SetTask();
1268  }
1269  }
1270 }
1271 
1272 
1273 
1275 
1277 {
1278  if (!strcmp(r, "")) {
1279  //remove all tasks from list because no dataset chosen yet
1280 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1281  RemoveAll(cbTask);
1282 #else
1283  cbTask->RemoveAll();
1284 #endif
1285  cbTask->Select(-1);
1286  SetResource("DataSet", "");
1287  SetSystem();
1288  }
1289  else {
1290  TGLBEntry* e = 0;
1291  if ((e = cbTask->FindEntry(r))) {
1292  Int_t i = e->EntryId();
1293 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1294  cbTask->Select(i);
1295 #else
1296  cbTask->Select(i, kFALSE);
1297 #endif
1298  SetSystemList(i);
1299  }
1300  else {
1301  SetSystem();
1302  }
1303  }
1304 }
1305 
1306 
1307 
1309 
1311 {
1312  if (!strcmp(r, "")) {
1313  //remove all systems from list because no task chosen yet
1314  lvSystems->RemoveAll();
1315  SetResource("Task", "");
1316  //empty list of analysis classes and disable it
1318  SetRuns();
1319  lvRuns->RemoveAll();
1320  }
1321  else {
1324  }
1325 }
1326 
1327 
1328 
1330 
1332 {
1334  if (system == lastSelectedSystem) return;
1335  lastSelectedSystem = system;
1336  GetDataAnalyser()->SetSystem(system);
1337  SetRunsList();
1338 }
1339 
1340 
1341 
1343 
1345 {
1346  if (!strcmp(r, "")) {
1348  SetResource("Trigger", "All");
1349  SetResource("RunsList", "");
1350  }
1351  else {
1352  listOfRuns.SetList(r);
1354 
1355  if (listOfRuns.GetNValues()) {
1357  SetResource("RunsList", listOfRuns.AsString());
1358  }
1360  }
1361 }
1362 
1363 
1364 
1368 
1370 {
1371  // Set the resource KVDataAnalysisLauncher.Batch according
1372  // to whether button 'Batch' is down or up
1373 
1374  if (IsBatch()) withBatch->SetText("BatchMode: On");
1375  else withBatch->SetText("BatchMode: Off");
1376  GUIenv->SetValue("KVDataAnalysisLauncher.Batch", IsBatch());
1379 }
1380 
1381 
1382 
1386 
1388 {
1389  // Open dialog to set batch parameters for job
1390  // returns kFALSE if cancel is pressed
1391 
1393  // use saved values of batch parameters
1394  fBatchParameters.SetFromEnv(GUIenv, "KVDataAnalysisLauncher");
1395  Bool_t cancel;
1396  // make sure runlist is set in analyser (controls multijobs mode)
1400  if (!cancel) {
1401  // update saved batch parameter resources
1402  fBatchParameters.WriteToEnv(GUIenv, "KVDataAnalysisLauncher");
1404  }
1405  return !cancel;
1406 }
1407 
1408 
1409 
1410 
1413 
1415 {
1416  // Set the User's libraries
1417  TString ori = fUserLibraries.Data();
1418  new KVGFileList(fUserLibraries, "User's Libraries",
1419  gClient->GetRoot(), this);
1420  GUIenv->SetValue("KVDataAnalysisLauncher.UserLibraries", fUserLibraries.Data());
1423 }
1424 
1425 
1426 
1429 
1431 {
1432  // Set the User's includes
1433  TString ori = fUserIncludes.Data();
1434  new KVGDirectoryList(fUserIncludes, "User's Includes",
1435  gClient->GetRoot(), this);
1436  GUIenv->SetValue("KVDataAnalysisLauncher.UserIncludes", fUserIncludes.Data());
1439 }
1440 
1441 
1442 
1443 
1449 
1450 Bool_t KVDataAnalysisLauncher::WarningBox(const char* title, const char* msg, Bool_t confirm)
1451 {
1452  // Warning box in case of problems
1453  // if confirm=kTRUE we ask for a yes/no answer from the user:
1454  // if 'yes' is pressed, we return kTRUE, if 'no', kFALSE.
1455  // by default, only a 'dismiss' button is shown, and this method always returns kTRUE.
1456 
1457  Bool_t reply = kTRUE;
1458  if (!confirm)
1459  new TGMsgBox(gClient->GetRoot(), this, title, msg, kMBIconExclamation);
1460  else {
1461  Int_t ret_code = 0;
1462  new TGMsgBox(gClient->GetRoot(), this, title, msg, kMBIconExclamation, kMBYes | kMBNo, &ret_code);
1463  reply = (ret_code & kMBYes);
1464  }
1465  return reply;
1466 }
1467 
1468 
1469 
1470 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1471 
1474 
1476 {
1477  //replaces functionality of TGComboBox::RemoveAll for ROOT versions < 5.11/02
1478 
1479  Int_t n = box->GetListBox()->GetNumberOfEntries();
1480  if (n) box->RemoveEntries(0, n - 1);
1481  if (box->GetSelectedEntry()) {
1482  ((TGTextLBEntry*)box->GetSelectedEntry())->SetTitle("");
1483  fClient->NeedRedraw(box->GetSelectedEntry());
1484  }
1485  else {
1486  box->GetTextEntry()->SetTitle("");
1487  fClient->NeedRedraw(box->GetTextEntry());
1488  }
1489 }
1490 
1492 
1493 
1496 {
1497  //replaces functionality of TGListBox::RemoveAll for ROOT versions < 5.11/02
1498 
1499  Int_t n = box->GetNumberOfEntries();
1500  if (n) box->RemoveEntries(0, n - 1);
1501  if (box->GetSelectedEntry()) {
1502  ((TGTextLBEntry*)box->GetSelectedEntry())->SetTitle("");
1503  fClient->NeedRedraw(box->GetSelectedEntry());
1504  }
1505 }
1506 
1507 #endif
1508 
1509 
1510 
1541 
1542 void KVDataAnalysisLauncher::SetResource(const Char_t* name, const Char_t* value)
1543 {
1544  // Handles resource file ".KVDataAnalysisGUIrc"
1545  // We store the current state of the interface using the following resource names:
1546  //
1547  // Repository KVDataAnalysisLauncher.Repository
1548  // DataSet KVDataAnalysisLauncher.DataSet
1549  // Task KVDataAnalysisLauncher.Task
1550  // System KVDataAnalysisLauncher.System
1551  // Trigger KVDataAnalysisLauncher.Trigger
1552  // RunsList KVDataAnalysisLauncher.RunsList
1553  // UserClass KVDataAnalysisLauncher.UserClass
1554  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector
1555  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead
1556  //
1557  // We also keep a "memory" of all selected configurations using the following
1558  // resource names:
1559  //
1560  // DataSet KVDataAnalysisLauncher.DataSet.[repository]
1561  // Task KVDataAnalysisLauncher.Task.[repository].[dataset]
1562  // System KVDataAnalysisLauncher.System.[repository].[dataset].[task]
1563  // Trigger KVDataAnalysisLauncher.Trigger.[repository].[dataset].[task].[system]
1564  // RunsList KVDataAnalysisLauncher.RunsList.[repository].[dataset].[task].[system].[trigger]
1565  // UserClass KVDataAnalysisLauncher.UserClass.[repository].[dataset].[task].[system].[trigger]
1566  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector.[repository].[dataset].[task].[system].[trigger]
1567  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead.[repository].[dataset].[task].[system].[trigger]
1568  //
1569  // N.B. [task]: it is the NAME of the task which is used in the resource name.
1570  // N.B.2. [system]: it is the name given by SystemBatchName() which is used in the resource name.
1571  // N.B.3. [trigger]: for the resource name we take "M > 4", "M>=8" "All" etc. and replace all ' ', '>' or '=' by ''
1572  // to give "M4", "M8", "All", etc.
1573 
1574  TString res, ful_res;
1575 
1576  BuildResourceName(name, res, ful_res);
1577 
1578  // save current value of resource
1579  GUIenv->SetValue(res.Data(), value);
1580 
1581  // save resource for future use if possible
1582  if (ful_res.Length()) GUIenv->SetValue(ful_res.Data(), value);
1583 
1585 }
1586 
1587 
1588 
1589 
1594 
1595 const Char_t* KVDataAnalysisLauncher::GetResource(const Char_t* name, const Char_t* defaultvalue)
1596 {
1597  // Handles resource file ".KVDataAnalysisGUIrc"
1598  //
1599  // We return the current value of the resource "name"
1600 
1601  TString res = name;
1602  res.Prepend("KVDataAnalysisLauncher.");
1603  return GUIenv->GetValue(res.Data(), defaultvalue);
1604 }
1605 
1606 
1607 
1608 
1623 
1624 const Char_t* KVDataAnalysisLauncher::GetSavedResource(const Char_t* name, const Char_t* defaultvalue)
1625 {
1626  // Handles resource file ".KVDataAnalysisGUIrc"
1627  //
1628  // We look for a stored value of the resource "name" corresponding to the current
1629  // values of all the resources which come before "name" in the list :
1630  // Repository
1631  // DataSet
1632  // Task
1633  // System
1634  // Trigger
1635  // These values are stored in resources with names like:
1636  // KVDataAnalysisLauncher.[name].[repository].[dataset]...
1637  //
1638  // If no stored value is found, the defaultvalue is returned
1639 
1640  TString res, ful_res;
1641 
1642  BuildResourceName(name, res, ful_res);
1643 
1644  if (!ful_res.Length()) {
1645  return GUIenv->GetValue(res.Data(), defaultvalue);
1646  }
1647 
1648  return GUIenv->GetValue(ful_res.Data(), defaultvalue);
1649 }
1650 
1651 
1652 
1653 
1656 
1658 {
1659  // Get the system name for the batch name
1660 
1661  TString tmp = GetSystem();
1662  if (tmp == "All") return GetSystem();
1663  return GetDataAnalyser()->SystemBatchName();
1664 }
1665 
1666 
1667 
1668 
1709 
1710 void KVDataAnalysisLauncher::BuildResourceName(const Char_t* name, TString& cur_res, TString& saved_res)
1711 {
1712  // Build the full resource names for storing DataSet, Task, etc.
1713  //
1714  // We store the current state of the interface using the following resource names:
1715  //
1716  // "name" "cur_res"
1717  // Repository KVDataAnalysisLauncher.Repository
1718  // DataSet KVDataAnalysisLauncher.DataSet
1719  // Task KVDataAnalysisLauncher.Task
1720  // System KVDataAnalysisLauncher.System
1721  // Trigger KVDataAnalysisLauncher.Trigger
1722  // RunsList KVDataAnalysisLauncher.RunsList
1723  // UserClass KVDataAnalysisLauncher.UserClass
1724  // UserClassOptions KVDataAnalysisLauncher.UserClassOptions
1725  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector
1726  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead
1727  //
1728  // We also keep a "memory" of all selected configurations using the following
1729  // resource names:
1730  //
1731  // "name" "saved_res"
1732  // DataSet KVDataAnalysisLauncher.DataSet.[repository]
1733  // Task KVDataAnalysisLauncher.Task.[repository].[dataset]
1734  // System KVDataAnalysisLauncher.System.[repository].[dataset].[task]
1735  // Trigger KVDataAnalysisLauncher.Trigger.[repository].[dataset].[task].[system]
1736  // RunsList KVDataAnalysisLauncher.RunsList.[repository].[dataset].[task].[system].[trigger]
1737  // UserClass KVDataAnalysisLauncher.UserClass.[repository].[dataset].[task].[system].[trigger]
1738  // UserClassOptions KVDataAnalysisLauncher.UserClassOptions.[repository].[dataset].[task].[system].[trigger].[class]
1739  // KVDataSelector KVDataAnalysisLauncher.KVDataSelector.[repository].[dataset].[task].[system].[trigger]
1740  // NbEventsToRead KVDataAnalysisLauncher.NbEventsToRead.[repository].[dataset].[task].[system].[trigger]
1741  //
1742  // N.B. [task]: it is the NAME of the task which is used in the resource name.
1743  // N.B.2. [system]: it is the name given by SystemBatchName() which is used in the resource name.
1744  // N.B.3. [trigger]: for the resource name we take "M > 4", "M>=8" "All" etc. and replace all ' ', '>' or '=' by ''
1745  // to give "M4", "M8", "All", etc.
1746  //
1747  // If name = "Repository", saved_res="" as we do not save it.
1748  // If the resource cannot be saved because one of the resources that is needed to form the
1749  // full resource name has not been set, saved_res="".
1750 
1751  //Resource name for current value
1752  cur_res = name;
1753  cur_res.Prepend("KVDataAnalysisLauncher.");
1754 
1755  //Build full name for save
1756  Int_t index = -1;
1757  saved_res = "";
1758  // look for resource name in list ResourceNames
1759  TObject* resource = 0;
1760  if ((resource = ResourceNames->FindObject(name))) {
1761  //get index in resource table
1762  index = ResourceNames->IndexOf(resource);
1763  }
1764 
1765  if (index == 0) { // resource name = "Repository"; nothing more to do
1766  return;
1767  }
1768 
1769  if (index == -1) index = NbResNames; // force loop to end of list
1770 
1771  // resource name is written in format KVDataAnalysisLauncher.[name].[repository]....
1772  // where the suffixed resource values are all those in the list before the named resource
1773  // i.e. for name = "Task" we write the resource KVDataAnalysisLauncher.Task.[repository].[dataset]
1774 
1775  saved_res = cur_res;
1776  TIter next_res(ResourceNames);
1777  Int_t i = 0;
1778  Bool_t ok = kTRUE;
1779 
1780  while ((resource = next_res()) && (i++ < index)) {
1781 
1782  TString tmp(GetResource(resource->GetName()));
1783  TString res;
1784  if (tmp == "") {
1785  // one of required resources is not set - none of following resources will be set either
1786  // we cannot save this resource
1787  ok = kFALSE;
1788  break;
1789  }
1790  if (!strcmp(resource->GetName(), "Task") && gDataSet) {
1791  // translate title to name for task
1793  if (tsk) res.Form(".%s", tsk->GetName());
1794  }
1795  else if (!strcmp(resource->GetName(), "System")) {
1796  // use SystemBatchName
1797  res.Form(".%s", SystemBatchName().Data());
1798  }
1799  else if (!strcmp(resource->GetName(), "Trigger")) {
1800  // turn "M > 4" into "M4"
1801  tmp.ReplaceAll(" ", "");
1802  tmp.ReplaceAll(">", "");
1803  tmp.ReplaceAll("=", "");
1804  res.Form(".%s", tmp.Data());
1805  }
1806  else {
1807  res.Form(".%s", GetResource(resource->GetName()));
1808  }
1809  saved_res += res;
1810  }
1811  if (!strcmp(name, "UserClassOptions")) {
1812  if (strcmp("", GetResource("UserClass", ""))) saved_res += Form(".%s", GetResource("UserClass", ""));
1813  else ok = kFALSE;
1814  }
1815 
1816  if (!ok) saved_res = "";
1817 }
1818 
1819 
1820 
1821 
1829 
1831 {
1832  // Look at files in working directory & deduce list of user analysis classes.
1833  // We look for any file ending in '.h'. If we can find a corresponding '.cpp' or '.C' or '.cxx',
1834  // we consider that it is a user analysis class. This list is used to fill the "User Class"
1835  // drop-down list.
1836  // We add "[NEW]" at the end of the list: if selected, this will generate a new user analysis
1837  // class for the currently selected data & analysis task
1838 
1839  TSystemDirectory dir("LocDir", ".");
1840  unique_ptr<TList> lf(dir.GetListOfFiles());
1841  if (!lf.get()) return;
1842  UserClassNames->Clear();
1843  //loop over file names
1844  TIter next(lf.get());
1845  while (TObject* file = next()) {
1846 
1847  // fill list with all '.h' files
1848  TString tmp(file->GetName());
1849  if (tmp.EndsWith(".h")) {
1850  //strip '.h' from filename
1851  tmp.Remove(tmp.Index(".h"));
1852  UserClassNames->Add(new TNamed(tmp.Data(), tmp.Data()));
1853  }
1854 
1855  }
1856 
1857  // now check that implementation files exist for all '.h' we found
1858  TIter next_cl(UserClassNames);
1859  KVString imp, dec;
1860  while (TNamed* clh = (TNamed*)next_cl()) {
1861  if (!KVBase::FindClassSourceFiles(clh->GetName(), imp, dec)) clh->SetName("_INVALID_");
1862  }
1863  // remove all invalid class names
1864  while (TObject* obj = UserClassNames->FindObject("_INVALID_")) {
1865  UserClassNames->Remove(obj);
1866  delete obj;
1867  }
1868  // add [NEW] to list
1869  UserClassNames->Add(new TNamed("[NEW]", "[NEW]"));
1870 }
1871 
1872 
1873 
1874 
1877 
1879 {
1880  // Sets the list of all available user classes in the drop down list
1881 
1882 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
1884 #else
1886 #endif
1887  cbUserClass->Select(-1);
1888 
1889  Int_t nbcl = UserClassNames->GetEntries();
1890  Int_t i = 0;
1891  cbUserClass->AddEntry("", i++);
1892  while (i < nbcl + 1) {
1893  cbUserClass->AddEntry(UserClassNames->At(i - 1)->GetName(), i);
1894  i++;
1895  }
1896  cbUserClass->Layout();
1897 }
1898 
1899 
1900 
1901 
1905 
1907 {
1908  // Called when a user class is selected in the combo box.
1909  // Updates batch name if 'auto batch name' is selected.
1910 
1911  if (!strcmp(class_name, "[NEW]")) {
1913  return;
1914  }
1915 
1916  // save resource
1917  SetResource("UserClassOptions", teUserOptions->GetText());
1918  SetResource("UserClass", class_name);
1919  teUserOptions->SetText(GetSavedResource("UserClassOptions", ""));
1920  SetResource("UserClassOptions", teUserOptions->GetText());
1921  if (strcmp("", class_name)) {
1923  GetDataAnalyser()->SetUserClass(class_name, kFALSE);
1924  }
1925  else btEditClass->SetEnabled(kFALSE);
1927 }
1928 
1929 
1930 
1937 
1939 {
1940  // called when user selects [NEW] in user class list
1941  // we generate a new analysis class for currently selected data & task
1942  // the source files are opened in the $EDITOR
1943  // the new class is selected for the analysis
1944 
1945  // Get name of new class
1946  TString classname;
1947  Bool_t ok;
1948  new KVInputDialog(this, "Enter name of new analysis class", &classname, &ok, "Enter name of new analysis class");
1949  // check new classname is not name of existing class
1950  KVString impfile, decfile;
1951  if (KVBase::FindClassSourceFiles(classname, impfile, decfile)) {
1952  ok = ok && WarningBox("Replacing existing class",
1953  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)",
1954  classname.Data(), decfile.Data(), impfile.Data()),
1955  kTRUE);
1956  }
1957  if (ok) {
1958  gDataSet->MakeAnalysisClass(GetTask(), classname);
1960  }
1961  SetUserClassList();
1962  if (ok) {
1963  SetUserClass(classname);
1965  }
1966 }
1967 
1968 
1969 
1970 
1975 
1977 {
1978  // Sets selected user class in combo box according to e.g. a previously stored resource value.
1979  // We update the resource corresponding to the current state of the interface.
1980 
1981  // look for user class in list
1982  TGLBEntry* e = cbUserClass->FindEntry(class_name);
1983 
1984  if (e) {
1985  Int_t i = e->EntryId();
1986 #ifdef __WITHOUT_TGCOMBOBOX_SELECT_BOOL_T
1987  cbUserClass->Select(i);
1988 #else
1989  cbUserClass->Select(i, kFALSE);
1990 #endif
1991  // save current user class options
1992  // save current user class
1993  SetResource("UserClass", class_name);
1994  teUserOptions->SetText(GetSavedResource("UserClassOptions", ""));
1996  }
1997 
1998  else
1999  // unknown user class
2000  {
2001  cbUserClass->Select(-1);
2002  SetResource("UserClass", "");
2003 
2005  }
2007 }
2008 
2009 
2010 
2011 
2014 
2016 {
2017  // Returns currently selected user class name
2018 
2020  return e->GetText()->GetString();
2021  }
2022  else {
2023  return "";
2024  }
2025 }
2026 
2027 
2028 
2029 
2032 
2034 {
2035  // Remove all entries from user class combo box & disable text entry
2036 
2037 #ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
2039 #else
2041 #endif
2042  cbUserClass->Select(-1);
2045 }
2046 
2047 
2048 
2049 
2054 
2056 {
2057  // Reenable user class combo box & text entry,
2058  // fill list with all known user classes & select the one corresponding
2059  // to the current environment
2060 
2061 
2062  SetUserClassList();
2063  SetUserClass(GetSavedResource("UserClass", ""));
2066 }
2067 
2068 
2069 
2074 
2076 {
2077  // If environment variable $EDITOR is set, and if the currently selected
2078  // user class has available source files, we open them in the
2079  // user's favourite editor
2080 
2081  TString editor = gSystem->Getenv("EDITOR");
2082  if (editor == "") return;
2083  TString uclass = GetUserClass();
2084  if (uclass == "") return;
2085  KVString imp, dec;
2086  if (!KVBase::FindClassSourceFiles(uclass, imp, dec)) return;
2087  gSystem->Exec(Form("%s %s %s &", editor.Data(), imp.Data(), dec.Data()));
2088 }
2089 
2090 
2091 
2092 
2097 
2099 {
2100  // Called when user presses "Runlist" button.
2101  // Open dialogue box in which a runlist can be entered.
2102  // The runs in the runlist will be selected.
2103 
2104  TString runs = listOfRuns.AsString();
2105  Bool_t ok = kFALSE;
2106  new KVInputDialog(this, "Enter list of runs", &runs, &ok);
2107  if (ok) {
2108  DeselectAll();
2109  SetRuns(runs.Data());
2110  }
2111 }
2112 
2113 
2114 
2115 
2120 
2122 {
2123  // Called when the selected runs in TGListView lvRuns change.
2124  // We update the KVNumberList listOfRuns according to the current selection
2125  // we modify the limits of the 'runs per job' widget
2126 
2127  listOfRuns.Clear();
2128  TList* novolist = lvRuns->GetSelectedObjects();
2129  if (novolist->GetEntries() > 0) {
2130  TIter nxt(novolist);
2131  KVRunFile* s = 0;
2132  while ((s = (KVRunFile*)nxt())) listOfRuns.Add(s->GetRunNumber());
2133  }
2134  delete novolist;
2135  SetResource("RunsList", listOfRuns.AsString());
2136  if (listOfRuns.GetNValues())
2138  else
2139  selectedRuns->SetText(" Selected Runs : [NONE]");
2141 }
2142 
2143 
2144 
2145 
2148 
2150 {
2151  // Empty displayed list of selected runs
2152  listOfRuns.Clear();
2153  SetResource("RunsList", "");
2156 }
2157 
2158 
int Int_t
unsigned int UInt_t
kVerticalFrame
kHorizontalFrame
KVBatchSystemManager * gBatchSystemManager
KVBatchSystem * gBatchSystem
KVDataAnalyser * gDataAnalyser
#define MAX_LENGTH_SELECTED_RUNS
#define TTDELAY
KVDataRepositoryManager * gDataRepositoryManager
KVDataRepository * gDataRepository
KVDataSetManager * gDataSetManager
KVDataSet * gDataSet
Definition: KVDataSet.cpp:30
KVExpDB * gExpDB
Definition: KVExpDB.cpp:12
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
ROOT::R::TRInterface & r
#define e(i)
char Char_t
const Bool_t kFALSE
bool Bool_t
const 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
char * Form(const char *fmt,...)
char * StrDup(const char *str)
R__EXTERN TSystem * gSystem
kS_IFDIR
static Bool_t FindClassSourceFiles(const Char_t *class_name, KVString &imp_file, KVString &dec_file, const Char_t *dir_name=".")
Definition: KVBase.cpp:1065
const Char_t * GetType() const
Definition: KVBase.h:170
KVBatchSystem * GetDefaultBatchSystem() const
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:51
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="")
unique_ptr< TList > list_of_runs
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)
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:613
virtual KVDataAnalysisTask * GetAnalysisTask(Int_t) const
Definition: KVDataSet.cpp:588
virtual Int_t GetNtasks() const
Definition: KVDataSet.cpp:573
KVNumberList GetRunList(const Char_t *data_type, const KVDBSystem *sys=0) const
Definition: KVDataSet.cpp:1689
virtual void MakeAnalysisClass(const Char_t *task, const Char_t *classname)
Definition: KVDataSet.cpp:1790
void cd() const
Definition: KVDataSet.cpp:735
virtual KVSeqCollection * GetSystems() const
Definition: KVExpDB.h:87
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:23
Enhanced version of ROOT TGListView widget.
Definition: KVListView.h:145
virtual void SelectAll()
Definition: KVListView.h:181
virtual void UnSelectAll()
Definition: KVListView.h:185
virtual void Display(const TCollection *l)
Definition: KVListView.h:172
TObject * GetLastSelectedObject() const
Definition: KVListView.h:230
void ActivateItemsWithColumnData(const Char_t *colname, KVNumberList data, Bool_t activate=kTRUE)
Definition: KVListView.h:226
void ActivateItemWithColumnData(const Char_t *colname, const Char_t *data, Bool_t activate=kTRUE)
Definition: KVListView.h:214
TList * GetSelectedObjects() const
Definition: KVListView.h:244
virtual void RemoveAll()
Definition: KVListView.h:189
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:83
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:18
virtual Int_t GetSize() const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
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)
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
virtual void RemoveAll()
virtual void Select(Int_t id, Bool_t emit=kTRUE)
virtual TGLBEntry * GetSelectedEntry() const
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 Layout()
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
virtual void Layout()
virtual void MapSubwindows()
virtual void RemoveAll()
char * fFilename
const char ** fFileTypes
char * fIniDir
virtual void MapRaised()
virtual void Resize(TGDimension size)
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)
virtual TGLBEntry * GetEntry(Int_t id) const
virtual void Layout()
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)
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)
virtual void Add(TObject *obj)
TObject * Remove(const TObjLinkPtr_t &lnk)
virtual TObject * FindObject(const char *name) const
virtual TObject * At(Int_t idx) const
virtual void Clear(Option_t *option="")
virtual const char * GetName() const
virtual const char * GetTitle() const
const TString & GetString() const
virtual const char * GetName() 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
TObjArray * Tokenize(const TString &delim) const
const char * Data() 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
const long double s
Definition: KVUnits.h:94