REST-for-Physics
v2.3
Rare Event Searches ToolKit for Physics
|
Definition at line 82 of file TRestDataBase.h.
Public Member Functions | |
virtual DBTable | exec (std::string cmd) |
return a table from query std::string cmd More... | |
virtual int | get_lastrun () |
get the latest run id in database More... | |
virtual void | Initialize () |
default: read the dataURL file More... | |
virtual void | print (std::string cmd) |
print the table after query std::string cmd More... | |
virtual DBEntry | query_data (DBEntry info) |
virtual DBEntry | query_run (int runnumber) |
virtual DBFile | query_run_file (int runnumber, int fileid) |
return file of certain file id in certain run More... | |
virtual std::vector< DBFile > | query_run_files (int runnumber) |
return all the files of the run More... | |
virtual std::vector< int > | search_run (DBEntry info) |
search runs according to the run info. return a list of run numbers More... | |
virtual std::vector< int > | search_run_with_file (std::string filepattern) |
search runs according to the file name. return a list of run numbers More... | |
virtual int | set_data (DBEntry info, bool overwrite=true) |
add/update a new record of metadata in database More... | |
virtual int | set_run (DBEntry info, bool overwrite=true) |
add/update a run, with run info as struct DBEntry. returns the added run id More... | |
virtual int | set_runfile (int runnumber, std::string filename) |
add/update a runfile to the specified run More... | |
virtual void | test () |
test function More... | |
TRestDataBase () | |
default constructor, setting fConnectionString according to the env More... | |
~TRestDataBase () | |
destructor More... | |
Protected Attributes | |
std::string | fConnectionString |
std::vector< DBEntry > | fDataEntries |
TRestDataBase::TRestDataBase | ( | ) |
default constructor, setting fConnectionString according to the env
Definition at line 140 of file TRestDataBase.cxx.
|
inline |
destructor
Definition at line 91 of file TRestDataBase.h.
|
inlinevirtual |
return a table from query std::string cmd
Definition at line 100 of file TRestDataBase.h.
|
virtual |
get the latest run id in database
get the latest run in database
Get the latest run in database, by reading the file: $REST_USER_PATH/runNumber. Note that this file saves run number of the next run. So it returns The run number -1.
Definition at line 154 of file TRestDataBase.cxx.
|
virtual |
default: read the dataURL file
Definition at line 66 of file TRestDataBase.cxx.
|
inlinevirtual |
print the table after query std::string cmd
Definition at line 98 of file TRestDataBase.h.
|
virtual |
metadata management interface ////////////////////// return the piece of data in fMetadataEntries
The following specification of DBEntry's content means to match any: id <= 0, type == "" ,usr == "" ,tag == "" ,description == "" ,version == "". If all of them mean any, it will return a blank list.
Definition at line 209 of file TRestDataBase.cxx.
|
inlinevirtual |
run number management interface ////////////////////// return the run number of the run. If not exist, return 0
Definition at line 104 of file TRestDataBase.h.
|
inlinevirtual |
return file of certain file id in certain run
Definition at line 106 of file TRestDataBase.h.
|
inlinevirtual |
return all the files of the run
Definition at line 108 of file TRestDataBase.h.
|
inlinevirtual |
search runs according to the run info. return a list of run numbers
Definition at line 111 of file TRestDataBase.h.
|
inlinevirtual |
search runs according to the file name. return a list of run numbers
Definition at line 113 of file TRestDataBase.h.
|
inlinevirtual |
add/update a new record of metadata in database
Definition at line 127 of file TRestDataBase.h.
|
virtual |
add/update a run, with run info as struct DBEntry. returns the added run id
add a new run, with run info as struct DBEntry. returns the added run id
runs are added according to info.id of input DBEntry object: -1 --> do not add 0 --> append a new run in run list >0 --> directly use this run number, overwrite existing
It will write to the file: $REST_USER_PATH/runNumber is writable. The number written will be the next run number
The method in derived class shall follow this rule.
Definition at line 183 of file TRestDataBase.cxx.
|
inlinevirtual |
add/update a runfile to the specified run
Definition at line 121 of file TRestDataBase.h.
|
inlinevirtual |
test function
Definition at line 96 of file TRestDataBase.h.
|
protected |
Definition at line 85 of file TRestDataBase.h.
|
protected |
Definition at line 84 of file TRestDataBase.h.