KaliVeda
Toolkit for HIC analysis
KVDataSet Class Reference

Detailed Description

Manage an experimental dataset corresponding to a given experiment or campaign.

In KaliVeda, all experimental data is divided into datasets described by a KVDataSet object. These objects are not usually set up individually by hand, but rather they are created when a KVDataSetManager object is initialised, using the informations in files contained in specific directories, one for each dataset (see the subdirectories of the datasets/ directory in the top-level source directory of KaliVeda, or https://gitlab.in2p3.fr/kaliveda-dev/datasets):

dsm.Init();
Manage all datasets contained in a given data repository.
virtual Bool_t Init(KVDataRepository *=0)

After initialisation, each dataset can be accessed using a global pointer to the current KVDataSetManager, using the dataset name:

auto ds = gDataSetManager->GetDataSet("[name of dataset]");
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.

In many situations, such as e.g. when running analysis of some data, the associated dataset is set as the 'currently active' dataset, which means that it can be accessed through another global pointer,

-// set currently active dataset
gDataSetManager->GetDataSet("[name of dataset]")->cd();
-// print name of currently active dataset
std::cout << gDataSet->GetName() << std::endl;
void cd() const
Definition: KVDataSet.cpp:692
const char * GetName() const override

Each dataset has an associated database (KVExpDB object) which contains all available information concerning the experimental data and its calibration. When the 'currently active' dataset has been defined, a global pointer to the associated database can also be used:

-// list all reaction systems associated with current dataset
gExpDB->GetSystems()->ls();
virtual KVSeqCollection * GetSystems() const
Definition: KVExpDB.h:114
void ls(Option_t *option="") const override

The gDataSet global pointer can also be used to open (and read) data files associated with the dataset, but only if there is an associated KVDataRepository containing such files. In order to open data files, instead of initialising a KVDataSetManager as shown above, you should begin by initialising a KVDataRepositoryManager:

drm.Init();
Manages access to one or more data repositories.

Note that each data repository has an associated dataset manager, therefore after initialisation of the repository manager, the global gDataSetManager will give access to the datasets associated with the 'currently active' data repository, accessible through global pointer gDataRepository: there is no need to create a separate KVDataSetManager object:

drm.Init();
-// set "[name of dataset]" as 'currently active' dataset
gDataSetManager->GetDataSet("[name of dataset]")->cd();
-// list all reaction systems associated with current dataset "[name of dataset]":
gExpDB->GetSystems()->ls();

Consulting the catalogue of available data files of each type (raw, recon, etc.), and opening files for analysis can then be done using the global gDataSet pointer:

-// get list of run/index numbers of all available files containing reconstructed events
auto rl = gDataSet->GetRunList("recon");
-// get full path to a given runfile: here, raw data file index 3 of run 12
std::cout << gDataSet->GetFullPathToRunfile("raw", {12,3}) << std::endl;
-// open a runfile for reading
auto rdr = gDataSet->OpenRunfile<KVRawDataReader>("raw", {12,3});
rdr->GetRunInfos().Print();
TString GetFullPathToRunfile(const KVString &type, const run_index_t &run) const
Definition: KVDataSet.cpp:794
run_index_list GetRunList(const Char_t *data_type, const KVDBSystem *sys=0) const
Definition: KVDataSet.cpp:1576
FileType * OpenRunfile(const KVString &type, const run_index_t &run)
Definition: KVDataSet.h:282
void Print(Option_t *opt="") const override
Abstract base class for reading raw (DAQ) data.
const KVNameValueList & GetRunInfos() const

See list of methods below for more details.

Dataset configuration variables

The following variables are used to tune/tweak the definition of a dataset. In each case, a default value exists which is applied to all datasets, whereas prefixing the variable name with the name of a specific dataset applies to just that dataset.

The value defined for the currently active dataset for any of these variables can be consulted using

std::cout << gDataSet->GetDataSetEnv("KVDataSet.DataTypes") << std::endl;
ValType GetDataSetEnv(const Char_t *type, const ValType &defval) const
Definition: KVDataSet.h:252
Variable Role Example
KVDataSet.DataTypes Different types of data which can be associated with datasets "raw recon"
KVDataSet.DataType.Subdir.[type] Names used for subdirectories containing data of different types "raw"
DataSet.RunFileName.[type] Default formats for runfile names (run number is used to replace integer format) "run_%R.dat"
DataSet.RunFileClass.[type] Default base classes for reading runfiles of different types "KVRawDataReader", "TFile"

Definition at line 130 of file KVDataSet.h.

#include <KVDataSet.h>

Inheritance diagram for KVDataSet:

Public Member Functions

 KVDataSet ()
 Default constructor. More...
 
virtual void AddAvailableDataType (const Char_t *)
 
void cd () const
 
virtual void CheckAvailable ()
 
void CheckMultiRunfiles (const Char_t *data_type)
 
Bool_t CheckRunfileAvailable (const KVString &type, const run_index_t &run)
 
Bool_t CheckRunfileUpToDate (const KVString &data_type, const run_index_t &run, const KVString &other_repos)
 
Bool_t CheckRunfileUpToDate (const KVString &data_type, const run_index_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 KVString &type, const run_index_t &run, TFile *file)
 
void CopyRunfilesFromRepository (const Char_t *type, const run_index_list &runs, const Char_t *destdir)
 Copies the runfiles of given "type" into the local directory "destdir". More...
 
void CopyRunfilesToRepository (const Char_t *type, const run_index_list &runs, const Char_t *destrepo)
 
virtual Bool_t DataBaseNeedsUpdate () const
 
Bool_t DataBaseUpdateInProgress () const
 
void DeleteRunfile (const KVString &type, const run_index_t &run, Bool_t confirm=kTRUE)
 
void DeleteRunfiles (const Char_t *type, const run_index_list &lrun={}, Bool_t confirm=kTRUE)
 
Bool_t FindDataSetFile (const Char_t *filename)
 
KVDataAnalysisTaskGetAnalysisTask (const Char_t *keywords) const
 
KVDataAnalysisTaskGetAnalysisTask (Int_t) const
 
virtual KVDataAnalysisTaskGetAnalysisTaskAny (const Char_t *keywords) const
 
virtual const Char_tGetAvailableDataTypes () const
 
KVAvailableRunsFileGetAvailableRunsFile (const Char_t *type) const
 
KVExpDBGetDataBase (Option_t *opt="") const
 
virtual const Char_tGetDataPathSubdir () const
 
const Char_tGetDataSetDir () const
 
KVString GetDataSetEnv (const Char_t *type, Char_t *defval) const
 
KVString GetDataSetEnv (const Char_t *type, const Char_t *defval="") const
 
template<typename ValType >
ValType GetDataSetEnv (const Char_t *type, const ValType &defval) const
 
KVString GetDataTypeSubdir (const Char_t *type) const
 
TString GetFullPathToDataSetFile (const Char_t *filename)
 
TString GetFullPathToRunfile (const KVString &type, const run_index_t &run) const
 
virtual std::unique_ptr< TListGetListOfAvailableSystems (const Char_t *datatype, KVDBSystem *systol=0)
 
virtual std::unique_ptr< TListGetListOfAvailableSystems (KVDataAnalysisTask *datan, KVDBSystem *systol=0)
 
virtual Int_t GetNtasks () const
 
TString GetOutputRepository (const Char_t *taskname) const
 
virtual KVString GetReconstructedEventClassName () const
 
KVDataRepositoryGetRepository () const
 Get pointer to data repository in which dataset is stored. More...
 
std::optional< TDatimeGetRunfileDate (const KVString &type, const run_index_t &run)
 
KVString GetRunfileName (const KVString &type, const run_index_t &run) const
 
run_index_list GetRunList (const Char_t *data_type, const KVDBSystem *sys=0) const
 
run_index_list GetRunList_DateSelection (const Char_t *type, TDatime *min=0, TDatime *max=0)
 
run_index_list GetRunList_StageSelection (const Char_t *other_type, const Char_t *base_type, KVDBSystem *sys=0, Bool_t OnlyCol=kFALSE)
 
run_index_list GetRunList_VersionSelection (const Char_t *type, const Char_t *version, KVDBSystem *sys=0)
 
run_index_list 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
 
void ls (Option_t *opt="") const override
 Print dataset information. More...
 
bool MakeAnalysisClass (const Char_t *task, const Char_t *classname)
 
bool MakeAnalysisClass (int task, const Char_t *classname)
 
TFileNewRunfile (const KVString &type, const run_index_t &run)
 
Bool_t OpenDataSetFile (const Char_t *filename, std::ifstream &file)
 
template<typename FileType >
FileType * OpenRunfile (const KVString &type, const run_index_t &run)
 
TObjectOpenRunfile (const KVString &type, const run_index_t &run)
 
void Print (Option_t *opt="") const override
 
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) override
 
void SetRepository (KVDataRepository *)
 Set pointer to data repository in which dataset is stored. More...
 
virtual void SetUserGroups (const Char_t *groups)
 
void UpdateAvailableRuns (const KVString &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...
 
void Clear (Option_t *opt="") override
 Clear object properties : name, type/title, number, label. More...
 
void Copy (TObject &) const override
 Make a copy of this object. More...
 
void Error (const char *method, const char *msgfmt,...) const override
 
const Char_tGetLabel () const
 
UInt_t GetNumber () const
 
virtual TObjectGetObject () const
 
virtual const Char_tGetType () 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 ()
 
KVBaseoperator= (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)
 
void Warning (const char *method, const char *msgfmt,...) const override
 
- 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 ()
 
TObjectClone (const char *newname="") const override
 
Int_t Compare (const TObject *obj) const override
 
virtual void FillBuffer (char *&buffer)
 
const char * GetName () const override
 
const char * GetTitle () const override
 
ULong_t Hash () const override
 
TClassIsA () const override
 
Bool_t IsSortable () const override
 
TNamedoperator= (const TNamed &rhs)
 
virtual void SetNameTitle (const char *name, const char *title)
 
virtual void SetTitle (const char *title="")
 
virtual Int_t Sizeof () const
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- 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 TObjectDrawClone (Option_t *option="") const
 
virtual void Dump () const
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual Option_tGetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual Option_tGetOption () 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)
 
Bool_t IsDestructed () const
 
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 *vp)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, void *vp)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (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)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
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 Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=nullptr, 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 KVString &class_name, KVString &imp_file, KVString &dec_file, const KVString &dir_name=".")
 
static Bool_t FindExecutable (TString &exec, const Char_t *path="$(PATH)")
 
static const Char_tFindFile (const Char_t *search, TString &wfil)
 
static const Char_tGetBINDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetDATABASEFilePath ()
 
static const Char_tGetDATADIRFilePath (const Char_t *namefile="")
 
static KVString GetDataSetEnv (const KVString &dataset, const KVString &type, const char *defval)
 
template<typename ValType >
static ValType GetDataSetEnv (const KVString &dataset, const KVString &type, const ValType &defval)
 
static const Char_tGetETCDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetExampleFilePath (const Char_t *library, const Char_t *namefile)
 Return full path to example file for given library (="KVMultiDet", "BackTrack", etc.) More...
 
static const Char_tGetINCDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetKVBuildDate ()
 Returns KaliVeda build date. More...
 
static const Char_tGetKVBuildDir ()
 Returns top-level directory used for build. More...
 
static const Char_tGetKVBuildTime ()
 Returns KaliVeda build time. More...
 
static const Char_tGetKVBuildType ()
 Returns KaliVeda build type (cmake build: Release, Debug, RelWithDebInfo, ...) More...
 
static const Char_tGetKVBuildUser ()
 Returns username of person who performed build. More...
 
static int GetKVMajorVersion ()
 
static int GetKVMinorVersion ()
 
static const Char_tGetKVSourceDir ()
 Returns top-level directory of source tree used for build. More...
 
static const Char_tGetKVVersion ()
 Returns KaliVeda version string. More...
 
static const Char_tGetLIBDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetListOfPlugins (const Char_t *base)
 
static const Char_tGetListOfPluginURIs (const Char_t *base)
 
static const Char_tGetPluginURI (const Char_t *base, const Char_t *plugin)
 
static void GetTempFileName (TString &base)
 
static const Char_tGetTEMPLATEDIRFilePath (const Char_t *namefile="")
 
static const Char_tGetWORKDIRFilePath (const Char_t *namefile="")
 
static const Char_tgitBranch ()
 Returns git branch of sources. More...
 
static const Char_tgitCommit ()
 Returns last git commit of sources. More...
 
static void InitEnvironment ()
 
static bool is_gnuinstall ()
 
static Bool_t IsEnvInit ()
 
static Bool_t IsThisAPlugin (const TString &uri, TString &base)
 
static TPluginHandlerLoadPlugin (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_tWorkingDirectory ()
 
- Static Public Member Functions inherited from TNamed
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 

Private Types

enum  { kAvailable = BIT(14) }
 

Private Member Functions

virtual const Char_tGetBaseFileName (const Char_t *type, const run_index_t &run) const
 
TString GetDBFileName () const
 
TString GetDBName () const
 
TString GetFullPathToDB () const
 
bool make_analysis_class (const KVDataAnalysisTask *, const Char_t *classname)
 
TObjectopen_runfile (const KVString &type, const run_index_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
 Check configuration variables to see if the task parameters have been "tweaked" for the dataset. More...
 
void SetDBName (const Char_t *name)
 
virtual void WriteDBFile (const Char_t *full_path_to_dbfile) const
 Write the database to disk. More...
 

Private Attributes

KVUniqueNameList fAllTasks
 all data analysis tasks for this dataset More...
 
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...
 
KVExpDBfDataBase
 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< TFilefDBase
 file containing database More...
 
Bool_t fDBBuild
 has the database been built by us ? More...
 
TString fDBName
 name of database More...
 
KVDataRepositoryfRepository
 repository in which dataset is stored More...
 
KVUniqueNameList fTasks
 possible data analysis tasks for this dataset (available data only) More...
 
TString fUserGroups
 list of user groups allowed to read data More...
 

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
 
- 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 inherited from TNamed
TString fName
 
TString fTitle
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
kAvailable 

Definition at line 148 of file KVDataSet.h.

Constructor & Destructor Documentation

◆ KVDataSet()

KVDataSet::KVDataSet ( )

Default constructor.

Definition at line 35 of file KVDataSet.cpp.

Member Function Documentation

◆ AddAvailableDataType()

void KVDataSet::AddAvailableDataType ( const Char_t type)
virtual

Definition at line 490 of file KVDataSet.cpp.

◆ cd()

void KVDataSet::cd ( ) const

Makes this dataset the "currently active" or default dataset.

At the same time, the database and data repository associated with this dataset also become the "currently active" ones:

global pointer represents base class
gDataSet active dataset KVDataSet
gExpDB associated experimental database KVExpDB
gDataRepository repository containing runfiles KVDataRepository

Definition at line 692 of file KVDataSet.cpp.

◆ CheckAvailable()

void KVDataSet::CheckAvailable ( )
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 current data repository. If so, we proceed to check for the existence of sudirectories corresponding to any of the datatypes associated with the dataset.

Definition at line 443 of file KVDataSet.cpp.

◆ CheckMultiRunfiles()

void KVDataSet::CheckMultiRunfiles ( const Char_t data_type)

Check all runs for a given datatype and make sure that only one version exists for each runfile. If not, we print a report on the runfiles which occur multiple times, with the associated date and file name.

Definition at line 1324 of file KVDataSet.cpp.

◆ CheckRunfileAvailable()

Bool_t KVDataSet::CheckRunfileAvailable ( const KVString type,
const run_index_t run 
)

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 870 of file KVDataSet.cpp.

◆ CheckRunfileUpToDate() [1/2]

Bool_t KVDataSet::CheckRunfileUpToDate ( const KVString data_type,
const run_index_t run,
const KVString 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 1473 of file KVDataSet.cpp.

◆ CheckRunfileUpToDate() [2/2]

Bool_t KVDataSet::CheckRunfileUpToDate ( const KVString data_type,
const run_index_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 1439 of file KVDataSet.cpp.

◆ CheckUpToDate()

void KVDataSet::CheckUpToDate ( const Char_t data_type,
const Char_t other_repos 
)

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 1498 of file KVDataSet.cpp.

◆ CheckUserCanAccess()

Bool_t KVDataSet::CheckUserCanAccess ( )
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 1267 of file KVDataSet.cpp.

◆ CleanMultiRunfiles()

void KVDataSet::CleanMultiRunfiles ( const Char_t data_type,
Bool_t  confirm = kTRUE 
)

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 1368 of file KVDataSet.cpp.

◆ CommitRunfile()

void KVDataSet::CommitRunfile ( const KVString type,
const run_index_t run,
TFile file 
)

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 1223 of file KVDataSet.cpp.

◆ CopyRunfilesFromRepository()

void KVDataSet::CopyRunfilesFromRepository ( const Char_t type,
const run_index_list &  runs,
const Char_t destdir 
)

Copies the runfiles of given "type" into the local directory "destdir".

Definition at line 2001 of file KVDataSet.cpp.

◆ CopyRunfilesToRepository()

void KVDataSet::CopyRunfilesToRepository ( const Char_t type,
const run_index_list &  runs,
const Char_t destrepo 
)

Copies the runfiles of given "type" from the data repository associated with this dataset into the local repository "destrepo".

Definition at line 2021 of file KVDataSet.cpp.

◆ DataBaseNeedsUpdate()

Bool_t KVDataSet::DataBaseNeedsUpdate ( ) const
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 1907 of file KVDataSet.cpp.

◆ DataBaseUpdateInProgress()

Bool_t KVDataSet::DataBaseUpdateInProgress ( ) const
inline

Definition at line 170 of file KVDataSet.h.

◆ DeleteRunfile()

void KVDataSet::DeleteRunfile ( const KVString type,
const run_index_t run,
Bool_t  confirm = kTRUE 
)

Delete the file for the given run/index 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 988 of file KVDataSet.cpp.

◆ DeleteRunfiles()

void KVDataSet::DeleteRunfiles ( const Char_t type,
const run_index_list &  nl = {},
Bool_t  confirm = kTRUE 
)

Delete files corresponding to a list of runs/index 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 1035 of file KVDataSet.cpp.

◆ FindDataSetFile() [1/2]

Bool_t KVDataSet::FindDataSetFile ( const Char_t filename)

Find a file in the dataset directory (given by GetDataSetDir()) Returns kTRUE if found, kFALSE if not

Definition at line 1861 of file KVDataSet.cpp.

◆ FindDataSetFile() [2/2]

Bool_t KVDataSet::FindDataSetFile ( const TString dataset,
const Char_t filename 
)
static

Static method to find a file in the dataset directory (given by GetDataSetDir()) Returns kTRUE if found, kFALSE if not

Definition at line 1845 of file KVDataSet.cpp.

◆ GetAnalysisTask() [1/2]

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")
1. Event reconstruction from raw data (raw->recon)
2. Analysis of raw data
3. Identification of reconstructed events (recon->ident)
4. Analysis of reconstructed events (recon)
5. Analysis of partially identified & calibrated reconstructed events (ident)
6. Analysis of fully calibrated physical data (root)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
void Print(Option_t *opt="") const override
Definition: KVDataSet.cpp:400

Then the following will occur:

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)
Define and manage data analysis tasks.
void Print(Option_t *opt="") const override
KVDataAnalysisTask * GetAnalysisTask(Int_t) const
Definition: KVDataSet.cpp:556

case-insensitive search for matches in list based on 'title' attribute

Definition at line 1627 of file KVDataSet.cpp.

◆ GetAnalysisTask() [2/2]

KVDataAnalysisTask * KVDataSet::GetAnalysisTask ( Int_t  k) const

Return kth analysis task in list of available tasks.

Parameters
[in]ktask number in range [1, GetNtasks()]. Corresponds to the number shown next to the title of the task when Print("tasks") is called

Definition at line 556 of file KVDataSet.cpp.

◆ GetAnalysisTaskAny()

KVDataAnalysisTask * KVDataSet::GetAnalysisTaskAny ( const Char_t keywords) const
virtual

This method returns 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, returns nullptr

Definition at line 1881 of file KVDataSet.cpp.

◆ GetAvailableDataTypes()

virtual const Char_t* KVDataSet::GetAvailableDataTypes ( ) const
inlinevirtual
Returns
string containing names of all types of data which are available for dataset

Definition at line 197 of file KVDataSet.h.

◆ GetAvailableRunsFile()

KVAvailableRunsFile * KVDataSet::GetAvailableRunsFile ( const Char_t type) const
Parameters
typename of data type ('raw', 'recon', ...)
Returns
pointer to available runs file object for given data type
Note
if no data repository is associated with dataset, returns nullptr

Definition at line 51 of file KVDataSet.cpp.

◆ GetBaseFileName()

const Char_t * KVDataSet::GetBaseFileName ( const Char_t type,
const run_index_t run 
) const
privatevirtual

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]: run%R.dat
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
constexpr Double_t R()

R will be replaced with the run number

IF the format contains 'D' it will be replaced with the current date and time

Any index will be appended at the end: ".index"

Definition at line 903 of file KVDataSet.cpp.

◆ GetDataBase()

KVExpDB * KVDataSet::GetDataBase ( Option_t opt = "") const
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).

Parameters
[in]optif opt="update": force regeneration of the database from source files in dataset directory

Definition at line 285 of file KVDataSet.cpp.

◆ GetDataPathSubdir()

virtual const Char_t* KVDataSet::GetDataPathSubdir ( ) const
inlinevirtual
Returns
name of top-level directory in data repository used to store data files for this dataset

Definition at line 185 of file KVDataSet.h.

◆ GetDataSetDir()

const Char_t * KVDataSet::GetDataSetDir ( ) const
Returns
full path to directory containing database and calibration/identification parameters etc. for this dataset.

Definition at line 670 of file KVDataSet.cpp.

◆ GetDataSetEnv() [1/3]

KVString KVDataSet::GetDataSetEnv ( const Char_t type,
Char_t defval 
) const
inline

Will look for resource value "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 269 of file KVDataSet.h.

◆ GetDataSetEnv() [2/3]

KVString KVDataSet::GetDataSetEnv ( const Char_t type,
const Char_t defval = "" 
) const
inline

Will look for resource value "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 261 of file KVDataSet.h.

◆ GetDataSetEnv() [3/3]

template<typename ValType >
ValType KVDataSet::GetDataSetEnv ( const Char_t type,
const ValType &  defval 
) const
inline

Will look for resource value "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 252 of file KVDataSet.h.

◆ GetDataTypeSubdir()

KVString KVDataSet::GetDataTypeSubdir ( const Char_t type) const
inline
Returns
name to be used for subdirectory corresponding to given data type

Definition at line 190 of file KVDataSet.h.

◆ GetDBFileName()

TString KVDataSet::GetDBFileName ( ) const
private

Returns name of file containing database for dataset.

This is fixed as DataBase.root.M.mm where

  • M is the current major version number
  • m is the current minor version number

(fixed to be consistent with CMake function INSTALL_KALIVEDA_DATASETS which sets up the Makefile for each dataset which automatically triggers rebuilding of the ROOT file when source files change: thus we must have the right file name!)

This in order to avoid problems if several different versions of KaliVeda use the same working directory (in user's $HOME/.kaliveda) to write the database files, which are often incompatible between versions

Definition at line 83 of file KVDataSet.cpp.

◆ GetDBName()

TString KVDataSet::GetDBName ( ) const
private
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 112 of file KVDataSet.cpp.

◆ GetFullPathToDataSetFile() [1/2]

TString KVDataSet::GetFullPathToDataSetFile ( const Char_t filename)

Find a file in the dataset directory (given by GetDataSetDir()) Returns full path to file if found, empty string if not

Definition at line 1811 of file KVDataSet.cpp.

◆ GetFullPathToDataSetFile() [2/2]

TString KVDataSet::GetFullPathToDataSetFile ( const TString dataset,
const Char_t filename 
)
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 1825 of file KVDataSet.cpp.

◆ GetFullPathToDB()

TString KVDataSet::GetFullPathToDB ( ) const
private
Returns
full path to file where database is written on disk

Definition at line 153 of file KVDataSet.cpp.

◆ GetFullPathToRunfile()

TString KVDataSet::GetFullPathToRunfile ( const KVString type,
const run_index_t run 
) const
Returns
full path to file containing data of given datatype for given run/index of this dataset
Note
only works for available run files, if their is no file in the repository for this run, the returned path will be empty

Definition at line 794 of file KVDataSet.cpp.

◆ GetListOfAvailableSystems() [1/2]

std::unique_ptr< TList > KVDataSet::GetListOfAvailableSystems ( const Char_t datatype,
KVDBSystem systol = 0 
)
virtual
Returns
list of available systems or runfiles for this dataset and the given datatype
Parameters
[in]systolwhen systol=nullptr (default), return list of available systems. if pointer to system, return list of available runfiles for the given system

If no systems are defined for the dataset then we return a list of available runfiles for the given datatype

Definition at line 573 of file KVDataSet.cpp.

◆ GetListOfAvailableSystems() [2/2]

std::unique_ptr< TList > KVDataSet::GetListOfAvailableSystems ( KVDataAnalysisTask datan,
KVDBSystem systol = 0 
)
virtual
Returns
list of available systems or runfiles for this dataset and the prerequisite datatype for the given analysis task
Parameters
[in]systolwhen systol=nullptr (default), return list of available systems. if pointer to system, return list of available runfiles for the given system

If no systems are defined for the dataset then we return a list of available runfiles for the given datatype

Definition at line 598 of file KVDataSet.cpp.

◆ GetNtasks()

Int_t KVDataSet::GetNtasks ( ) const
virtual

Returns the number of tasks associated to dataset which are compatible with the available data

Definition at line 541 of file KVDataSet.cpp.

◆ GetOutputRepository()

TString KVDataSet::GetOutputRepository ( const Char_t taskname) const

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]

  • this means that all tasks carried out on data in [repository] will have their output files placed in [other repository]

[taskname].DataAnalysisTask.OutputRepository: [other repository]

  • this means that for [taskname], any output files will be placed in [other repository]

[dataset].[taskname].DataAnalysisTask.OutputRepository: [other repository]

  • this means that for given [dataset] & [taskname], any output files will be placed in [other repository]

Definition at line 1971 of file KVDataSet.cpp.

◆ GetReconstructedEventClassName()

virtual KVString KVDataSet::GetReconstructedEventClassName ( ) const
inlinevirtual
Returns
the name of the KVEvent-derived container class used to store reconstructed events for this dataset

This is usually KVReconstructedEvent, but can be modified for a given dataset by defining the following configuration variable:

[dataset name].ReconstructedEventClassName: [name of class]
char name[80]

The default value (if no variable defined) is KVReconstructedEvent.

Definition at line 357 of file KVDataSet.h.

◆ GetRepository()

KVDataRepository * KVDataSet::GetRepository ( ) const

Get pointer to data repository in which dataset is stored.

Definition at line 1310 of file KVDataSet.cpp.

◆ GetRunfileDate()

std::optional< TDatime > KVDataSet::GetRunfileDate ( const KVString type,
const run_index_t run 
)
Returns
date of file containing data of given datatype for given run/index of this dataset
Note
only works for available runfiles, if there is no file in the repository for this run/index, an error will be printed and std::optional will not contain a value

Definition at line 838 of file KVDataSet.cpp.

◆ GetRunfileName()

KVString KVDataSet::GetRunfileName ( const KVString type,
const run_index_t run 
) const
Returns
name of file containing data of given datatype for given run/index of this dataset
Note
only works for available run files, if there is no file in the repository for this run, the returned path will be empty

Definition at line 814 of file KVDataSet.cpp.

◆ GetRunList()

run_index_list KVDataSet::GetRunList ( const Char_t data_type,
const KVDBSystem system = 0 
) const

Returns list of all files available for given "data_type"

If a pointer to a reaction system is given, only files for the given system will be included in the list.

Definition at line 1576 of file KVDataSet.cpp.

◆ GetRunList_DateSelection()

run_index_list 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 list

Definition at line 1066 of file KVDataSet.cpp.

◆ GetRunList_StageSelection()

run_index_list 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 1128 of file KVDataSet.cpp.

◆ GetRunList_VersionSelection()

run_index_list 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 1182 of file KVDataSet.cpp.

◆ GetUpdatableRuns()

run_index_list 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 1541 of file KVDataSet.cpp.

◆ HasCalibIdentInfos()

Bool_t KVDataSet::HasCalibIdentInfos ( ) const
inline
Returns
kTRUE if calibration/identification parameters are available for this dataset

Definition at line 376 of file KVDataSet.h.

◆ HasDataType()

virtual Bool_t KVDataSet::HasDataType ( const Char_t data_type) const
inlinevirtual
Returns
kTRUE if data files of the given type are stored in the data repository
Parameters
data_typetype of data. if "*", this method always returns kTRUE

Definition at line 218 of file KVDataSet.h.

◆ IsAvailable()

virtual Bool_t KVDataSet::IsAvailable ( ) const
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 207 of file KVDataSet.h.

◆ ls()

void KVDataSet::ls ( Option_t opt = "") const
overridevirtual

Print dataset information.

Reimplemented from TNamed.

Definition at line 377 of file KVDataSet.cpp.

◆ make_analysis_class()

bool KVDataSet::make_analysis_class ( const KVDataAnalysisTask dat,
const Char_t classname 
)
private

Definition at line 1667 of file KVDataSet.cpp.

◆ MakeAnalysisClass() [1/2]

bool KVDataSet::MakeAnalysisClass ( const Char_t task,
const Char_t classname 
)

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 1714 of file KVDataSet.cpp.

◆ MakeAnalysisClass() [2/2]

bool KVDataSet::MakeAnalysisClass ( int  task,
const Char_t classname 
)

Create a skeleton analysis class to be used for analysis of the data belonging to this dataset.

task = index of analysis task as shown in KVDataSet::Print("tasks") classname = name of new analysis class

Definition at line 1750 of file KVDataSet.cpp.

◆ NewRunfile()

TFile * KVDataSet::NewRunfile ( const KVString type,
const run_index_t run 
)

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 963 of file KVDataSet.cpp.

◆ open_runfile()

TObject * KVDataSet::open_runfile ( const KVString type,
const run_index_t run 
)
private

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

SPECIAL CASE: MFM data with EBYEDAT frames

If the variable

[dataset].MFM.WithEbyedat: yes

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

[dataset].MFM.EbyedatActionsExpName: [expname]

is set, then we use the same ACTIONS file for all runs, with name ACTIONS_[expname].CHC_PAR

Definition at line 742 of file KVDataSet.cpp.

◆ OpenDataBase()

void KVDataSet::OpenDataBase ( Option_t opt = "") const
privatevirtual

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()).

Parameters
[in]optif opt="UPDATE" we force rebuilding of the database
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 319 of file KVDataSet.cpp.

◆ OpenDataSetFile() [1/2]

Bool_t KVDataSet::OpenDataSetFile ( const Char_t filename,
std::ifstream &  file 
)

◆ OpenDataSetFile() [2/2]

static Bool_t KVDataSet::OpenDataSetFile ( const TString dataset,
const Char_t filename,
std::ifstream &  file 
)
static

◆ OpenDBFile()

void KVDataSet::OpenDBFile ( const Char_t full_path_to_dbfile) const
privatevirtual

Open the database from a file on disk.

Definition at line 127 of file KVDataSet.cpp.

◆ OpenRunfile() [1/2]

template<typename FileType >
FileType* KVDataSet::OpenRunfile ( const KVString type,
const run_index_t run 
)
inline

Open a data file associated with the dataset

Parameters
typetype of data (='raw', 'recon', ...)
runrun number and file index of file to open
Returns
pointer to object used to open/read file, cast to type FileType

Example of use: open GANIL MFM format raw data file with index 3 of run 50:

auto raw_file = gDataSet->OpenRunfile<KVMFMDataFileReader>("raw", {50,3});
raw_file->GetRunInfos().Print();
Read MFM format acquisition data.

Definition at line 282 of file KVDataSet.h.

◆ OpenRunfile() [2/2]

TObject* KVDataSet::OpenRunfile ( const KVString type,
const run_index_t run 
)
inline

Open a data file associated with the dataset

Parameters
typetype of data (='raw', 'recon', ...)
runrun number and file index of file to open
Returns
base pointer to object used to open/read file

Example of use: open generic raw data file with index 3 of run 50:

auto raw_file = (KVRawDataReader*)gDataSet->OpenRunfile("raw", {50,3});
raw_file->GetRunInfos().Print();

Definition at line 298 of file KVDataSet.h.

◆ Print()

void KVDataSet::Print ( Option_t opt = "") const
overridevirtual

Print dataset information

param[in] opt select optional output formats:

  • if string contains "tasks", print numbered list of tasks that can be performed
  • if string contains "data", print list of available data types

Reimplemented from KVBase.

Definition at line 400 of file KVDataSet.cpp.

◆ SaveDataBase()

void KVDataSet::SaveDataBase ( ) const
virtual

Write the experiment database for this dataset to disk (ROOT file), creating and setting permissions for any required directories

Definition at line 203 of file KVDataSet.cpp.

◆ SetAnalysisTasks()

void KVDataSet::SetAnalysisTasks ( const KVSeqCollection task_list)
virtual

Add to fAllTasks list any data analysis task in list 'task_list'

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 507 of file KVDataSet.cpp.

◆ SetAvailable()

virtual void KVDataSet::SetAvailable ( Bool_t  yes = kTRUE)
inlinevirtual

Definition at line 212 of file KVDataSet.h.

◆ SetDataPathSubdir()

virtual void KVDataSet::SetDataPathSubdir ( const Char_t s)
inlinevirtual

Definition at line 181 of file KVDataSet.h.

◆ SetDataSetSpecificTaskParameters()

void KVDataSet::SetDataSetSpecificTaskParameters ( KVDataAnalysisTask t) const
private

Check configuration variables to see if the task parameters have been "tweaked" for the dataset.

Definition at line 178 of file KVDataSet.cpp.

◆ SetDBName()

void KVDataSet::SetDBName ( const Char_t name)
inlineprivate

Definition at line 159 of file KVDataSet.h.

◆ SetName()

void KVDataSet::SetName ( const char *  name)
overridevirtual

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]/

This allows to use one dataset as an alias for another, by setting DataSet.Directory to the name of an existing dataset

Reimplemented from TNamed.

Definition at line 632 of file KVDataSet.cpp.

◆ SetRepository()

void KVDataSet::SetRepository ( KVDataRepository dr)

Set pointer to data repository in which dataset is stored.

Definition at line 1298 of file KVDataSet.cpp.

◆ SetUserGroups()

virtual void KVDataSet::SetUserGroups ( const Char_t groups)
inlinevirtual

Definition at line 203 of file KVDataSet.h.

◆ UpdateAvailableRuns()

void KVDataSet::UpdateAvailableRuns ( const KVString type)

Update list of available runs for given data 'type' check data type is available

Definition at line 941 of file KVDataSet.cpp.

◆ WriteDBFile()

void KVDataSet::WriteDBFile ( const Char_t full_path_to_dbfile) const
privatevirtual

Write the database to disk.

Definition at line 255 of file KVDataSet.cpp.

Friends And Related Function Documentation

◆ KVAvailableRunsFile

friend class KVAvailableRunsFile
friend

Definition at line 132 of file KVDataSet.h.

◆ KVDataSetManager

friend class KVDataSetManager
friend

Definition at line 133 of file KVDataSet.h.

Member Data Documentation

◆ fAllTasks

KVUniqueNameList KVDataSet::fAllTasks
private

all data analysis tasks for this dataset

Definition at line 140 of file KVDataSet.h.

◆ fAvailableRuns

KVList KVDataSet::fAvailableRuns
mutableprivate

list of KVAvailableRunsFile objects used to read infos on available runs

Definition at line 147 of file KVDataSet.h.

◆ fCalibDir

TString KVDataSet::fCalibDir
private

directory containing database, calibration, identification parameters etc. for dataset

Definition at line 142 of file KVDataSet.h.

◆ fDataBase

KVExpDB* KVDataSet::fDataBase
mutableprivate

pointer to dataset's database

Definition at line 146 of file KVDataSet.h.

◆ fDataBaseUpdateInProgress

Bool_t KVDataSet::fDataBaseUpdateInProgress = false
mutableprivate

Definition at line 168 of file KVDataSet.h.

◆ fDatatypes

TString KVDataSet::fDatatypes
private

list of types of data which are available for this dataset

Definition at line 139 of file KVDataSet.h.

◆ fDBase

std::unique_ptr<TFile> KVDataSet::fDBase
mutableprivate

file containing database

Definition at line 144 of file KVDataSet.h.

◆ fDBBuild

Bool_t KVDataSet::fDBBuild
private

has the database been built by us ?

Definition at line 143 of file KVDataSet.h.

◆ fDBName

TString KVDataSet::fDBName
private

name of database

Definition at line 145 of file KVDataSet.h.

◆ fRepository

KVDataRepository* KVDataSet::fRepository
private

repository in which dataset is stored

Definition at line 138 of file KVDataSet.h.

◆ fTasks

KVUniqueNameList KVDataSet::fTasks
private

possible data analysis tasks for this dataset (available data only)

Definition at line 141 of file KVDataSet.h.

◆ fUserGroups

TString KVDataSet::fUserGroups
private

list of user groups allowed to read data

Definition at line 151 of file KVDataSet.h.