25 fRuns = AddTable(
"Runs",
"List of available runs");
26 fRuns->SetDefaultFormat(
"Run %d");
27 fSystems = AddTable(
"Systems",
"List of available systems");
95 for (
UInt_t ii = first_run; ii <= last_run; ii++) {
154 for (
UInt_t i = 0; i < rr_number; i++) {
170 Error(
"LinkListToRunRanges",
171 "NULL pointer passed for parameter TList");
175 Error(
"LinkListToRunRanges(TList*,UInt_t,UInt_t*)",
176 "The list is empty");
182 for (
UInt_t ru_ra = 0; ru_ra < rr_number; ru_ra++) {
183 UInt_t first_run = run_ranges[ru_ra][0];
184 UInt_t last_run = run_ranges[ru_ra][1];
185 for (
UInt_t i = first_run; i <= last_run; i++) {
205 Error(
"LinkListToRunRange",
206 "NULL pointer passed for parameter TList");
210 Error(
"LinkListToRunRange(TList*,KVNumberList)",
211 "The list is empty");
279 Info(
"ReadSystemList()",
"Reading Systems parameters ...");
283 char next_char = fin.peek();
284 while (next_char !=
'+' && fin.good()) {
286 next_char = fin.peek();
289 while (fin.good() && !fin.eof() && next_char ==
'+') {
293 next_char = fin.peek();
298 Error(
"ReadSystemList()",
"Could not open file %s",
306 while ((run = (
KVDBRun*)nextRun())) {
342 sysfile <<
"# " <<
GetDBEnv(
"Systems") <<
" file written by "
344 cout <<
GetDBEnv(
"Systems") <<
" file written by "
347 if (strcmp(sys->
GetName(),
"[unknown]")) {
394 rlistf <<
"# " <<
GetDBEnv(
"Runlist") <<
" file written by "
396 cout <<
GetDBEnv(
"Runlist") <<
" file written by "
403 while ((run = (
KVDBRun*) next_run())) {
410 Warning(
"WriteRunListFile()",
"run list is empty !!!");
532 printf(
"RUN\tSYSTEM\t\t\t\tTRIGGER\t\tEVENTS\t\tCOMMENTS\n");
533 printf(
"------------------------------------------------------------------------------------------------------------------\n");
538 printf(
"%4d\t%-30s\t%s\t\t%llu\t\t%s\n",
612 while ((dbr = (
KVDBRun*)next())) {
614 if ((last_run > 0 && dbr->
GetNumber() <= last_run)
615 || last_run == -1) total += dbr->
GetEvents();
631 Error(
"GetTotalEvents",
"No system with name : %s", system.
Data());
637 while ((dbr = (
KVDBRun*)it())) {
691 if (comments_file ==
"")
return;
694 Info(
"ReadComments",
"Reading run comments in file %s...", fullpath.
Data());
698 Error(
"ReadComments",
"Problem opening file %s", fullpath.
Data());
718 while (!lruns.
End()) {
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
static const Char_t * GetDataSetEnv(const Char_t *dataset, const Char_t *type, const Char_t *defval)
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
static Bool_t SearchAndOpenKVFile(const Char_t *name, KVSQLite::database &dbfile, const Char_t *kvsubdir="")
static TPluginHandler * LoadPlugin(const Char_t *base, const Char_t *uri="0")
Record folder for the database.
virtual Bool_t AddLink(const Char_t *key_name, KVDBRecord *rec, Bool_t linkback=kTRUE)
virtual Int_t GetNumber() const
Description of an experimental run in database ,.
ULong64_t GetEvents() const
void SetComments(const KVString &comments)
KVDBSystem * GetSystem() const
virtual void WriteRunListLine(std::ostream &, Char_t delim='|') const
const Char_t * GetTriggerString() const
const Char_t * GetComments() const
Database class used to store information on different colliding systems studied during an experiment.
virtual void Save(std::ostream &) const
void AddRun(KVDBRecord *)
virtual void Load(std::istream &)
virtual KVDBRecord * GetRecord(const Char_t *rec_name) const
Simple cross-referenced database structure.
Base class to describe database of an experiment ,.
void AddSystem(KVDBSystem *r)
Bool_t FindCalibFile(const Char_t *type, TString &fullpath) const
virtual ~KVExpDB()
Destructor.
virtual KVDBSystem * GetSystem(const Char_t *system) const
virtual void ReadComments()
virtual void ReadSystemList()
KVDBTable * fRuns
table of runs
virtual void LinkRecordToRun(KVDBRecord *rec, Int_t run)
KVDBRun * GetDBRun(Int_t number) const
virtual KVSeqCollection * GetRuns() const
TString GetCalibFileName(const Char_t *type) const
virtual void LinkListToRunRanges(TList *list, UInt_t rr_number, UInt_t run_ranges[][2])
Link the records contained in the list to the set of runs (see LinkRecordToRunRanges).
KVDBTable * fSystems
table of systems
virtual void PrintRuns(KVNumberList &) const
ULong64_t GetTotalEvents(int first_run, int last_run=-1) const
virtual KVSeqCollection * GetSystems() const
virtual void Save(const Char_t *)
TString fDBType
used by GetDBEnv
virtual void LinkRecordToRunRanges(KVDBRecord *rec, UInt_t rr_number, UInt_t run_ranges[][2])
virtual void LinkListToRunRange(TList *list, const KVNumberList &nl)
Link the records contained in the list to the set of runs (see LinkRecordToRunRanges).
void WriteSystemsFile() const
KVExpDB()
Default constructor.
const Char_t * GetDataSetDir() const
void init()
default initialisations
virtual void LinkRecordToRunRange(KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
void SetDataSetDir(const Char_t *d)
static KVExpDB * MakeDataBase(const Char_t *name, const Char_t *datasetdir)
void WriteRunListFile() const
virtual TString GetDBEnv(const Char_t *) const
Bool_t OpenCalibFile(const Char_t *type, std::ifstream &fs) const
TString fDataSet
the name of the dataset to which this database is associated
Handle reading columns of numeric data in text files.
KVString GetCurrentLine()
ReadStatus ReadLine(const KVString &pattern="")
Int_t GetNparRead() const
KVString GetReadPar(Int_t pos) const
Bool_t OpenFileToRead(const KVString &filename)
Strings used to represent a set of ranges of values.
virtual TObject * At(Int_t idx) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
virtual Int_t GetSize() const
const char * AsString() const
virtual const char * GetName() const
virtual const char * ClassName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
Longptr_t ExecPlugin(int nargs, const T &... params)
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
const char * Data() const
unsigned long long ULong64_t