9#include "KVDataSetManager.h"
10#include "KVDataRepositoryManager.h"
22#define CHMODE(u,g,o) ((u << 6) + (g << 3) + o)
108 if (!dr) gDataSetManager =
this;
134 TIter next_name(toks);
136 while ((group_name = (
TObjString*) next_name())) {
197 task_list.
Begin(
" ");
198 while (!task_list.
End()) {
235 cout <<
" *** No available datasets ***" <<
242 cout <<
"\t" << i <<
". " << ds->
GetTitle() << endl;
329 tmp_file << ds->
GetName() <<
" : ";
437 TString Username = strcmp(username,
518 Info(
"ReadAvailableDataSetsFile",
537 for (
int i = 1; i < toks->
GetEntries(); i++) {
592 Info(
"KVDataSetManager::CheckCacheStatus",
"Checking for available datasets cache file...");
601 Info(
"KVDataSetManager::CheckCacheStatus",
"...file found. It is %u seconds old", file_age);
603 Info(
"KVDataSetManager::CheckCacheStatus",
"Using cached file");
607 Info(
"KVDataSetManager::CheckCacheStatus",
"File is too old (max time=%u). Update will be performed.",
fMaxCacheTime);
610 Info(
"KVDataSetManager::CheckCacheStatus",
"...no file found");
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
static void OpenTempFile(TString &base, std::ofstream &fp)
static const Char_t * GetWORKDIRFilePath(const Char_t *namefile="")
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
static Bool_t SearchAndOpenKVFile(const Char_t *name, KVSQLite::database &dbfile, const Char_t *kvsubdir="")
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)
virtual void SetUserBaseClass(const Char_t *d)
virtual void SetWithUserClass(Bool_t w=kTRUE)
Base class for managing repositories of experimental data.
virtual Bool_t IsRemote() const
Returns kTRUE for remote repositories, kFALSE for local repositories.
virtual void PrintAvailableDatasetsUpdateWarning() const
Manage all datasets contained in a given data repository.
TString fCacheFileName
name of cache file ( = [repository name].available.datasets)
KVUniqueNameList fDataSets
list of datasets handled by manager
virtual void Print(Option_t *opt="") const
KVNameValueList fUserGroups
list of user groups
virtual void ReadUserGroups()
virtual Int_t GetNavailable() const
Bool_t fCacheAvailable
kTRUE if caching is activated for parent repository
KVDataRepository * fRepository
the repository for which data sets are handled
virtual ~KVDataSetManager()
Int_t fNavailable
number of available datasets
virtual Bool_t ReadDataSetList()
virtual Bool_t Init(KVDataRepository *=0)
KVDataAnalysisTask * GetAnalysisTaskAny(const Char_t *keywords) const
virtual Bool_t OpenAvailableDatasetsFile()
virtual Bool_t CheckCacheStatus()
const KVSeqCollection * GetAnalysisTaskList() const
virtual Bool_t ReadAvailableDatasetsFile()
virtual Bool_t CheckUser(const Char_t *groupname, const Char_t *username="")
virtual KVDataAnalysisTask * GetTask(const Char_t *name)
Return pointer to named data analysis task.
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
virtual KVDataSet * NewDataSet()
Creates and returns pointer to new data set object.
virtual Bool_t ReadTaskList()
KVUniqueNameList fTasks
list of all known analysis tasks
virtual void CheckAvailability()
virtual KVDataSet * GetAvailableDataSet(Int_t) const
std::vector< Int_t > fIndex
array of indices of available datasets
std::ifstream fDatasets
for reading cached repository available datasets file
UInt_t fMaxCacheTime
maximum allowed age of cache file in seconds
Manage an experimental dataset corresponding to a given experiment or campaign.
virtual void SetUserGroups(const Char_t *groups)
virtual void SetDataPathSubdir(const Char_t *s)
virtual void ls(Option_t *opt="") const
Print dataset information.
virtual void AddAvailableDataType(const Char_t *)
void SetName(const char *name)
virtual void SetAnalysisTasks(const KVSeqCollection *)
virtual void CheckAvailable()
virtual const Char_t * GetAvailableDataTypes() const
virtual Bool_t IsAvailable() const
Returns kTRUE if this dataset is available for analysis, i.e. if any associated data files are stored...
virtual void SetAvailable(Bool_t yes=kTRUE)
virtual Bool_t CheckUserCanAccess()
void SetRepository(KVDataRepository *)
Set pointer to data repository in which dataset is stored.
void SetValue(const Char_t *name, value_type value)
virtual void Clear(Option_t *opt="")
Bool_t HasParameter(const Char_t *name) const
TString GetTStringValue(const Char_t *name) const
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Clear(Option_t *option="")
virtual Int_t GetSize() const
virtual TObject * FindObjectAny(const Char_t *att, const Char_t *keys, Bool_t contains_all=kFALSE, Bool_t case_sensitive=kTRUE) const
virtual TObject * FindObjectByName(const Char_t *name) const
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
virtual void Add(TObject *obj)
UInt_t Convert(Bool_t toGMT=kFALSE) const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetTitle(const char *title="")
const char * GetName() const override
const char * GetTitle() const override
virtual void SetName(const char *name)
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
const TString & GetString() const
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual int Chmod(const char *file, UInt_t mode)
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
virtual int GetPathInfo(const char *path, FileStat_t &buf)
virtual UserGroup_t * GetUserInfo(const char *user=nullptr)
virtual int Unlink(const char *name)