KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVDataSetAnalyser.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Tue Feb 14 12:32:06 2017
2 //Author: John Frankland,,,
3 
4 #include "KVDataSetAnalyser.h"
6 #include "KVDataRepository.h"
7 #include "KVDataSetManager.h"
8 #include "KVDataSet.h"
9 #include "KVDBSystem.h"
10 #include "KV2Body.h"
11 #include "KVDBRun.h"
12 #include <iostream>
13 using namespace std;
14 
16 
17 
18 
19 
23  : KVDataAnalyser()
24 {
25  // Default constructor
26  fSystem = nullptr;
27  fDataSet = nullptr;
28  fChoozDataSet = kTRUE;
29  fChoozTask = kFALSE;
30  fChoozSystem = kFALSE;
31  fChoozRuns = kFALSE;
32 }
33 
34 
35 
36 
39 
41 {
42  // Destructor
43 }
44 
45 
46 
47 
49 
51 {
53  fDataSet = nullptr;
54  fRunList.Clear();
55  fSystem = nullptr;
56  fChoozDataSet = kTRUE;
57  fChoozTask = kFALSE;
58  fChoozSystem = kFALSE;
59  fChoozRuns = kFALSE;
60 }
61 
62 
63 
67 
69 {
70  // Called just before SubmitTask() in Run()
71  // Checks if remote repository is connected if necessary
72  if (GetParent() && gDataRepository->IsRemote() && !gDataRepository->IsConnected()) return kFALSE;
73  return kTRUE;
74 }
75 
76 
77 
80 
82 {
83  // Called at end of Run() after execution of analysis task
85  fChoozDataSet = kTRUE;
86 }
87 
88 
89 
91 
93 {
94  while (!IsQuit()) {
95  if (fChoozSystem)
96  ChooseSystem();
97  else if (fChoozRuns)
98  ChooseRuns();
99  else
100  break;
101  }
102 }
103 
104 
105 
107 
109 {
110  while (!IsQuit()) {
111  if (fChoozDataSet)
112  ChooseDataSet();
113  else if (IsChooseTask())
114  ChooseAnalysisTask();
115  else
116  break;
117  }
118 }
119 
120 
121 
123 
125 {
126  if (!fDataSet) {
127  ChooseDataSet();
128  if (!fDataSet) {
129  //if after calling ChooseDataSet we STILL don't have a dataset,
130  //there is something seriously wrong...
131  Error("CheckTaskVariables", "By the pricking of my thumb, something wicked this way comes...");
132  Error("CheckTaskVariables", " *** ABORTING THE ANALYSIS ***");
133  return kFALSE;
134  }
135  }
136 
137  if (!GetAnalysisTask()) {
138  ChooseAnalysisTask();
139  }
140 
141  if (fRunList.IsEmpty()) {
142  ChooseSystem();
143  ChooseRuns();
144  }
145  return kTRUE;
146 }
147 
148 
149 
150 
155 
157 {
158  //Print list of available datasets and get user to choose one
159  //A pointer to the chosen dataset can be retrieved with GetDataSet()
160 
161  //not possible in batch mode
162  if (BatchMode()) return;
163 
164  fChoozDataSet = kFALSE;
165  SetQuit(kFALSE);
166  _set_dataset_pointer(nullptr);
167  if (GetAnalysisTask()) SetAnalysisTask(nullptr);
168 
169  cout << "Available datasets :" << endl << endl;
170  gDataSetManager->Print("available");
171  Int_t n_dataset = -1;
172  Int_t n_avail = gDataSetManager->GetNavailable();
173 
174  if (n_avail < 1) {
175  //no datasets available - force termination
176  SetQuit();
177  return;
178  }
179 
180  if (n_avail == 1) {
181  //1 dataset available - automatic choice
182  n_dataset = 1;
183  }
184  else {
185  KVString tmp;
186  while (!IsQuit() && (n_dataset < 1 || n_dataset > n_avail)) {
187  cout << endl << "Your choice (1-" << gDataSetManager->
188  GetNavailable() << ")";
189  if (IsMenus()) cout << " [q - quit]";
190  cout << " : ";
191  tmp.ReadLine(cin);
192  if (IsMenus() && (tmp.Contains("q") || tmp.Contains("Q"))) {
193  SetQuit();
194  return;
195  }
196  else if (tmp.IsDigit()) {
197  n_dataset = tmp.Atoi();
198  }
199  }
200  }
201  //we have chosen a dataset
202  _set_dataset_pointer(gDataSetManager->GetAvailableDataSet(n_dataset));
203  //in menu-driven mode, next step is choice of analysis task
204  SetChooseTask();
205 }
206 
207 
208 
213 
215 {
216  //Print list of available types of data for the chosen dataset
217  //and get user to choose one.
218 
219  //not possible in batch mode
220  if (BatchMode()) return;
221 
222  SetChooseTask(kFALSE);
223  SetQuit(kFALSE);
224  SetChooseSystem(kFALSE);
225  SetChooseDataSet(kFALSE);
226  SetAnalysisTask(nullptr);
227 
228  fDataSet->Print("data");
229  cout << endl << "Choose data type [d - change dataset | q - quit] : ";
230  TString tmp;
231  while (!IsQuit() && !IsChooseDataSet() && !IsChooseSystem()) {
232 
233  tmp.ReadLine(cin);
234  if (tmp == "raw" || tmp == "recon" || tmp == "ident" || tmp == "root") {
235  fChoozSystem = kTRUE;
236  SetDataType(tmp);
237  }
238  else if (tmp.Contains("q") || tmp.Contains("Q")) {
239  SetQuit();
240  }
241  else if (tmp.Contains("d") || tmp.Contains("D")) {
242  SetChooseDataSet();
243  }
244 
245  }
246 }
247 
248 
249 
250 
256 
258 {
259  //Print list of all possible data analysis tasks for the chosen data set and invite the user
260  //to choose one of them.
261  //If only one task available, it is automatically selected
262 
263  //not possible in batch mode
264  if (BatchMode()) return;
265 
266  SetChooseTask(kFALSE);
267  SetAnalysisTask(nullptr);
268  if (fSystem) {
269  fSystem = nullptr;
270  }
271 
272  cout << endl << "Available data analysis tasks :" << endl << endl;
273  fDataSet->Print("tasks");
274  Int_t n_tasks = fDataSet->GetNtasks();
275  if (n_tasks == 1) {
276  SetAnalysisTask(fDataSet->GetAnalysisTask(1));
277  fChoozSystem = kTRUE;
278  return;
279  }
280 
281  Int_t n_task = -1;
282  KVString tmp;
283 
284  while (!IsQuit() && (n_task < 1 || n_task > n_tasks)) {
285  cout << endl << "Your choice (1-" << n_tasks <<
286  ")";
287  if (IsMenus()) cout << " [d - change dataset | q - quit]";
288  cout << " : ";
289  tmp.ReadLine(cin);
290  if (IsMenus() && (tmp.Contains("q") || tmp.Contains("Q"))) {
291  SetQuit();
292  return;
293  }
294  else if (IsMenus() && (tmp.Contains("d") || tmp.Contains("D"))) {
295  fChoozDataSet = kTRUE;
296  return;
297  }
298  else if (tmp.IsDigit()) {
299  n_task = tmp.Atoi();
300  }
301  }
302  SetAnalysisTask(fDataSet->GetAnalysisTask(n_task));
303  //in menu-driven mode, next step is choice of system
304  fChoozSystem = kTRUE;
305 }
306 
307 
308 
309 
319 
321 {
322  //Print out list of all available systems for the given data type of the chosen dataset
323  //and invite the user to choose one. Return pointer to chosen system.
324  //If 'data_type' is not given, we assume that ChooseAnalysisTask was previously
325  //called and we use the prerequisite data type for the chosen task (fTask->GetPrereq()).
326  //The available system list is deduced from the 'availableruns' file corresponding to the
327  //chosen dataset repository subdirectory and the
328  //chosen data type (="raw", "recon", "ident", "root").
329 
330  //not possible in batch mode
331  if (BatchMode()) return;
332 
333  fChoozSystem = kFALSE;
334  fSystem = 0;
335  ClearRunList();
336 
337  //if no systems are defined for the dataset, we just want to pick from the runlist
338  if (!fDataSet->GetDataBase()->GetSystems()->GetSize()) {
339  fChoozRuns = kTRUE;
340  return;
341  }
342 
343  TString d_t(data_type);
344  //If 'data_type' is not given, we assume that ChooseAnalysisTask or ChooseDataType
345  //was previously called and we use the value of fDataType
346  if (d_t == "")
347  d_t = GetDataType();
348 
349  unique_ptr<TList> sys_list(fDataSet->GetListOfAvailableSystems(d_t.Data()));
350  if (!sys_list.get() || sys_list->GetSize() < 1) {
351  cout << "No systems found for dataset: " << fDataSet->
352  GetName() << ", datatype: " << d_t.Data() << endl;
353  //choose a different data type or analysis task
354  fChoozTask = kTRUE;
355  return;
356  }
357  TIter next_sys(sys_list.get());
358  KVDBSystem* sys;
359  int nsys = 0;
360  cout << endl << "Available systems : " << endl << endl;
361  while ((sys = (KVDBSystem*) next_sys())) {
362  nsys++;
363  cout << " " << Form("%3d.", nsys);
364  cout << " " << Form("%-30s", sys->GetName());
365  cout << " (" << Form("%-3d",
366  sys->GetNumberRuns()) << " runs)" << endl;
367  }
368 
369  if (sys_list->GetSize() == 1) {
370  fChoozRuns = kTRUE;
371  fSystem = (KVDBSystem*) sys_list->At(0);
372  return;
373  }
374 
375  int nsys_pick = -1;
376  KVString tmp;
377 
378  SetQuit(kFALSE);
379  SetChooseTask(kFALSE);
380  fChoozRuns = kFALSE;
381 
382  while (!IsQuit() && !IsChooseTask() && !fChoozRuns && !fChoozDataSet) {
383  cout << endl << "Your choice (1-" << nsys << ")";
384  if (IsMenus()) {
385  cout << " [r - choose runs | "; //ignore systems list & choose from all runs
386  if (GetAnalysisTask())
387  cout << "t - change task";
388  else
389  cout << "t - change type";
390  cout << " | d - change dataset | q - quit]";
391  }
392  cout << " : ";
393  tmp.ReadLine(cin);
394  if (IsMenus() && (tmp.Contains("q") || tmp.Contains("Q"))) {
395  SetQuit();
396  }
397  else if (IsMenus() && (tmp.Contains("t") || tmp.Contains("T"))) {
398  SetChooseTask();
399  }
400  else if (IsMenus() && (tmp.Contains("d") || tmp.Contains("D"))) {
401  fChoozDataSet = kTRUE;
402  }
403  else if (IsMenus() && (tmp.Contains("r") || tmp.Contains("R"))) {
404  fChoozRuns = kTRUE;
405  return;
406  }
407  else if (tmp.IsDigit()) {
408  nsys_pick = tmp.Atoi();
409  if (nsys_pick >= 1 && nsys_pick <= nsys)
410  fChoozRuns = kTRUE;
411  }
412  }
413  if (fChoozRuns)
414  fSystem = (KVDBSystem*) sys_list->At(nsys_pick - 1);
415 }
416 
417 
418 
419 
428 
430  const Char_t* data_type)
431 {
432  //Print out list of available runs for chosen dataset, task/data type and system
433  //and invite user to choose from among them
434  //If 'data_type' is not given, we assume that ChooseAnalysisTask was previously
435  //called and we use the prerequisite data type for the chosen task (fTask->GetPrereq()).
436  //If 'system' is not given, we assume ChooseSystem was previously called and use
437  //the internally-stored value of that choice (fSystem).
438 
439  //not possible in batch mode
440  if (BatchMode()) return;
441 
442  fChoozRuns = kFALSE;
443  //clear any previous list of runs
444  fRunList.Clear();
445 
446  if (system)
447  fSystem = system;
448 
449  KVString d_t(data_type);
450  //If 'data_type' is not given, we assume that ChooseAnalysisTask or ChooseDataType
451  //was previously called and we use the value of fDataType
452  if (d_t == "")
453  d_t = GetDataType();
454 
455  if (fSystem) {
456  cout << endl << " Chosen system : " << endl;
457  fSystem->Print();
458  }
459  cout << endl << endl << " Available runs: " << endl << endl;
460 
461  KVNumberList all_runs = PrintAvailableRuns(d_t);
462 
463  if (all_runs.IsEmpty()) {
464  //no runs - choose another system
465  fChoozSystem = kTRUE;
466  return;
467  }
468 
469  cout << endl << "Enter list of runs [a - all";
470  if (IsMenus()) {
471  cout << " | ";
472  if (fSystem) cout << "s - change system | ";
473  if (GetAnalysisTask())
474  cout << "t - change task";
475  else
476  cout << "t - change type";
477  cout << " | d - change dataset | q - quit";
478  }
479  cout << "] : ";
480  TString tmp;
481  tmp.ReadLine(cin);
482  if (IsMenus() && (tmp.Contains("q") || tmp.Contains("Q"))) {
483  SetQuit();
484  }
485  else if (IsMenus() && (tmp.Contains("s") || tmp.Contains("S"))) {
486  fChoozSystem = kTRUE;
487  }
488  else if (IsMenus() && (tmp.Contains("t") || tmp.Contains("T"))) {
489  SetChooseTask();
490  }
491  else if (IsMenus() && (tmp.Contains("d") || tmp.Contains("D"))) {
492  fChoozDataSet = kTRUE;
493  }
494  else if (tmp.Contains("a") || tmp.Contains("A")) {
495  fRunList = all_runs;
496  SetSubmit();
497  }
498  else {
499  //cout << "YOU TYPED : " << tmp.Data() << endl;
500  KVNumberList user_list(tmp.Data());
501  //cout << "YOUR LIST : " << user_list.GetList() << endl;
502  //cout << "CLEARED RUNLIST : " << endl; fRunList.PrintLimits();
503  //remove from list any runs which did not actually appear in list
504  user_list.Begin();
505  while (!user_list.End()) {
506  Int_t user_run = user_list.Next();
507  if (all_runs.Contains(user_run)) fRunList.Add(user_run);
508  }
509  //cout << "CHECKED RUNLIST : " << endl; fRunList.PrintLimits();
510  if (fRunList.IsEmpty()) {
511  Error("ChooseRuns",
512  "None of the runs you chose appear in the list");
513  //we force the user to choose again
514  fChoozRuns = kTRUE;
515  }
516  else
517  SetSubmit();
518  }
519  if (IsSubmit())
520  cout << endl << "Chosen runs : " << fRunList.GetList() << endl;
521 }
522 
523 
524 
525 
533 
535 {
536  //Set dataset to be used for analysis.
537  //If the chosen dataset is not available, an error message is printed
538  //Only available datasets can be analysed
539  //Moreover, only datasets in the currently active data repository,
540  //gDataRepository, can be analysed. This is also checked.
541 
542  //allow user to reset dataset pointer to 0
543  fDataSet = ds;
544  if (!ds)
545  return;
546 
547  //check availablility
548  if (!ds->IsAvailable()) {
549  Error("SetDataSet",
550  "Dataset %s is not available for analysis", ds->GetName());
551  fDataSet = nullptr;
552  }
553  //check repository
554  if (ds->GetRepository() != gDataRepository) {
555  Error("SetDataSet",
556  "%ld is address of dataset in repository \"%s\", not of the dataset in the current repository, \"%s\"",
557  (ULong_t) ds, ds->GetRepository()->GetName(),
559  fDataSet = nullptr;
560  }
561 }
562 
563 
564 
565 
571 
573 {
574  //Set dataset to be analysed.
575  //If 'name' is not the name of a valid and available dataset
576  //in the currently active data repository, gDataRepository,
577  //an error message is printed.
578 
579  fDataSet = nullptr;
580  KVDataSet* ds = gDataSetManager->GetDataSet(name);
581  if (!ds) {
582  Error("SetDataSet", "Unknown dataset %s", name);
583  }
584  else {
585  set_dataset_pointer(ds);
586  }
587 }
588 
589 
590 
594 
596 {
597  //Prints list of available runs for selected dataset, data type/analysis task, and system
598  //Returns list containing all run numbers
599 
600  KVNumberList all_runs =
601  fDataSet->GetRunList(datatype.Data(), fSystem);
602  KVDBRun* dbrun;
603  all_runs.Begin();
604  while (!all_runs.End()) {
605  dbrun = fDataSet->GetDataBase()->GetDBRun(all_runs.Next());
606  if (dbrun) {
607  cout << " " << Form("%4d", dbrun->GetNumber());
608  cout << Form("\t(%9llu events)", dbrun->GetEvents());
609  cout << "\t[File written: " << dbrun->GetDatime().AsString() << "]";
610  if (dbrun->GetComments())
611  cout << "\t" << dbrun->GetComments();
612  cout << endl;
613  }
614  }
615 
616  return all_runs;
617 }
618 
619 
620 
621 
624 
626 {
627  // Set the System used in the analysis
628 
629  fSystem = syst;
630 }
631 
632 
633 
634 
639 
641 {
642  // Sets the run list
643  //If check=kTRUE (default), we check that the runs are available, and if they belong to different
644  //systems we print a warning message
645  if (!fDataSet) {
646  Warning("SetRuns", "Data Set not defined... Nothing done");
647  return;
648  }
649  if (!check) {
650  fRunList = nl;
651  //set fSystem using first run
652  KVDBRun* run = fDataSet->GetDataBase()->GetDBRun(nl.First());
653  if (run) fSystem = run->GetSystem();
654  else fSystem = 0;
655  return;
656  }
657  // Check if all runs are available for this data set and if they all correspond to the same system
658  Int_t i = 0;
659  Info("SetRuns", "Checking runs %s for Data type %s",
660  nl.AsString(), GetDataType().Data());
661  nl.Begin();
662  fRunList.Clear();
663  while (!nl.End()) {
664  Int_t run_no = nl.Next();
665 
666  if (!(fDataSet->CheckRunfileAvailable(GetDataType(), run_no))) {
667  Warning("SetRuns",
668  "The run %d is not present for the data type \"%s\" of data set \"%s\".",
669  run_no, GetDataType().Data(), fDataSet->GetName());
670  }
671  else {
672  fRunList.Add(run_no);
673  }
674  KVDBRun* run = fDataSet->GetDataBase()->GetDBRun(run_no);
675  if (!i) {
676  fSystem = run->GetSystem();
677  i = 1;
678  }
679  else {
680  if (run->GetSystem() != fSystem) {
681  if (fSystem)
682  Warning("SetRuns",
683  "The system \"%s\" of run %d differs from the system \"%s\" of the previous runs.",
684  run->GetSystem()->GetName(), run_no, fSystem->GetName());
685  }
686  }
687  }
688  Info("SetRuns", "Accepted runs : %s", fRunList.AsString());
689 }
690 
691 
692 
693 
699 
701 {
702  //Save (in the TEnv fBatchEnv) all necessary information on analysis task which can be used to execute it later
703  //(i.e. when batch processing system executes the job).
704  //If save=kTRUE (default), write the information in a file whose name is given by ".jobname"
705  //where 'jobname' is the name of the job as given to the batch system.
706 
708 
709  GetBatchInfoFile()->SetValue("DataRepository", gDataRepository->GetName());
710  GetBatchInfoFile()->SetValue("DataSet", fDataSet->GetName());
711  GetBatchInfoFile()->SetValue("Runs", fRunList.GetList());
712  GetBatchInfoFile()->SetValue("FullRunList", fFullRunList.GetList());
713  if (save) GetBatchInfoFile()->SaveLevel(kEnvUser);
714 }
715 
716 
717 
718 
723 
725 {
726  //Read the batch env file "filename" and initialise the analysis task using the
727  //informations in the file
728  //Returns kTRUE if all goes well
729 
730  Bool_t ok = kFALSE;
731 
732  if (!KVDataAnalyser::ReadBatchEnvFile(filename)) return ok;
733 
734  TString val = GetBatchInfoFile()->GetValue("DataRepository", "");
735  if (val != "") {
737  }
738  else {
739  Error("ReadBatchEnvFile", "Name of data repository not given");
740  return ok;
741  }
742  val = GetBatchInfoFile()->GetValue("DataSet", "");
743  if (val != "") {
744  gDataSetManager->GetDataSet(val.Data())->cd();
745  SetDataSet(gDataSet);
746  }
747  else {
748  Error("ReadBatchEnvFile", "Name of dataset not given");
749  return ok;
750  }
751  val = GetBatchInfoFile()->GetValue("AnalysisTask", "");
752  SetAnalysisTask(nullptr);
753  if (val != "") {
754  SetAnalysisTask(gDataSet->GetAnalysisTask(val.Data()));
755  }
756  else {
757  Error("ReadBatchEnvFile", "Name of analysis task not given");
758  return ok;
759  }
760  if (!GetAnalysisTask()) {
761  Error("ReadBatchEnvFile", "Analysis task \"%s\"not found for dataset %s",
762  val.Data(), gDataSet->GetName());
763  return ok;
764  }
765  val = GetBatchInfoFile()->GetValue("Runs", "");
766  if (val != "") {
767  SetRuns(val.Data());
768  }
769  else {
770  Error("ReadBatchEnvFile", "List of runs not given");
771  return ok;
772  }
773  val = GetBatchInfoFile()->GetValue("FullRunList", "");
774  if (val != "") {
775  SetFullRunList(val.Data());
776  }
777  ok = kTRUE;
778 
779  return ok;
780 }
781 
782 
783 
785 
787 {
789  KVDataSetAnalyser* t_a = dynamic_cast<KVDataSetAnalyser*>(the_analyser);
790  t_a->SetDataSet(fDataSet);
791  t_a->SetSystem(fSystem);
792  t_a->SetRuns(fRunList, kFALSE);
793 }
794 
795 
796 
802 
804 {
805  // Private method used by ExpandAutoBatchName to build name for current system
806  // to be used in batch job name
807  // Also used by KVDataAnalysisLauncher::SystemBatchName for batch job names
808  // and for writing resources in .KVDataAnalysisGUIrc file
809 
810  KVString tmp = "Unknown";
811  if (!fSystem) return tmp;
812  return fSystem->GetBatchName();
813 }
814 
815 
816 
821 
823 {
824  //Replace any 'special' symbols in "format" with their current values
825  //
826  // $System : name of system to be analysed
827 
829  tmp.ReplaceAll("$System", SystemBatchName());
830  return tmp;
831 }
832 
833 
834 
836 
838 {
840  tmp += ", $System";
841  return tmp;
842 }
843 
844 
845 
848 
850 {
851  // Return pointer to kinematics of analysed system if defined
852  if (fSystem) return fSystem->GetKinematics();
853  Error("GetKinematics", "No system defined for kinematic calculations");
854  return nullptr;
855 }
856 
857 
858 
861 
863 {
864  // Get the run number from the filename
865 
866  KVAvailableRunsFile* arf;
867  arf = GetDataSet()->GetAvailableRunsFile(GetDataType().Data());
868  return arf->IsRunFileName(fileName);
869 }
870 
871 
872 
879 
881 {
882  // Retrieve a KVNameValueList called "JobDescriptionList" from
883  // the TList created with KVDataAnalyser::AddJobDescriptionList(l).
884  // The parameters in the list describe the properties of the
885  // current job. The TList pointer could be, for example, the address of
886  // the TSelector::fInput list used by PROOF.
887 
889  KVNameValueList* jdl = (KVNameValueList*)l->FindObject("JobDescriptionList");
890 
891  jdl->SetValue("DataRepository", gDataRepository->GetName());
892  jdl->SetValue("DataSet", fDataSet->GetName());
893 }
894 
895 
896 
899 
901 {
902  // Returns path to data to be analysed
904 }
905 
906 
int Int_t
unsigned long ULong_t
KVDataRepositoryManager * gDataRepositoryManager
KVDataRepository * gDataRepository
KVDataSetManager * gDataSetManager
KVDataSet * gDataSet
Definition: KVDataSet.cpp:30
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char Char_t
const Bool_t kFALSE
bool Bool_t
const Bool_t kTRUE
kEnvUser
char * Form(const char *fmt,...)
Relativistic binary kinematics calculator.
Definition: KV2Body.h:165
Handles lists of available runs for different datasets and types of data.
Int_t IsRunFileName(const Char_t *filename)
virtual Int_t GetNumber() const
Definition: KVDBRecord.h:72
Description of an experimental run in database ,.
Definition: KVDBRun.h:35
ULong64_t GetEvents() const
Definition: KVDBRun.h:133
KVDBSystem * GetSystem() const
Definition: KVDBRun.cpp:242
const TDatime & GetDatime() const
Definition: KVDBRun.h:113
const Char_t * GetComments() const
Definition: KVDBRun.h:146
Database class used to store information on different colliding systems studied during an experiment.
Definition: KVDBSystem.h:51
Int_t GetNumberRuns()
Definition: KVDBSystem.h:139
Manager class which sets up and runs data analysis tasks.
virtual TString ExpandAutoBatchName(const Char_t *format) const
virtual void PostRunReset()
virtual void Reset()
virtual void AddJobDescriptionList(TList *)
virtual const Char_t * GetRecognisedAutoBatchNameKeywords() const
virtual void set_up_analyser_for_task(KVDataAnalyser *the_analyser)
virtual void WriteBatchEnvFile(const Char_t *, Bool_t sav=kTRUE)
virtual Bool_t ReadBatchEnvFile(const Char_t *)
KVDataRepository * GetRepository(const Char_t *name) 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.
virtual const Char_t * GetRootDirectory() const
returns root directory of data repository (fLocalrootdir)
Pilots user analysis of experimental data.
void WriteBatchEnvFile(const Char_t *jobname, Bool_t save=kTRUE)
virtual Bool_t PreSubmitCheck()
void SetDataSet(KVDataSet *ds)
virtual void ChooseAnalysisTask()
virtual KVNumberList PrintAvailableRuns(KVString &datatype)
virtual void set_up_analyser_for_task(KVDataAnalyser *the_analyser)
void ChooseRuns(KVDBSystem *system=nullptr, const Char_t *data_type="")
void SetRuns(const KVNumberList &nl, Bool_t check=kTRUE)
void ChooseSystem(const Char_t *data_type="")
KVString GetRootDirectoryOfDataToAnalyse() const
Returns path to data to be analysed.
virtual ~KVDataSetAnalyser()
Destructor.
const KV2Body * GetKinematics() const
Return pointer to kinematics of analysed system if defined.
Int_t GetRunNumberFromFileName(const Char_t *)
Get the run number from the filename.
void SetSystem(KVDBSystem *syst)
Set the System used in the analysis.
const Char_t * GetRecognisedAutoBatchNameKeywords() const
virtual void AddJobDescriptionList(TList *)
virtual void set_dataset_name(const Char_t *name)
virtual void set_dataset_pointer(KVDataSet *ds)
virtual void PostRunReset()
Called at end of Run() after execution of analysis task.
void ChooseWhatToAnalyse()
TO IMPLEMENT ?
Bool_t ReadBatchEnvFile(const Char_t *filename)
TString ExpandAutoBatchName(const Char_t *format) const
TString SystemBatchName() const
void ChooseWhatToDo()
TO IMPLEMENT ?
virtual void Print(Option_t *opt="") 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
Manage an experimental dataset corresponding to a given experiment or campaign.
Definition: KVDataSet.h:207
KVDataRepository * GetRepository() const
Get pointer to data repository in which dataset is stored.
Definition: KVDataSet.cpp:1398
virtual KVDataAnalysisTask * GetAnalysisTask(Int_t) const
Definition: KVDataSet.cpp:588
virtual Bool_t IsAvailable() const
Returns kTRUE if this dataset is available for analysis, i.e. if any associated data files are stored...
Definition: KVDataSet.h:282
void cd() const
Definition: KVDataSet.cpp:735
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:83
Bool_t Contains(Int_t val) const
returns kTRUE if the value 'val' is contained in the ranges defined by the number list
Int_t First() const
Returns smallest number included in list.
const Char_t * AsString(Int_t maxchars=0) const
Bool_t End(void) const
Definition: KVNumberList.h:196
void Begin(void) const
Bool_t IsEmpty() const
Definition: KVNumberList.h:173
Int_t Next(void) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
const char * AsString() const
virtual const char * GetName() const
Int_t Atoi() const
Bool_t IsDigit() const
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
RooCmdArg BatchMode(bool flag=true)
BinData::ErrorType GetDataType(const TGraph *gr, DataOptions &fitOpt)
void Info(const char *location, const char *va_(fmt),...)
void Error(const char *location, const char *va_(fmt),...)
void Warning(const char *location, const char *va_(fmt),...)
auto * l