24 fRuns = AddTable(
"Runs",
"List of available runs");
25 fRuns->SetDefaultFormat(
"Run %d");
26 fSystems = AddTable(
"Systems",
"List of available systems");
94 for (
UInt_t ii = first_run; ii <= last_run; ii++) {
153 for (
UInt_t i = 0; i < rr_number; i++) {
169 Error(
"LinkListToRunRanges",
170 "NULL pointer passed for parameter TList");
174 Error(
"LinkListToRunRanges(TList*,UInt_t,UInt_t*)",
175 "The list is empty");
181 for (
UInt_t ru_ra = 0; ru_ra < rr_number; ru_ra++) {
182 UInt_t first_run = run_ranges[ru_ra][0];
183 UInt_t last_run = run_ranges[ru_ra][1];
184 for (
UInt_t i = first_run; i <= last_run; i++) {
204 Error(
"LinkListToRunRange",
205 "NULL pointer passed for parameter TList");
209 Error(
"LinkListToRunRange(TList*,KVNumberList)",
210 "The list is empty");
278 Info(
"ReadSystemList()",
"Reading Systems parameters ...");
282 char next_char = fin.peek();
283 while (next_char !=
'+' && fin.good()) {
285 next_char = fin.peek();
288 while (fin.good() && !fin.eof() && next_char ==
'+') {
292 next_char = fin.peek();
297 Error(
"ReadSystemList()",
"Could not open file %s",
305 while ((run = (
KVDBRun*)nextRun())) {
341 sysfile <<
"# " <<
GetDBEnv(
"Systems") <<
" file written by "
343 cout <<
GetDBEnv(
"Systems") <<
" file written by "
346 if (strcmp(sys->
GetName(),
"[unknown]")) {
393 rlistf <<
"# " <<
GetDBEnv(
"Runlist") <<
" file written by "
395 cout <<
GetDBEnv(
"Runlist") <<
" file written by "
402 while ((run = (
KVDBRun*) next_run())) {
409 Warning(
"WriteRunListFile()",
"run list is empty !!!");
531 printf(
"RUN\tSYSTEM\t\t\t\tTRIGGER\t\tEVENTS\t\tCOMMENTS\n");
532 printf(
"------------------------------------------------------------------------------------------------------------------\n");
537 printf(
"%4d\t%-30s\t%s\t\t%llu\t\t%s\n",
611 while ((dbr = (
KVDBRun*)next())) {
613 if ((last_run > 0 && dbr->
GetNumber() <= last_run)
614 || last_run == -1) total += dbr->
GetEvents();
630 Error(
"GetTotalEvents",
"No system with name : %s", system.
Data());
636 while ((dbr = (
KVDBRun*)it())) {
690 if (comments_file ==
"")
return;
693 Info(
"ReadComments",
"Reading run comments in file %s...", fullpath.
Data());
697 Error(
"ReadComments",
"Problem opening file %s", fullpath.
Data());
717 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 SearchAndOpenKVFile(const Char_t *name, std::ifstream &file, const Char_t *kvsubdir="", KVLockfile *locks=0)
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, 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 text files.
KVString GetCurrentLine()
TString GetReadPar(Int_t pos)
Bool_t OpenFileToRead(KVString filename)
void ReadLine(const Char_t *pattern)
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