KaliVeda
1.13/01
Heavy-Ion Analysis Toolkit
|
Manage an experimental dataset corresponding to a given experiment or campaign.
A dataset brings together all the elements necessary for the analysis of data taken during an experiment or campaign of experiments using the same experimental configuration. These are:
Different datasets are listed in the configuration file $KVROOT/KVFiles/.kvrootrc. This file is read by KVDataSetManager::Init(), which sets up and handles all the datasets for a given data repository (see KVDataRepository). The syntax for adding a dataset to this list is described in the file.
After creation, the availability of this dataset for analysis is decided based on whether data files associated with it are present or not in the data repository, and, optionally, whether the user's name appears in the associated user group (see KVDataSet::CheckAvailable()). Datasets which are available for analysis by the user have IsAvailable()==kTRUE.
All possible data analysis tasks for this dataset are then determined based on the available types of data in the repository (see SetAnalysisTasks()) and the default list of known analysis tasks (see KVDataSetManager::ReadTaskList()). Data analysis tasks can be chosen & performed for any available dataset by using a KVDataAnalyser.
The experimental set-up for each dataset is handled by a child class of KVMultiDetArray, which can describe anything from a single detector to a 4π (pi)-multidetector of charged particles such as INDRA. Each dataset is uniquely associated to its experimental set-up by defining a plugin of the KVMultiDetArray class:
+Plugin.KVMultiDetArray: name_of_dataset name_of_class name_of_plugin_library constructor_to_call
See file $KVROOT/KVFiles/.kvrootrc for examples concerning the default datasets. There you will also see that the multidetector class can be further "tweaked" by defining dataset-dependent plugins for the KVIDTelescope class (see KVMultiDetArray::GetIDTelescopes).
The experimental set-up for the dataset can be created when necessary by using KVDataSet::BuildMultiDetector().
A child class of KVDataBase handles all stored information on the different experimental runs, reaction systems studied, run-dependent detector characteristics, calibration parameters, etc. The link between dataset and database is defined by a plugin:
+Plugin.KVDataBase: name_of_dataset name_of_class name_of_plugin_library constructor_to_call
See file $KVROOT/KVFiles/.kvrootrc for examples concerning the default datasets.
Such databases are constructed from a number of different source files (runlist, system list, etc.) which are kept in the directory $KVROOT/KVFiles/name_of_dataset (string returned by GetDataSetDir()). The database object, once constructed from these files (see KVDataBase::Build()), is saved in a ROOT file in the same directory. The default name for this file is given by the environment variable
DataSet.DatabaseFile: DataBase.root
in $KVROOT/KVFiles/.kvrootrc. There you will also see examples of definitions of dataset-specific source file names and formats.
To acces the database associated with the dataset, use GetDataBase().
All files of experimental data belonging to this dataset are kept under the data_repository_subdirectory defined in the configuration of the dataset. The name of this directory is returned by GetDatapathSubdir(). There are four different types of data, each of which is kept in a different subdirectory of the dataset's repository directory:
It should be noted that the last 3 types of data are obligatorily stored in TTrees written in ROOT files. They also have exactly the same structure, i.e. they are constituted of events containing one or more particles. The algorithm for reconstructing raw data, i.e. for creating recon files from raw files, is described in KVReconstructedEvent::ReconstructEvent. Both this process, and also recon→ident, ident→root are among the data analysis tasks predefined (for INDRA data) in $KVROOT/KVFiles/.kvrootrc.
This classification of data is meant to reflect the chronology of a typical process of data reduction & analysis. The first step is to create recon files from the raw data using the raw→recon analysis task. This can be performed as soon as the description of the experimental set-up (KVMultiDetArray class) has been implemented and the bare minimum of source files for setting up the database (runlist) are available. The advantage of working with recon files is that (i) the event reconstruction is performed once, in the raw→recon step, so subsequent analysis is that much faster; (ii) the data is stored in TTrees in ROOT files which, unless the acquisition system is based on ROOT, means that they can be analysed much more efficiently and on more platforms than the original raw files.
Definition at line 207 of file KVDataSet.h.
Public Member Functions | |
KVDataSet () | |
Default constructor. More... | |
virtual | ~ KVDataSet () |
virtual void | AddAvailableDataType (const Char_t *) |
void | cd () const |
virtual void | CheckAvailable () |
void | CheckMultiRunfiles (const Char_t *data_type) |
Bool_t | CheckRunfileAvailable (const Char_t *type, Int_t run) |
Bool_t | CheckRunfileUpToDate (const Char_t *data_type, Int_t run, const Char_t *other_repos) |
Bool_t | CheckRunfileUpToDate (const Char_t *data_type, Int_t run, KVDataRepository *other_repos) |
void | CheckUpToDate (const Char_t *data_type, const Char_t *other_repos) |
virtual Bool_t | CheckUserCanAccess () |
void | CleanMultiRunfiles (const Char_t *data_type, Bool_t confirm=kTRUE) |
void | CommitRunfile (const Char_t *type, Int_t run, TFile *file) |
void | CopyRunfilesFromRepository (const Char_t *type, KVNumberList runs, const Char_t *destdir) |
void | CopyRunfilesToRepository (const Char_t *type, KVNumberList runs, const Char_t *destrepo) |
virtual Bool_t | DataBaseNeedsUpdate () const |
Bool_t | DataBaseUpdateInProgress () const |
void | DeleteRunfile (const Char_t *type, Int_t run, Bool_t confirm=kTRUE) |
void | DeleteRunfiles (const Char_t *type, KVNumberList lrun="", Bool_t confirm=kTRUE) |
Bool_t | FindDataSetFile (const Char_t *filename) |
KVDataAnalysisTask * | GetAnalysisTask (const Char_t *keywords) const |
KVDataAnalysisTask * | GetAnalysisTask (Int_t) const |
virtual KVDataAnalysisTask | GetAnalysisTaskAny (const Char_t *keywords) const |
virtual const Char_t * | GetAvailableDataTypes () const |
KVAvailableRunsFile * | GetAvailableRunsFile (const Char_t *type) const |
KVExpDB * | GetDataBase (Option_t *opt="") const |
virtual const Char_t * | GetDataPathSubdir () const |
Returns name of top-level directory in data repository used to store data files for this dataset. More... | |
const Char_t * | GetDataSetDir () const |
Bool_t | GetDataSetEnv (const Char_t *type, Bool_t defval) const |
const Char_t * | GetDataSetEnv (const Char_t *type, const Char_t *defval="") const |
Double_t | GetDataSetEnv (const Char_t *type, Double_t defval) const |
const Char_t * | GetDataTypeSubdir (const Char_t *type) const |
TString | GetFullPathToDataSetFile (const Char_t *filename) |
TString | GetFullPathToRunfile (const Char_t *type, Int_t run) const |
virtual TList * | GetListOfAvailableSystems (const Char_t *datatype, KVDBSystem *systol=0) |
virtual TList * | GetListOfAvailableSystems (KVDataAnalysisTask *datan, KVDBSystem *systol=0) |
virtual Int_t | GetNtasks () const |
TString | GetOutputRepository (const Char_t *taskname) const |
virtual const Char_t * | GetReconstructedEventClassName () const |
KVDataRepository * | GetRepository () const |
Get pointer to data repository in which dataset is stored. More... | |
TDatime | GetRunfileDate (const Char_t *type, Int_t run) |
const Char_t * | GetRunfileName (const Char_t *type, Int_t run) const |
KVNumberList | GetRunList (const Char_t *data_type, const KVDBSystem *sys=0) const |
KVNumberList | GetRunList_DateSelection (const Char_t *type, TDatime *min=0, TDatime *max=0) |
KVNumberList | GetRunList_StageSelection (const Char_t *other_type, const Char_t *base_type, KVDBSystem *sys=0, Bool_t OnlyCol=kFALSE) |
KVNumberList | GetRunList_VersionSelection (const Char_t *type, const Char_t *version, KVDBSystem *sys=0) |
KVNumberList | GetUpdatableRuns (const Char_t *data_type, const Char_t *other_repos) |
Bool_t | HasCalibIdentInfos () const |
virtual Bool_t | HasDataType (const Char_t *data_type) const |
virtual Bool_t | IsAvailable () const |
Returns kTRUE if this dataset is available for analysis, i.e. if any associated data files are stored in the data repository. More... | |
virtual void | ls (Option_t *opt="") const |
Print dataset information. More... | |
virtual void | MakeAnalysisClass (const Char_t *task, const Char_t *classname) |
TFile * | NewRunfile (const Char_t *type, Int_t run) |
Bool_t | OpenDataSetFile (const Char_t *filename, std::ifstream &file) |
template<typename FileType > | |
FileType * | OpenRunfile (const Char_t *type, Int_t run) |
TObject * | OpenRunfile (const Char_t *type, Int_t run) |
virtual void | Print (Option_t *opt="") const |
virtual void | SaveDataBase () const |
virtual void | SetAnalysisTasks (const KVSeqCollection *) |
virtual void | SetAvailable (Bool_t yes=kTRUE) |
virtual void | SetDataPathSubdir (const Char_t *s) |
void | SetName (const char *name) |
void | SetRepository (KVDataRepository *) |
Set pointer to data repository in which dataset is stored. More... | |
virtual void | SetUserGroups (const Char_t *groups) |
void | UpdateAvailableRuns (const Char_t *type) |
Public Member Functions inherited from KVBase | |
KVBase () | |
Default constructor. More... | |
KVBase (const Char_t *name, const Char_t *title="") | |
Ctor for object with given name and type. More... | |
KVBase (const KVBase &) | |
copy ctor More... | |
virtual | ~ KVBase () |
virtual void | Clear (Option_t *opt="") |
Clear object properties : name, type/title, number, label. More... | |
virtual void | Copy (TObject &) const |
Make a copy of this object. More... | |
const Char_t * | GetLabel () const |
UInt_t | GetNumber () const |
UInt_t | GetNumberOfObjects () const |
virtual TObject * | GetObject () const |
virtual const Char_t * | GetType () const |
Bool_t | HasLabel () const |
virtual Bool_t | IsCalled (const Char_t *name) const |
Bool_t | IsLabelled (const Char_t *l) const |
virtual Bool_t | IsType (const Char_t *typ) const |
virtual void | List () |
KVBase & | operator= (const KVBase &) |
copy assignment operator More... | |
Double_t | ProtectedGetX (const TF1 *func, Double_t val, int &status, Double_t xmin=0.0, Double_t xmax=0.0) const |
void | SetLabel (const Char_t *lab) |
virtual void | SetNumber (UInt_t num) |
virtual void | SetType (const Char_t *str) |
Public Member Functions inherited from TNamed | |
TNamed () | |
TNamed (const char *name, const char *title) | |
TNamed (const TNamed &named) | |
TNamed (const TString &name, const TString &title) | |
virtual | ~TNamed () |
virtual TObject * | Clone (const char *newname="") const |
virtual Int_t | Compare (const TObject *obj) const |
virtual void | FillBuffer (char *&buffer) |
virtual const char * | GetName () const |
virtual const char * | GetTitle () const |
virtual ULong_t | Hash () const |
virtual Bool_t | IsSortable () const |
TNamed & | operator= (const TNamed &rhs) |
virtual void | SetNameTitle (const char *name, const char *title) |
virtual void | SetTitle (const char *title="") |
virtual Int_t | Sizeof () const |
Public Member Functions inherited from TObject | |
TObject () | |
TObject (const TObject &object) | |
virtual | ~TObject () |
void | AbstractMethod (const char *method) const |
virtual void | AppendPad (Option_t *option="") |
virtual void | Browse (TBrowser *b) |
ULong_t | CheckedHash () |
virtual const char * | ClassName () const |
virtual void | Delete (Option_t *option="") |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
virtual void | Draw (Option_t *option="") |
virtual void | DrawClass () const |
virtual TObject * | DrawClone (Option_t *option="") const |
virtual void | Dump () const |
virtual void | Error (const char *method, const char *msgfmt,...) const |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
virtual TObject * | FindObject (const char *name) const |
virtual TObject * | FindObject (const TObject *obj) const |
virtual Option_t * | GetDrawOption () const |
virtual const char * | GetIconName () const |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
virtual Option_t * | GetOption () const |
virtual UInt_t | GetUniqueID () const |
virtual Bool_t | HandleTimer (TTimer *timer) |
Bool_t | HasInconsistentHash () const |
virtual void | Info (const char *method, const char *msgfmt,...) const |
virtual Bool_t | InheritsFrom (const char *classname) const |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
virtual void | Inspect () const |
void | InvertBit (UInt_t f) |
virtual Bool_t | IsEqual (const TObject *obj) const |
virtual Bool_t | IsFolder () const |
R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
R__ALWAYS_INLINE Bool_t | IsZombie () const |
void | MayNotUse (const char *method) const |
virtual Bool_t | Notify () |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
void | operator delete (void *ptr) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, void *vp) |
TObject & | operator= (const TObject &rhs) |
virtual void | Paint (Option_t *option="") |
virtual void | Pop () |
virtual Int_t | Read (const char *name) |
virtual void | RecursiveRemove (TObject *obj) |
void | ResetBit (UInt_t f) |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
void | SetBit (UInt_t f) |
void | SetBit (UInt_t f, Bool_t set) |
virtual void | SetDrawOption (Option_t *option="") |
virtual void | SetUniqueID (UInt_t uid) |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
R__ALWAYS_INLINE Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
virtual void | UseCurrentStyle () |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Static Public Member Functions | |
static Bool_t | FindDataSetFile (const TString &dataset, const Char_t *filename) |
static TString | GetFullPathToDataSetFile (const TString &dataset, const Char_t *filename) |
static Bool_t | OpenDataSetFile (const TString &dataset, const Char_t *filename, std::ifstream &file) |
Static Public Member Functions inherited from KVBase | |
static Bool_t | AreEqual (Double_t x, Double_t y, Long64_t maxdif=1) |
Comparison between two 64-bit floating-point values. More... | |
static void | BackupFileWithDate (const Char_t *path) |
static void | CombineFiles (const Char_t *file1, const Char_t *file2, const Char_t *newfilename, Bool_t keep=kTRUE) |
static void | Deprecated (const char *method, const char *advice) |
static Bool_t | FindClassSourceFiles (const Char_t *class_name, KVString &imp_file, KVString &dec_file, const Char_t *dir_name=".") |
static Bool_t | FindExecutable (TString &exec, const Char_t *path="$(PATH)") |
static const Char_t * | FindFile (const Char_t *search, TString &wfil) |
static const Char_t * | GetBINDIRFilePath (const Char_t *namefile="") |
static const Char_t * | GetDATABASEFilePath () |
static const Char_t * | GetDATADIRFilePath (const Char_t *namefile="") |
static Bool_t | GetDataSetEnv (const Char_t *dataset, const Char_t *type, Bool_t defval) |
static const Char_t * | GetDataSetEnv (const Char_t *dataset, const Char_t *type, const Char_t *defval) |
static Double_t | GetDataSetEnv (const Char_t *dataset, const Char_t *type, Double_t defval) |
static const Char_t * | GetETCDIRFilePath (const Char_t *namefile="") |
static const Char_t * | GetExampleFilePath (const Char_t *library, const Char_t *namefile) |
Return full path to example file for given library (="KVMultiDet", "BackTrack", etc.) More... | |
static const Char_t * | GetINCDIRFilePath (const Char_t *namefile="") |
static const Char_t * | GetKVBuildDate () |
Returns KaliVeda build date. More... | |
static const Char_t * | GetKVBuildDir () |
Returns top-level directory used for build. More... | |
static const Char_t * | GetKVBuildTime () |
Returns KaliVeda build time. More... | |
static const Char_t * | GetKVBuildType () |
Returns KaliVeda build type (cmake build: Release, Debug, RelWithDebInfo, ...) More... | |
static const Char_t * | GetKVBuildUser () |
Returns username of person who performed build. More... | |
static const Char_t * | GetKVSourceDir () |
Returns top-level directory of source tree used for build. More... | |
static const Char_t * | GetKVVersion () |
Returns KaliVeda version string. More... | |
static const Char_t * | GetLIBDIRFilePath (const Char_t *namefile="") |
static const Char_t * | GetListOfPlugins (const Char_t *base) |
static const Char_t * | GetListOfPluginURIs (const Char_t *base) |
static const Char_t * | GetPluginURI (const Char_t *base, const Char_t *plugin) |
static void | GetTempFileName (TString &base) |
static const Char_t * | GetTEMPLATEDIRFilePath (const Char_t *namefile="") |
static const Char_t * | GetWORKDIRFilePath (const Char_t *namefile="") |
static const Char_t * | gitBranch () |
Returns git branch of sources. More... | |
static const Char_t * | gitCommit () |
Returns last git commit of sources. More... | |
static void | InitEnvironment () |
static bool | is_gnuinstall () |
static Bool_t | IsThisAPlugin (const TString &uri, TString &base) |
static TPluginHandler * | LoadPlugin (const Char_t *base, const Char_t *uri="0") |
static Bool_t | OpenContextMenu (const char *method, TObject *obj, const char *alt_method_name="") |
static void | OpenTempFile (TString &base, std::ofstream &fp) |
static void | PrintSplashScreen () |
Prints welcome message and infos on version etc. More... | |
static Bool_t | SearchAndOpenKVFile (const Char_t *name, KVSQLite::database &dbfile, const Char_t *kvsubdir="") |
static Bool_t | SearchAndOpenKVFile (const Char_t *name, std::ifstream &file, const Char_t *kvsubdir="", KVLockfile *locks=0) |
static Bool_t | SearchAndOpenKVFile (const Char_t *name, std::ofstream &file, const Char_t *kvsubdir="", KVLockfile *locks=0) |
static Bool_t | SearchKVFile (const Char_t *name, TString &fullpath, const Char_t *kvsubdir="") |
static const Char_t * | WorkingDirectory () |
Static Public Member Functions inherited from TObject | |
static Longptr_t | GetDtorOnly () |
static Bool_t | GetObjectStat () |
static void | SetDtorOnly (void *obj) |
static void | SetObjectStat (Bool_t stat) |
Protected Types | |
enum | { kAvailable = BIT(14) } |
Protected Member Functions | |
virtual const Char_t * | GetBaseFileName (const Char_t *type, Int_t run) const |
const Char_t * | GetDBFileName () const |
const Char_t * | GetDBName () const |
const Char_t * | GetFullPathToDB () const |
Returns full path to file where database is written on disk. More... | |
TObject * | open_runfile (const Char_t *type, Int_t run) |
virtual void | OpenDataBase (Option_t *opt="") const |
virtual void | OpenDBFile (const Char_t *full_path_to_dbfile) const |
Open the database from a file on disk. More... | |
void | SetDataSetSpecificTaskParameters (KVDataAnalysisTask *) const |
void | SetDBFileName (const Char_t *name) |
void | SetDBName (const Char_t *name) |
virtual void | WriteDBFile (const Char_t *full_path_to_dbfile) const |
Protected Member Functions inherited from TObject | |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
void | MakeZombie () |
Protected Attributes | |
KVList | fAvailableRuns |
list of KVAvailableRunsFile objects used to read infos on available runs More... | |
TString | fCalibDir |
directory containing database, calibration, identification parameters etc. for dataset More... | |
KVExpDB * | fDataBase |
pointer to dataset's database More... | |
Bool_t | fDataBaseUpdateInProgress = false |
TString | fDatatypes |
list of types of data which are available for this dataset More... | |
std::unique_ptr< TFile > | fDBase |
file containing database More... | |
Bool_t | fDBBuild |
has the database been built by us ? More... | |
TString | fDBFileName |
name of file in which database is stored on disk More... | |
TString | fDBName |
name of database More... | |
KVDataRepository * | fRepository |
repository in which dataset is stored More... | |
KVList | fTasks |
possible data analysis tasks for this dataset More... | |
TString | fUserGroups |
list of user groups allowed to read data More... | |
Protected Attributes inherited from KVBase | |
TString | fLabel |
label for the object More... | |
Protected Attributes inherited from TNamed | |
TString | fName |
TString | fTitle |
Protected Attributes inherited from TObject | |
kOnlyPrepStep | |
Friends | |
class | KVAvailableRunsFile |
class | KVDataSetManager |
Additional Inherited Members | |
Public Types inherited from KVBase | |
enum | EKaliVedaBits { kIsKaliVedaObject = BIT(23) } |
Public Types inherited from TObject | |
enum | EDeprecatedStatusBits |
enum | EStatusBits |
Public Attributes inherited from TObject | |
kBitMask | |
kCanDelete | |
kCannotPick | |
kHasUUID | |
kInconsistent | |
kInvalidObject | |
kIsOnHeap | |
kIsReferenced | |
kMustCleanup | |
kNoContextMenu | |
kNotDeleted | |
kObjInCanvas | |
kOverwrite | |
kSingleKey | |
kWriteDelete | |
kZombie | |
#include <KVDataSet.h>
|
protected |
Enumerator | |
---|---|
kAvailable |
Definition at line 223 of file KVDataSet.h.
KVDataSet::KVDataSet | ( | ) |
Default constructor.
Definition at line 35 of file KVDataSet.cpp.
|
inlinevirtual |
Definition at line 257 of file KVDataSet.h.
Definition at line 528 of file KVDataSet.cpp.
void KVDataSet::cd | ( | ) | const |
Data analysis can only be performed if the data set in question is "activated" or "selected" using this method. At the same time, the data repository, dataset manager and database associated with this dataset also become the "active" ones (pointed to by the respective global pointers, gDataRepository, gDataBase, etc. etc.)
Definition at line 736 of file KVDataSet.cpp.
|
virtual |
Check if this data set is physically present and available for analysis. In other words we check if the value of GetDatapathSubdir() is a subdirectory of the given data repository If so, we proceed to check for the existence of any of the datatypes defined in
KVDataSet.DataTypes:
by checking for the associated sudirectories defined in the corresponding variables:
KVDataSet.DataType.Subdir.[type]:
If none of them exists, the dataset will be reset to 'unavailable' Otherwise the corresponding flags are set.
Note that if SetUserGroups has been called with a list of groups allowed to read this data, the current user's name (gSystem->GetUserInfo()->fUser) will be used to check if the dataset is available. The user name must appear in the group defined by SetUserGroups.
Definition at line 471 of file KVDataSet.cpp.
Check all runs for a given datatype and make sure that only one version exists for each run. If not, we print a report on the runfiles which occur multiple times, with the associated date and file name.
Definition at line 1413 of file KVDataSet.cpp.
We check the availability of the run by looking in the available runs file associated with the given datatype. check data type is available
Definition at line 976 of file KVDataSet.cpp.
Bool_t KVDataSet::CheckRunfileUpToDate | ( | const Char_t * | data_type, |
Int_t | run, | ||
const Char_t * | other_repos | ||
) |
Use this method to check whether the file of type "data_type" for run number "run" in the data repository "other_repos" is more recent than the file contained in the data repository corresponding to this dataset. Returns kTRUE if no repository with name "other_repos" exists. Returns kFALSE if file in other repository is more recent.
Definition at line 1580 of file KVDataSet.cpp.
Bool_t KVDataSet::CheckRunfileUpToDate | ( | const Char_t * | data_type, |
Int_t | run, | ||
KVDataRepository * | other_repos | ||
) |
Use this method to check whether the file of type "data_type" for run number "run" in the data repository "other_repos" is more recent than the file contained in the data repository corresponding to this dataset. Returns kFALSE if file in other repository is more recent.
Definition at line 1546 of file KVDataSet.cpp.
Check whether all files of type "data_type" for run number "run" in the data repository are up to date (i.e. at least as recent) as compared to the files in data repository "other_repos".
Definition at line 1605 of file KVDataSet.cpp.
|
virtual |
if fUserGroups has been set with SetUserGroups(), we check that the current user's name (gSystem->GetUserInfo()->fUser) appears in at least one of the groups in the list. Returns kFALSE if user's name is not found in any of the groups. if fUserGroups="" (default), we return kTRUE for all users.
Definition at line 1356 of file KVDataSet.cpp.
Check all runs for a given datatype and make sure that only one version exists for each run. If not, we print a report on the runfiles which occur multiple times, with the associated date and file name, and then we destroy all but the most recent version of the file in the repository, and update the runlist accordingly. By default, we ask for confirmation before deleting each file. Call with confirm=kFALSE to delete WITHOUT CONFIRMATION (DANGER!! WARNING!!!)
Definition at line 1463 of file KVDataSet.cpp.
Commit a runfile previously created with NewRunfile() to the repository. Any previous version of the runfile will be deleted. The available runs list for this data 'type' is updated.
Definition at line 1312 of file KVDataSet.cpp.
void KVDataSet::CopyRunfilesFromRepository | ( | const Char_t * | type, |
KVNumberList | runs, | ||
const Char_t * | destdir | ||
) |
Copies the runfiles of given "type" into the local directory "destdir". Run numbers given as a list of type "1-10".
Definition at line 2091 of file KVDataSet.cpp.
void KVDataSet::CopyRunfilesToRepository | ( | const Char_t * | type, |
KVNumberList | runs, | ||
const Char_t * | destrepo | ||
) |
Copies the runfiles of given "type" from the data repository associated with this dataset into the local repository "destrepo". Run numbers given as a list of type "1-10".
Definition at line 2115 of file KVDataSet.cpp.
|
virtual |
Returns kTRUE if database needs to be regenerated from source files, i.e. if source files are more recent than DataBase.root In case no directory exists for dataset (dataset added 'on the fly') we create the directory and fill it with dummy files (Makefile, Runlist.csv, Systems.dat)
Definition at line 1996 of file KVDataSet.cpp.
|
inline |
Definition at line 249 of file KVDataSet.h.
Delete the file for the given run of data type "type" from the repository. By default, confirm=kTRUE, which means that the user will be asked to confirm that the file should be deleted. If confirm=kFALSE, no confirmation will be asked for and the file will be deleted straight away.
WARNING: this really does DELETE files in the repository, they cannot be retrieved once they have been deleted.
Definition at line 1083 of file KVDataSet.cpp.
void KVDataSet::DeleteRunfiles | ( | const Char_t * | type, |
KVNumberList | nl = "" , |
||
Bool_t | confirm = kTRUE |
||
) |
Delete files corresponding to a list of runs of data type "type" from the repository. By default, confirm=kTRUE, which means that the user will be asked to confirm that each file should be deleted. If confirm=kFALSE, no confirmation will be asked for and the file will be deleted straight away. if "nl" is empty (default value) all runs of the dataset corresponding to the given type will be deleted WARNING: this really does DELETE files in the repository, they cannot be retrieved once they have been deleted.
Definition at line 1127 of file KVDataSet.cpp.
Find a file in the dataset directory (given by GetDataSetDir()) Returns kTRUE if found, kFALSE if not
Definition at line 1937 of file KVDataSet.cpp.
Static method to find a file in the dataset directory (given by GetDataSetDir()) Returns kTRUE if found, kFALSE if not
Definition at line 1921 of file KVDataSet.cpp.
KVDataAnalysisTask * KVDataSet::GetAnalysisTask | ( | const Char_t * | keywords | ) | const |
This method returns a pointer to the available analysis task whose description (title) contains all of the whitespace-separated keywords (which may be regular expressions) given in the string "keywords". The comparison is case-insensitive.
WARNING: this method can only be used to access analysis tasks that are available for this dataset, i.e. for which the corresponding prerequisite data type is available in the repository. For unavailable data/tasks, use GetAnalysisTaskAny(const Char_t*).
EXAMPLES Let us suppose that the current dataset has the following list of tasks:
root [2] gDataSet->Print("tasks")
root [14] gDataSet->GetAnalysisTask("raw->recon")->Print() KVDataAnalysisTask : Event reconstruction from raw data (raw->recon)
root [10] gDataSet->GetAnalysisTask("analysis root")->Print() KVDataAnalysisTask : Analysis of fully calibrated physical data (root)
case-insensitive search for matches in list based on 'title' attribute
Definition at line 1741 of file KVDataSet.cpp.
KVDataAnalysisTask * KVDataSet::GetAnalysisTask | ( | Int_t | k | ) | const |
Return kth analysis task in list of available tasks. k=[1, GetNtasks()] and corresponds to the number shown next to the title of the task when KVDataSet::Print("tasks") is called
Definition at line 589 of file KVDataSet.cpp.
|
virtual |
This method returns a copy of the analysis task whose description (title) contains all of the whitespace-separated keywords (which may be regular expressions) given in the string "keywords". The comparison is case-insensitive. The analysis task does not need to be "available", i.e. the associated prerequisite data type does not have to be present in the repository (see GetAnalysisTask).
If no task is found, the returned KVDataAnalysisTask object will be a zombie (test with IsZombie()). case-insensitive search for matches in list of all analysis tasks, based on 'title' attribute
Definition at line 1959 of file KVDataSet.cpp.
|
inlinevirtual |
Definition at line 277 of file KVDataSet.h.
KVAvailableRunsFile * KVDataSet::GetAvailableRunsFile | ( | const Char_t * | type | ) | const |
Returns available runs file object for given data 'type' (="raw", "recon", "ident", "root") Object will be created and added to internal list if it does not exist
Definition at line 48 of file KVDataSet.cpp.
PRIVATE METHOD: Returns base name of data file containing data for the run of given datatype. The filename corresponds to one of the formats defined in $KVROOT/KVFiles/.kvrootrc by variables like:
[dataset].DataSet.RunFileName.[type]: runR.dat
R will be replaced with the run number IF the format contains 'D' it will be replaced with the current date and time
Definition at line 1004 of file KVDataSet.cpp.
Returns pointer to database associated with this dataset. Opens, updates or creates database file if necessary (the database is automatically rebuilt if the source files are more recent than the last database file).
If opt="update": close and delete database if already open regenerate database from source files Use this option to force the regeneration of the database.
Definition at line 285 of file KVDataSet.cpp.
|
inlinevirtual |
Returns name of top-level directory in data repository used to store data files for this dataset.
Definition at line 266 of file KVDataSet.h.
const Char_t * KVDataSet::GetDataSetDir | ( | ) | const |
Returns full path to directory containing database and calibration/identification parameters etc. for this dataset.
Definition at line 720 of file KVDataSet.cpp.
Will look for gEnv->GetValue "name_of_dataset.type" then simply "type" if no dataset-specific value is found. If neither resource is defined, return the "defval" default value
Definition at line 792 of file KVDataSet.cpp.
Will look for gEnv->GetValue "name_of_dataset.type" then simply "type" if no dataset-specific value is found. If neither resource is defined, return the "defval" default value (="" by default)
Definition at line 758 of file KVDataSet.cpp.
Will look for gEnv->GetValue "name_of_dataset.type" then simply "type" if no dataset-specific value is found. If neither resource is defined, return the "defval" default value
Definition at line 775 of file KVDataSet.cpp.
returns name to be used for subdirectory corresponding to given data type
Definition at line 270 of file KVDataSet.h.
|
protected |
Returns name of file containing database for dataset. If this is not set explicitly with SetDBFileName(), the default value defined by DataSet.DatabaseFile in $KVROOT/KVFiles/.kvrootrc will be returned.
Definition at line 70 of file KVDataSet.cpp.
|
protected |
Returns name of database object in database file. If this is not set explicitly with SetDBName(), we use the name of the dataset by default
Definition at line 87 of file KVDataSet.cpp.
Find a file in the dataset directory (given by GetDataSetDir()) Returns full path to file if found, empty string if not
Definition at line 1887 of file KVDataSet.cpp.
|
static |
Static method to find a file in the dataset directory (given by GetDataSetDir()) Returns full path to file if found, empty string if not
Definition at line 1901 of file KVDataSet.cpp.
|
protected |
Returns full path to file where database is written on disk.
Definition at line 129 of file KVDataSet.cpp.
Return full path to file containing data of given datatype for given run number of this dataset. NB. only works for available run files, if their is no file in the repository for this run, the returned path will be empty. This path should be used with e.g. TChain::Add. get name of file from available runs file
Definition at line 888 of file KVDataSet.cpp.
|
virtual |
Create and fill a list of available systems for this dataset and the given datatype
This uses the database associated to the dataset. USER MUST DELETE THE LIST AFTER USE.
For each system in the list we set the number of available runs : this number can be retrieved with KVDBSystem::GetNumberRuns()
If systol!=0 then in fact the list contains a list of runs for the given system which are available.
If no systems are defined for the dataset then we return a list of available runs for the given datatype open the available runs file for the data type
Definition at line 614 of file KVDataSet.cpp.
|
virtual |
Create and fill a list of available systems for this dataset and the prerequisite datatype for the given data analysis task. This uses the database associated to the dataset. USER MUST DELETE THE LIST AFTER USE.
For each system in the list we set the number of available runs : this number can be retrieved with KVDBSystem::GetNumberRuns()
If systol!=0 then in fact the list contains a list of runs for the given system which are available.
If no systems are defined for the dataset then we return a list of available runs for the given datatype
Definition at line 654 of file KVDataSet.cpp.
|
virtual |
Returns the number of tasks associated to dataset which are compatible with the available data
Definition at line 574 of file KVDataSet.cpp.
Returns name of output repository for given task. By default it is the name of the repository associated with this dataset, but can be changed by the following environment variables:
[repository].DefaultOutputRepository: [other repository]
[taskname].DataAnalysisTask.OutputRepository: [other repository]
[dataset].[taskname].DataAnalysisTask.OutputRepository: [other repository]
Definition at line 2060 of file KVDataSet.cpp.
|
inlinevirtual |
Returns the name of the class used to store reconstructed events for this dataset. This is defined by the value of environment variable
The default value (if no variable defined) is KVReconstructedEvent.
Definition at line 388 of file KVDataSet.h.
KVDataRepository * KVDataSet::GetRepository | ( | ) | const |
Get pointer to data repository in which dataset is stored.
Definition at line 1399 of file KVDataSet.cpp.
Return date of file containing data of given datatype for given run number of this dataset. NB. only works for available run files, if there is no file in the repository for this run, an error will be printed and the returned data is set to "Sun Jan 1 00:00:00 1995" (earliest possible date for TDatime class).
Definition at line 942 of file KVDataSet.cpp.
Return name of file containing data of given datatype for given run number of this dataset. NB. only works for available run files, if there is no file in the repository for this run, the returned path will be empty. check data type is available
Definition at line 914 of file KVDataSet.cpp.
KVNumberList KVDataSet::GetRunList | ( | const Char_t * | data_type, |
const KVDBSystem * | system = 0 |
||
) | const |
Returns list of all runs available for given "data_type" If a pointer to a reaction system is given, only runs for the given system will be included in the list.
Definition at line 1690 of file KVDataSet.cpp.
KVNumberList KVDataSet::GetRunList_DateSelection | ( | const Char_t * | type, |
TDatime * | min = 0 , |
||
TDatime * | max = 0 |
||
) |
Prints out and returns list of runs after date / time selection Runs generated between ]min;max[ are selected if min=NULL runs with date <max are selected if max=NULL runs with date >min are selected if max and min are NULL returns empty KVNumberList
Definition at line 1156 of file KVDataSet.cpp.
KVNumberList KVDataSet::GetRunList_StageSelection | ( | const Char_t * | type, |
const Char_t * | ref_type, | ||
KVDBSystem * | system = 0 , |
||
Bool_t | OnlyCol = kFALSE |
||
) |
Returns list of runs which are present for data type "base_type" but not for "other_type" if type is NULL or ="" returns empty KVNumberList If pointer to system is given, only runs for the system are considered. If OnlyCol=kTRUE (kFALSE default) only systems with KVDBSystem::IsCollision()=kTRUE are considered
Definition at line 1214 of file KVDataSet.cpp.
KVNumberList KVDataSet::GetRunList_VersionSelection | ( | const Char_t * | type, |
const Char_t * | version, | ||
KVDBSystem * | sys = 0 |
||
) |
Returns list of runs of given type that were created with the given version of KaliVeda. If system!="" then only runs for the given system are considered
Definition at line 1271 of file KVDataSet.cpp.
KVNumberList KVDataSet::GetUpdatableRuns | ( | const Char_t * | data_type, |
const Char_t * | other_repos | ||
) |
Returns list of all runs of type "data_type" which may be updated from the repository named "other_repos". See CheckUpToDate().
Definition at line 1653 of file KVDataSet.cpp.
|
inline |
If calibration/identification parameters are available for this dataset This is mostly important for filtering simulations: identification telescopes are only considered 'ready for identification' if they have (at least one) associated identification grid. If no identification grids exist, this condition should not be applied.
Definition at line 403 of file KVDataSet.h.
Returns kTRUE if data files of the given type are stored in the data repository If data_type="*" this method always returns kTRUE
Definition at line 297 of file KVDataSet.h.
|
inlinevirtual |
Returns kTRUE if this dataset is available for analysis, i.e. if any associated data files are stored in the data repository.
Definition at line 287 of file KVDataSet.h.
Create a skeleton analysis class to be used for analysis of the data belonging to this dataset.
task = keywords contained in title of analysis task (see GetAnalysisTask(const Char_t*)) (you do not need to include 'analysis', it is added automatically) classname = name of new analysis class
Example: MakeAnalysisClass("raw", "MyRawDataAnalysis") --> make skeleton raw data analysis class in files MyRawDataAnalysis.cpp & MyRawDataAnalysis.h MakeAnalysisClass("fully calibrated", "MyDataAnalysis") --> make skeleton data analysis class in files MyDataAnalysis.cpp & MyDataAnalysis.h
Definition at line 1791 of file KVDataSet.cpp.
Create a new runfile for the dataset of given datatype. (only if this dataset is associated with a data repository) Once the file has been filled, use CommitRunfile to submit it to the repository.
Definition at line 1058 of file KVDataSet.cpp.
Open file containing data of given datatype for given run number of this dataset.
Returns a pointer to the opened file; if the file is not available, we return nullptr.
The user must cast the returned pointer to the correct class, which will depend on the data type and the dataset (see $KVROOT/KVFiles/.kvrootrc
)
SPECIAL CASE: MFM data with EBYEDAT frames
If the variable
is set, then we expect to find the necessary ACTIONS_*
files in the dataset directory in subdirectory ebyedat
(they should have the same names as the data files prefixed by ACTIONS_[expname].CHC_PAR.
).
If in addition the variable
is set, then we use the same ACTIONS
file for all runs, with name ACTIONS_[expname].CHC_PAR
Definition at line 833 of file KVDataSet.cpp.
Open the database for this dataset. If the database does not exist or is older than the source files the database is automatically rebuilt (see DataBaseNeedUpdate()). Use opt="UPDATE" to force rebuilding of the database.
First, we look in to see if the database file exists (if no database file name given, use default name for database file defined in .rootrc config files). If so, we open the database contained in the file, after first loading the required plugin library if needed.
The name of the dataset must correspond to the name of one of the Plugin.KVDataBase plugins defined in the .rootrc configuration files
WARNING: if the database needs to be (re)built, we set gDataSet to point to this dataset in case it was not already done, as in order to (re)build the database it may be necessary for gDataSet to point to the current dataset.
Definition at line 331 of file KVDataSet.cpp.
Look for (and open for reading, if found) the named file in the directory which contains the files for this dataset (given by GetDataSetDir())
Definition at line 1850 of file KVDataSet.cpp.
|
static |
Static method to look for (and open for reading, if found) the named file in the directory which contains the files for the dataset
Definition at line 1864 of file KVDataSet.cpp.
Open the database from a file on disk.
Definition at line 103 of file KVDataSet.cpp.
|
inline |
Definition at line 338 of file KVDataSet.h.
Definition at line 342 of file KVDataSet.h.
Print dataset information If option string contains "tasks", print numbered list of tasks that can be performed If option string contains "data", print list of available data types
Reimplemented from KVBase.
Definition at line 420 of file KVDataSet.cpp.
|
virtual |
Write the database to disk (ROOT file). It will be written in the directory $KVROOT/db/[dataset name] If the directory does not exist, it will be created. Permissions are set to 775 (rwxrwxr-x).
DataSet.DatabaseFile: DataBase.root
DataSet.DatabaseName: DataBase
Definition at line 190 of file KVDataSet.cpp.
|
virtual |
Add to fTasks list any data analysis task in list 'task_list' whose pre-requisite datatype is present for this dataset. Any dataset-specific "tweaking" of the task (including the prerequisite datatype) is done here.
Definition at line 543 of file KVDataSet.cpp.
Definition at line 291 of file KVDataSet.h.
Definition at line 261 of file KVDataSet.h.
|
protected |
PROTECTED METHOD Called by KVDataSet::SetAnalysisTasks Check environment variables (i.e. .kvrootrc) to see if the task parameters have been "tweaked" for the dataset.
Definition at line 157 of file KVDataSet.cpp.
Definition at line 233 of file KVDataSet.h.
Definition at line 238 of file KVDataSet.h.
|
virtual |
Set name of dataset. Also sets path to directory containing database informations for this dataset, i.e. list of runs, systems, calibration files etc. By default, just the name of the dataset is used, i.e. [DATADIR]/name (where DATADIR = path given by KVBase::GetDATADIRFilePath()) However, if the variable [name].DataSet.Directory: [path] has been set, the value of [path] will be used. If [path] is an absolute path name, it will be used as such. If [path] is an incomplete or relative path, it will be prepended with [DATADIR]/
Reimplemented from TNamed.
Definition at line 688 of file KVDataSet.cpp.
void KVDataSet::SetRepository | ( | KVDataRepository * | dr | ) |
Set pointer to data repository in which dataset is stored.
Definition at line 1387 of file KVDataSet.cpp.
Definition at line 282 of file KVDataSet.h.
Update list of available runs for given data 'type' check data type is available
Definition at line 1036 of file KVDataSet.cpp.
PRIVATE METHOD Write the database to disk. Set permissions to rw for user & group
Definition at line 251 of file KVDataSet.cpp.
|
friend |
Definition at line 209 of file KVDataSet.h.
|
friend |
Definition at line 210 of file KVDataSet.h.
|
mutableprotected |
list of KVAvailableRunsFile objects used to read infos on available runs
Definition at line 222 of file KVDataSet.h.
|
protected |
directory containing database, calibration, identification parameters etc. for dataset
Definition at line 216 of file KVDataSet.h.
|
mutableprotected |
pointer to dataset's database
Definition at line 221 of file KVDataSet.h.
|
mutableprotected |
Definition at line 247 of file KVDataSet.h.
|
protected |
list of types of data which are available for this dataset
Definition at line 214 of file KVDataSet.h.
|
mutableprotected |
file containing database
Definition at line 218 of file KVDataSet.h.
|
protected |
has the database been built by us ?
Definition at line 217 of file KVDataSet.h.
|
protected |
name of file in which database is stored on disk
Definition at line 220 of file KVDataSet.h.
|
protected |
name of database
Definition at line 219 of file KVDataSet.h.
|
protected |
repository in which dataset is stored
Definition at line 213 of file KVDataSet.h.
|
protected |
possible data analysis tasks for this dataset
Definition at line 215 of file KVDataSet.h.
|
protected |
list of user groups allowed to read data
Definition at line 226 of file KVDataSet.h.