6#include "KVNumberList.h"
8#include <KVFileReader.h>
10#include "KVUnownedList.h"
25 fRuns = AddTable(
"Runs",
"List of available runs");
26 fRuns->SetDefaultFormat(
"Run %d");
27 fSystems = AddTable(
"Systems",
"List of available systems");
76 if (gExpDB ==
this) gExpDB =
nullptr;
95 for (
UInt_t ii = first_run; ii <= last_run; ii++) {
130 rec->AddLink(
"Runs", run);
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++) {
189 rec->AddLink(
"Runs", run);
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 !!!");
521 if (cal_file_name.IsNull())
return kFALSE;
524 if (!array_name.
IsNull()) {
525 cal_file_name.Prepend(
Form(
"%s.", array_name.
Data()));
561 printf(
"RUN\tSYSTEM\t\t\t\tTRIGGER\t\tEVENTS\t\tCOMMENTS\n");
562 printf(
"------------------------------------------------------------------------------------------------------------------\n");
567 printf(
"%4d\t%-30s\t%s\t\t%llu\t\t%s\n",
641 while ((dbr = (
KVDBRun*)next())) {
643 if ((last_run > 0 && dbr->
GetNumber() <= last_run)
644 || last_run == -1) total += dbr->
GetEvents();
660 Error(
"GetTotalEvents",
"No system with name : %s", system.
Data());
666 while ((dbr = (
KVDBRun*)it())) {
720 if (comments_file ==
"")
return;
723 Info(
"ReadComments",
"Reading run comments in file %s...", fullpath.
Data());
727 Error(
"ReadComments",
"Problem opening file %s", fullpath.
Data());
747 while (!lruns.
End()) {
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
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
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 Int_t GetNumber() const
Description of an experimental run in database ,,.
const Char_t * GetComments() const
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
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)
virtual ~KVExpDB()
Destructor.
virtual void ReadComments()
virtual void ReadSystemList()
KVDBTable * fRuns
table of runs
virtual KVSeqCollection * GetSystems() const
virtual void LinkRecordToRun(KVDBRecord *rec, Int_t run)
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 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)
virtual KVDBSystem * GetSystem(const Char_t *system) const
void SetDataSetDir(const Char_t *d)
static KVExpDB * MakeDataBase(const Char_t *name, const Char_t *datasetdir)
KVDBRun * GetDBRun(Int_t number) const
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
Bool_t FindCalibFile(const Char_t *type, TString &fullpath, const TString &array_name="") const
virtual KVSeqCollection * GetRuns() const
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
const char * GetName() const override
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 char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
unsigned long long ULong64_t