8 #include "TMethodCall.h"
10 #include "KVDataRepository.h"
11 #include "KVDataRepositoryManager.h"
12 #include "KVDataSetManager.h"
14 #include "TObjArray.h"
15 #include "TObjString.h"
16 #include "KVDBSystem.h"
19 #include "KVAvailableRunsFile.h"
20 #include "KVNumberList.h"
21 #include "TPluginManager.h"
23 #include "KVRunFile.h"
38 fRepository =
nullptr;
40 fAllTasks.SetOwner(kTRUE);
41 fTasks.SetOwner(kFALSE);
55 if (!fRepository)
return nullptr;
59 avrf = fRepository->NewAvailableRunsFile(type,
this);
60 fAvailableRuns.
Add(avrf);
78 if (fDBFileName !=
"")
79 return fDBFileName.Data();
80 return gEnv->GetValue(
"DataSet.DatabaseFile",
"");
95 return fDBName.Data();
109 TDirectory* work_dir = gDirectory;
110 fDBase.reset(
new TFile(full_path_to_dbfile,
"READ"));
112 if (fDBase->IsOpen()) {
113 fDataBase =
dynamic_cast<KVExpDB*
>(fDBase->Get(GetDBName()));
115 Error(
"OpenDBFile",
"%s not found in file %s", GetDBName(),
119 fDataBase->ReadObjects(fDBase.get());
135 TString dbfile = GetDBFileName();
136 static TString dbfile_fullpath;
142 TString dataset_alias = GetDataSetEnv(
"DataSet.Directory", GetName());
143 TString db_alias = GetName();
144 if (!gSystem->IsAbsoluteFileName(dataset_alias)) db_alias = dataset_alias;
146 AssignAndDelete(tmp, gSystem->ConcatFileName(GetDATABASEFilePath(), db_alias.Data()));
147 AssignAndDelete(dbfile_fullpath, gSystem->ConcatFileName(tmp.Data(), dbfile.Data()));
148 return dbfile_fullpath.Data();
166 KVString envar = GetDataSetEnv(Form(
"%s.DataAnalysisTask.Title", t->GetName()));
167 if (envar !=
"") t->SetTitle(envar);
168 envar = GetDataSetEnv(Form(
"%s.DataAnalysisTask.Analyser", t->GetName()));
170 envar = GetDataSetEnv(Form(
"%s.DataAnalysisTask.UserClass.Base", t->GetName()));
172 envar = GetDataSetEnv(Form(
"%s.DataAnalysisTask.Prereq", t->GetName()));
174 envar = GetDataSetEnv(Form(
"%s.DataAnalysisTask.UserClass.ExtraACliCIncludes", t->GetName()));
176 Int_t nev = (Int_t)GetDataSetEnv(Form(
"%s.DataAnalysisTask.StatusUpdateInterval", t->GetName()), 0.0);
206 TString dbfile_fullpath = GetFullPathToDB();
207 TString tmp = gSystem->DirName(dbfile_fullpath.Data());
209 if (gSystem->AccessPathName(tmp.Data())) {
211 if (gSystem->mkdir(tmp.Data()) == -1) {
213 TString tmp2 = gSystem->DirName(tmp.Data());
215 if (gSystem->AccessPathName(tmp2.Data())) {
217 if (gSystem->mkdir(tmp2.Data()) == -1) {
218 Error(
"SaveDataBase",
"Cannot create directory %s required to save database",
222 gSystem->Chmod(tmp2.Data(), 0775);
225 Error(
"SaveDataBase",
"Cannot create directory %s required to save database, even though %s exists: check disk space ?",
226 tmp.Data(), tmp2.Data());
230 if (gSystem->mkdir(tmp.Data()) == -1) {
231 Error(
"SaveDataBase",
"Cannot create directory %s required to save database",
236 gSystem->Chmod(tmp.Data(), 0775);
240 gSystem->Chmod(tmp.Data(), 0775);
244 WriteDBFile(dbfile_fullpath.Data());
261 TDirectory* work_dir = gDirectory;
263 Error(
"WriteDBFile",
"Database has not been built");
266 fDBase.reset(
new TFile(full_path_to_dbfile,
"recreate"));
268 fDataBase->Write(GetDBName());
269 fDataBase->WriteObjects(fDBase.get());
272 gSystem->Chmod(full_path_to_dbfile, 0664);
303 if (_opt ==
"UPDATE") {
304 OpenDataBase(_opt.Data());
357 Bool_t is_glob_db = kFALSE;
359 if ((!strcmp(opt,
"UPDATE")) || DataBaseNeedsUpdate()) {
362 Info(
"OpenDataBase",
"Updating database file");
363 fDataBaseUpdateInProgress =
true;
364 is_glob_db = (fDataBase == gExpDB);
374 Info(
"OpenDataBase",
"No database defined for dataset");
378 if (fDataBase && is_glob_db) fDataBase->cd();
379 fDataBaseUpdateInProgress =
false;
381 else if (!fDataBase) {
386 if (!LoadPlugin(
"KVExpDB", GetDBName())) {
387 Error(
"GetDataBase",
"Cannot load required plugin library");
391 TString dbfile_fullpath = GetFullPathToDB();
393 OpenDBFile(dbfile_fullpath.Data());
406 cout <<
"Dataset name=" << GetName() <<
" (" << GetTitle() <<
")";
408 cout <<
" [ AVAILABLE: ";
409 cout << fDatatypes.Data();
413 cout <<
" [UNAVAILABLE]";
432 if (Sopt.Contains(
"TASK")) {
434 cout <<
" *** No available analysis tasks ***"
439 for (
int i = 1; i <= GetNtasks(); i++) {
441 cout <<
"\t" << i <<
". " << dat->GetTitle() << endl;
446 else if (Sopt.Contains(
"DATA")) {
447 cout <<
"Available data types: " << fDatatypes.Data() << endl;
498 SetAvailable(fRepository->CheckSubdirExists(GetDataPathSubdir()));
502 KVString data_types = GetDataSetEnv(
"KVDataSet.DataTypes",
"");
503 if (data_types ==
"") {
504 Warning(
"CheckAvailable",
"No datatypes defined for this dataset: %s\nCheck value of KVDataSet.DataTypes or %s.KVDataSet.DataTypes",
505 GetName(), GetName());
506 SetAvailable(kFALSE);
510 data_types.
Begin(
" ");
511 while (!data_types.
End()) {
514 (fRepository && fRepository->CheckSubdirExists(GetDataPathSubdir(), GetDataTypeSubdir(type.Data())))
516 AddAvailableDataType(type.Data());
520 SetAvailable(fDatatypes !=
"");
522 if (!CheckUserCanAccess()) {
523 SetAvailable(kFALSE);
534 if (fDatatypes !=
"") fDatatypes +=
" ";
536 _type.Remove(TString::kBoth,
' ');
557 TString availables = gEnv->GetValue(Form(
"%s.DataAnalysisTask", GetName()),
"");
560 TIter nxt(task_list);
564 if (availables ==
"" || availables.Contains(dat->GetName())) {
567 SetDataSetSpecificTaskParameters(new_task);
568 fAllTasks.Add(new_task);
570 if (HasDataType(new_task->
GetPrereq())) {
571 fTasks.Add(new_task);
588 return fTasks.GetSize();
639 if (!GetAvailableRunsFile(datatype)) {
640 Error(
"GetListOfAvailableSystems(const Char_t*)",
641 "No available runs file for type %s", datatype);
644 return GetAvailableRunsFile(datatype)->GetListOfAvailableSystems(systol);
678 return GetListOfAvailableSystems(datan->
GetPrereq(), systol);
711 TNamed::SetName(name);
712 TString path = GetDataSetEnv(
"DataSet.Directory", name);
713 if (gSystem->IsAbsoluteFileName(path)) fCalibDir = path;
717 fCalibDir = GetDATADIRFilePath(path);
733 return fCalibDir.Data();
754 if (fRepository) fRepository->
cd();
872 if (!strcmp(type,
"raw") && !strcmp(GetDataSetEnv(
"MFM.WithEbyedat",
""),
"yes")) {
873 TString ebydir = GetDataSetDir();
874 ebydir +=
"/ebyedat";
875 gEnv->SetValue(
"KVMFMDataFileReader.ActionsDirectory", ebydir);
876 if (strcmp(GetDataSetEnv(
"MFM.EbyedatActionsExpName",
""),
""))
877 gEnv->SetValue(
"KVMFMDataFileReader.ActionsExpName", GetDataSetEnv(
"MFM.EbyedatActionsExpName",
""));
878 TObject* f = GetRepository()->OpenDataSetRunFile(
this, type, run, GetName());
880 gEnv->SetValue(
"KVMFMDataFileReader.ActionsDirectory",
"");
881 gEnv->SetValue(
"KVMFMDataFileReader.ActionsExpName",
"");
884 return GetRepository()->OpenDataSetRunFile(
this, type, run, GetName());
907 if (fRepository) file = GetRunfileName(type, run);
910 return fRepository->GetFullPathToOpenFile(
this, type, file.Data());
931 if (!HasDataType(type)) {
932 Error(
"GetRunfileName",
933 "No data of type \"%s\" available for dataset %s", type,
938 return GetAvailableRunsFile(type)->GetFileName(run);
960 date.Set(1995, 1, 1, 0, 0, 0);
962 if (!HasDataType(type)) {
963 Error(
"GetRunfileDate",
964 "No data of type \"%s\" available for dataset %s", type,
970 if (!GetAvailableRunsFile(type)->GetRunInfo(run, date, filename)) {
971 Error(
"GetRunfileDate",
972 "Runfile not found for run %d (data type: %s)", run, type);
991 if (!HasDataType(type)) {
992 Error(
"CheckRunfileAvailable",
993 "No data of type \"%s\" available for dataset %s", type,
997 return GetAvailableRunsFile(type)->CheckAvailable(run);
1026 TString fmt = GetDataSetEnv(Form(
"DataSet.RunFileName.%s", type));
1027 TString run_num(Form(
"%d", run));
1029 TString date(now.AsSQLString());
1031 tmp.ReplaceAll(
"%R", run_num);
1032 if (fmt.Contains(
"%D")) {
1033 tmp.ReplaceAll(
"%D", date);
1050 if (!HasDataType(type)) {
1051 Error(
"UpdateAvailableRuns",
1052 "No data of type \"%s\" available for dataset %s", type,
1073 if (!fRepository)
return nullptr;
1074 TString tmp = GetBaseFileName(type, run);
1076 tmp.ReplaceAll(
" ",
"_");
1077 return fRepository->CreateNewFile(
this, type, tmp.Data());
1102 if (!fRepository)
return;
1105 TString filename = GetAvailableRunsFile(type)->GetFileName(run);
1106 if (filename ==
"") {
1107 Error(
"DeleteRunfile",
"Run %d of type %s does not exist.", run, type);
1112 KVString doNotDelete = GetDataSetEnv(
"DataSet.RunFile.DoNotDelete",
"all");
1113 if (doNotDelete ==
"all" || doNotDelete.Contains(type)) {
1114 Error(
"DeleteRunFile",
"%s files cannot be deleted", type);
1117 fRepository->DeleteFile(
this, type, filename.Data(), confirm);
1119 if (!fRepository->CheckFileStatus(
this, type, filename.Data()))
1120 GetAvailableRunsFile(type)->Remove(run);
1147 if (nl.
IsEmpty()) nl = GetRunList(type);
1151 DeleteRunfile(type, nl.
Next(), confirm);
1173 if (!min && !max)
return 0;
1175 if (min) printf(
"date minimum %s\n", min->AsString());
1176 if (max) printf(
"date maximum %s\n", max->AsString());
1180 unique_ptr<TList> ll(GetListOfAvailableSystems(type));
1183 unique_ptr<TList> lrun;
1184 for (Int_t nl = 0; nl < ll->GetEntries(); nl += 1) {
1186 lrun.reset(GetListOfAvailableSystems(type, sys));
1188 for (Int_t nr = 0; nr < lrun->GetEntries(); nr += 1) {
1192 if (*min < run->GetRun()->GetDatime() && run->
GetRun()->
GetDatime() < *max) {
1197 if (*min < run->GetRun()->GetDatime()) {
1208 if (numb.
GetEntries() > oldList.
GetEntries()) printf(
"%s : %s\n", sys->GetName(), (numb - oldList).AsString());
1231 TList* ll = GetListOfAvailableSystems(ref_type);
1232 if (!ll || !ll->GetEntries()) {
1234 Info(
"GetRunList_StageSelection",
"No data available of type \"%s\"", ref_type);
1238 if (system && !ll->FindObject(system)) {
1239 Info(
"GetRunList_StageSelection",
"No data available of type \"%s\" for system %s", ref_type, system->GetName());
1244 Info(
"GetRunList_StageSelection",
"Liste des runs presents dans \"%s\" mais absent dans \"%s\"", ref_type, type);
1250 for (Int_t nl = 0; nl < ll->GetEntries(); nl += 1) {
1253 if (system && sys != system)
continue;
1255 nsys = GetRunList(type, sys);
1256 nsys_ref = GetRunList(ref_type, sys);
1261 Info(
"GetRunList_StageSelection",
"\nKVDBSystem : %s --> %d runs manquants sur %d : %s",
1267 manquant.
Add(nsys_ref);
1287 unique_ptr<TList> lrun(GetListOfAvailableSystems(type, sys));
1288 TIter next(lrun.get());
1295 unique_ptr<TList> ll(GetListOfAvailableSystems(type));
1296 if (!ll.get() || !ll->GetEntries()) {
1298 Info(
"GetRunList_VersionSelection",
"No data available of type \"%s\"", type);
1302 for (Int_t nl = 0; nl < nsys; nl += 1) {
1304 unique_ptr<TList> lrun(GetListOfAvailableSystems(type, sys));
1305 TIter next(lrun.get());
1327 if (!fRepository)
return;
1330 TString newfile = gSystem->BaseName(file->GetName());
1332 fRepository->CommitFile(file, type,
this);
1341 TString oldfile = GetAvailableRunsFile(type)->GetFileName(run);
1342 if (oldfile !=
"" && oldfile != newfile) {
1344 fRepository->DeleteFile(
this, type, oldfile.Data(),
1347 if (!fRepository->CheckFileStatus(
this, type, oldfile.Data()))
1348 GetAvailableRunsFile(type)->Remove(run);
1350 if (oldfile != newfile) {
1352 GetAvailableRunsFile(type)->Add(run, newfile.Data());
1372 if (fUserGroups ==
"")
1376 unique_ptr<TObjArray> toks(fUserGroups.Tokenize(
' '));
1377 TObjString* group_name;
1378 TIter next_name(toks.get());
1379 while ((group_name = (TObjString*) next_name())) {
1381 if (!fRepository || (fRepository && fRepository->GetDataSetManager()->
1382 CheckUser(group_name->String().Data()))
1429 GetAvailableRunsFile(data_type)->CheckMultiRunfiles();
1431 cout <<
"OK. No runs appear more than once." << endl;
1434 cout <<
"Runs which appear more than once: " << doubles.
1435 AsString() << endl << endl;
1440 while (!doubles.
End()) {
1442 Int_t rr = doubles.
Next();
1445 GetAvailableRunsFile(data_type)->GetRunInfos(rr, &dates, &filenames);
1447 cout <<
"Run " << rr <<
" : " << dates.
1448 GetEntries() <<
" files >>>>>>" << endl;
1449 for (
int i = 0; i < dates.GetEntries(); i++) {
1451 cout <<
"\t" << ((TObjString*) filenames.
At(i))->String().
1452 Data() <<
"\t" << ((TObjString*) dates.
At(i))->String().
1482 if (!fRepository)
return;
1487 cout <<
"OK. No runs appear more than once." << endl;
1490 cout <<
"Runs which appear more than once: " << doubles.
1491 AsString() << endl << endl;
1496 while (!doubles.
End()) {
1498 Int_t rr = doubles.
Next();
1503 TDatime most_recent(
"1998-12-25 00:00:00");
1504 Int_t i_most_recent = 0;
1505 cout <<
"Run " << rr <<
" : " << dates.
1506 GetEntries() <<
" files >>>>>>" << endl;
1507 for (
int i = 0; i < dates.GetEntries(); i++) {
1510 TDatime rundate(((TObjString*) dates.
At(i))->String().Data());
1511 if (rundate > most_recent) {
1513 most_recent = rundate;
1520 for (
int i = 0; i < dates.GetEntries(); i++) {
1522 if (i == i_most_recent) {
1526 cout <<
"DELETE : ";
1528 cout <<
"\t" << ((TObjString*) filenames.
At(i))->String().
1529 Data() <<
"\t" << ((TObjString*) dates.
At(i))->String().
1531 if (i != i_most_recent) {
1533 fRepository->DeleteFile(
this, data_type,
1534 ((TObjString*) filenames.
At(i))->
1535 String().Data(), confirm);
1538 ((TObjString*) filenames.
At(i))->String().
1568 Error(
"CheckRunfileUpToDate",
1569 "Dataset \"%s\" not found in repository \"%s\"", GetName(),
1570 other_repos->GetName());
1574 if (GetRunfileDate(data_type, run) < ds->
GetRunfileDate(data_type, run))
1590 const Char_t* other_repos)
1601 return CheckRunfileUpToDate(data_type, run, _or);
1602 Error(
"CheckRunfileUpToDate",
1603 "No data repository known with this name : %s", other_repos);
1615 const Char_t* other_repos)
1620 if (!fRepository)
return;
1625 Error(
"CheckUpToDate",
1626 "No data repository known with this name : %s", other_repos);
1629 KVNumberList runlist = GetAvailableRunsFile(data_type)->GetRunList();
1631 Int_t need_update = 0;
1632 while (!runlist.
End()) {
1634 Int_t rr = runlist.
Next();
1635 if (!CheckRunfileUpToDate(data_type, rr, _or)) {
1636 cout <<
" *** run " << rr <<
" needs update ***" <<
1638 cout <<
"\t\tREPOSITORY: " << fRepository->
1639 GetName() <<
"\tDATE: " << GetRunfileDate(data_type,
1642 cout <<
"\t\tREPOSITORY: " << other_repos <<
"\tDATE: " << _or->
1643 GetDataSetManager()->GetDataSet(GetName())->
1644 GetRunfileDate(data_type,
1645 rr).AsString() << endl;
1650 cout <<
" *** All runfiles are up to date for data type " <<
1663 const Char_t* other_repos)
1669 if (!fRepository)
return updates;
1674 Error(
"CheckUpToDate",
1675 "No data repository known with this name : %s", other_repos);
1678 KVNumberList runlist = GetAvailableRunsFile(data_type)->GetRunList();
1680 while (!runlist.
End()) {
1682 Int_t rr = runlist.
Next();
1683 if (!CheckRunfileUpToDate(data_type, rr, _or)) {
1706 if (!fRepository || !HasDataType(data_type)) {
1708 "No data of type %s available. Runlist will be empty.",
1712 list = GetAvailableRunsFile(data_type)->GetRunList(system);
1817 if (!_task.Contains(
"nalysis")) _task +=
" analysis";
1820 auto dat = GetAnalysisTaskAny(_task.Data());
1822 Error(
"MakeAnalysisClass",
1823 "called for unknown or unavailable analysis task : %s", _task.Data());
1826 if (!dat->WithUserClass()) {
1827 Error(
"MakeAnalysisClass",
1828 "no user analysis class for analysis task : %s", dat->GetTitle());
1835 TClass* cl =
nullptr;
1837 if (dat->CheckUserBaseClassIsLoaded()) cl = TClass::GetClass(dat->GetUserBaseClass());
1842 unique_ptr<TMethodCall> methcall(
new TMethodCall(cl,
"Make", Form(
"\"%s\"", classname)));
1844 if (!methcall->IsValid()) {
1845 Error(
"MakeAnalysisClass",
"static Make(const Char_t*) method for class %s is not valid",
1851 methcall->Execute();
1866 return OpenDataSetFile(GetName(), filename, file);
1881 if (gSystem->IsAbsoluteFileName(datasetdir)) {
1885 abspath.Form(
"%s/%s", datasetdir.Data(), filename);
1886 return SearchAndOpenKVFile(abspath, file);
1889 return SearchAndOpenKVFile(filename, file, datasetdir);
1903 return GetFullPathToDataSetFile(GetName(), filename);
1919 if (!SearchKVFile(filename, fullpath, datasetdir)) {
1920 ::Warning(
"KVDataSet::GetFullPathToDataSetFile",
"File %s not found in dataset subdirectory %s", filename, datasetdir.Data());
1939 return SearchKVFile(filename, fullpath, datasetdir);
1953 return FindDataSetFile(GetName(), filename);
1980 Error(
"GetAnalysisTaskAny",
"No task found with the following keywords in its title : %s", keywords);
2001 TString pwd = gSystem->pwd();
2004 if (!SearchKVFile(GetDataSetDir(), path)) {
2006 Info(
"DataBaseNeedsUpdate",
"%s: Creating new dataset directory %s",
2007 GetName(), GetDataSetDir());
2008 if (gSystem->mkdir(GetDataSetDir())) {
2010 Error(
"DataBaseNeedsUpdate",
2011 "%s: Dataset directory %s does not exist and cannot be created ?",
2012 GetName(), GetDataSetDir());
2016 SearchKVFile(GetDataSetDir(), path);
2018 TString filename = path +
"Makefile";
2019 ofstream of1(filename.Data());
2020 of1 <<
"$(KV_WORK_DIR)/db/" << GetName() <<
"/DataBase.root : Runlist.csv Systems.dat" << endl;
2021 of1 <<
"\t@echo Database needs update" << endl;
2023 filename = path +
"Runlist.csv";
2024 ofstream of2(filename.Data());
2025 of2 <<
"# Automatically generated dummy Runlist.csv file" << endl;
2027 filename = path +
"Systems.dat";
2028 ofstream of3(filename.Data());
2029 of3 <<
"# Automatically generated dummy Systems.dat file" << endl;
2032 gSystem->cd(GetDataSetDir());
2033 TString cmd =
"make -q";
2034 Int_t ret = gSystem->Exec(cmd.Data());
2035 gSystem->cd(pwd.Data());
2076 if (gEnv->Defined(Form(
"%s.DataRepository.DefaultOutputRepository", GetRepository()->GetName())))
2077 return TString(gEnv->GetValue(Form(
"%s.DataRepository.DefaultOutputRepository", GetRepository()->GetName()),
""));
2078 TString orep = GetDataSetEnv(Form(
"%s.DataAnalysisTask.OutputRepository", taskname), GetRepository()->GetName());
2096 while (!runs.
End()) {
2097 int run = runs.
Next();
2098 TString filename = GetRunfileName(type, run);
2100 AssignAndDelete(destpath, gSystem->ConcatFileName(destdir, filename));
2123 Error(
"CopyRunfilesToRepository",
"Unknown destination repository : %s", destrepo);
2124 gDataRepositoryManager->
Print();
2131 while (!runs.
End()) {
2132 int run = runs.
Next();
2133 TString filename = GetRunfileName(type, run);
Handles lists of available runs for different datasets and types of data.
Bool_t FileExists() const
virtual void Add(Int_t run, const Char_t *filename)
KVNumberList CheckMultiRunfiles()
Returns a list with all runs which occur more than once in the available runs file.
virtual void Update(Bool_t no_existing_file=kFALSE)
virtual void Remove(Int_t run, const Char_t *filename="")
virtual void GetRunInfos(Int_t run, KVList *dates, KVList *names)
static const Char_t * GetDataSetEnv(const Char_t *dataset, const Char_t *type, const Char_t *defval)
const TDatime & GetDatime() const
Database class used to store information on different colliding systems studied during an experiment....
Bool_t IsCollision() const
retourne kTRUE, si le systeme est une collision ie projectile+cible
Define and manage data analysis tasks.
virtual void SetDataAnalyser(const Char_t *d)
virtual void SetPrereq(const Char_t *p)
virtual void SetStatusUpdateInterval(Long64_t n)
void SetExtraAClicIncludes(const KVString &list)
virtual const Char_t * GetPrereq() const
virtual void SetUserBaseClass(const Char_t *d)
KVDataRepository * GetRepository(const Char_t *name) const
void Print(Option_t *opt="") const
Base class for managing repositories of experimental data.
virtual KVDataSetManager * GetDataSetManager() const
Return pointer to data set manager for this repository.
virtual void CopyFileFromRepository(const KVDataSet *dataset, const Char_t *datatype, const Char_t *filename, const Char_t *destination)
void CreateAllNeededSubdirectories(const KVDataSet *DataSet, const Char_t *DataType)
virtual const Char_t * GetFullPathToTransferFile(const KVDataSet *dataset, const Char_t *datatype, const Char_t *runfile)
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
Manage an experimental dataset corresponding to a given experiment or campaign.
TString GetOutputRepository(const Char_t *taskname) const
virtual void OpenDBFile(const Char_t *full_path_to_dbfile) const
Open the database from a file on disk.
KVNumberList GetRunList_VersionSelection(const Char_t *type, const Char_t *version, KVDBSystem *sys=0)
void CheckMultiRunfiles(const Char_t *data_type)
KVNumberList GetRunList_StageSelection(const Char_t *other_type, const Char_t *base_type, KVDBSystem *sys=0, Bool_t OnlyCol=kFALSE)
void CheckUpToDate(const Char_t *data_type, const Char_t *other_repos)
const Char_t * GetDBName() const
KVDataRepository * GetRepository() const
Get pointer to data repository in which dataset is stored.
void CopyRunfilesToRepository(const Char_t *type, KVNumberList runs, const Char_t *destrepo)
const Char_t * GetDBFileName() const
const Char_t * GetDataSetDir() const
void DeleteRunfiles(const Char_t *type, KVNumberList lrun="", Bool_t confirm=kTRUE)
KVNumberList GetUpdatableRuns(const Char_t *data_type, const Char_t *other_repos)
virtual void ls(Option_t *opt="") const
Print dataset information.
void DeleteRunfile(const Char_t *type, Int_t run, Bool_t confirm=kTRUE)
KVAvailableRunsFile * GetAvailableRunsFile(const Char_t *type) const
virtual void AddAvailableDataType(const Char_t *)
virtual TList * GetListOfAvailableSystems(const Char_t *datatype, KVDBSystem *systol=0)
Bool_t CheckRunfileUpToDate(const Char_t *data_type, Int_t run, KVDataRepository *other_repos)
void SetName(const char *name)
KVDataAnalysisTask * GetAnalysisTask(Int_t) const
virtual const Char_t * GetBaseFileName(const Char_t *type, Int_t run) const
virtual void SaveDataBase() const
virtual KVDataAnalysisTask * GetAnalysisTaskAny(const Char_t *keywords) const
virtual void SetAnalysisTasks(const KVSeqCollection *)
KVNumberList GetRunList_DateSelection(const Char_t *type, TDatime *min=0, TDatime *max=0)
virtual void CheckAvailable()
const Char_t * GetRunfileName(const Char_t *type, Int_t run) const
TDatime GetRunfileDate(const Char_t *type, Int_t run)
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
virtual Int_t GetNtasks() const
KVNumberList GetRunList(const Char_t *data_type, const KVDBSystem *sys=0) const
TString GetFullPathToDataSetFile(const Char_t *filename)
TString GetFullPathToRunfile(const Char_t *type, Int_t run) const
void CopyRunfilesFromRepository(const Char_t *type, KVNumberList runs, const Char_t *destdir)
void UpdateAvailableRuns(const Char_t *type)
virtual void MakeAnalysisClass(const Char_t *task, const Char_t *classname)
TObject * open_runfile(const Char_t *type, Int_t run)
void CommitRunfile(const Char_t *type, Int_t run, TFile *file)
KVExpDB * GetDataBase(Option_t *opt="") const
virtual Bool_t DataBaseNeedsUpdate() const
Bool_t OpenDataSetFile(const Char_t *filename, std::ifstream &file)
void SetDataSetSpecificTaskParameters(KVDataAnalysisTask *) const
virtual void WriteDBFile(const Char_t *full_path_to_dbfile) const
const Char_t * GetFullPathToDB() const
Returns full path to file where database is written on disk.
TFile * NewRunfile(const Char_t *type, Int_t run)
virtual Bool_t CheckUserCanAccess()
void SetRepository(KVDataRepository *)
Set pointer to data repository in which dataset is stored.
KVDataSet()
Default constructor.
void CleanMultiRunfiles(const Char_t *data_type, Bool_t confirm=kTRUE)
virtual void OpenDataBase(Option_t *opt="") const
virtual void Print(Option_t *opt="") const
static Bool_t FindDataSetFile(const TString &dataset, const Char_t *filename)
Bool_t CheckRunfileAvailable(const Char_t *type, Int_t run)
Extension of TDatime to handle various useful date formats.
Base class to describe database of an experiment ,,.
static KVExpDB * MakeDataBase(const Char_t *name, const Char_t *datasetdir)
Extended TList class which owns its objects by default.
Strings used to represent a set of ranges of values.
const Char_t * AsString(Int_t maxchars=0) const
void Remove(Int_t)
Remove value 'n' from the list.
void Add(Int_t)
Add value 'n' to the list.
Description of an individual run file in an experimental dataset.
Int_t GetRunNumber() const
const Char_t * GetVersion() const
const KVDBRun * GetRun() const
KaliVeda extensions to ROOT collection classes.
virtual TObject * At(Int_t idx) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const