4 #include "KVExpSetUpDB.h"
6 #include "KVMultiDetArray.h"
87 catch (std::runtime_error& rte) {
91 if (
TString(rte.what()) !=
"run infos file not found")
throw;
93 Info(
"Build",
"No informations on dataset runs available");
94 Info(
"Build",
"Dummy database runs numbered from 1 to 100 will be created");
95 for (
int i = 1; i <= 100; ++i) {
129 if (runinfos ==
"")
return;
131 Info(
"ReadScalerInfos",
"Reading scaler infos from %s", runinfos.
Data());
132 TFile runinfos_file(runinfos);
135 while ((run = (
KVDBRun*)it_run())) {
137 for (
auto& rf : file_list) {
141 int npar = scalist->GetNpar();
142 for (
int i = 0; i < npar; i += 2) {
143 TString parname = scalist->GetParameter(i)->GetName();
167 Info(
"ReadParameterFiles",
"Using file %s", path.Data());
220 Info(
"LoadParameters",
"%s does not exist or not found",
filename.Data());
224 Info(
"LoadParameters",
"file : %s found", fullpath.
Data());
250 for (
auto& run : runlist) {
307 throw std::runtime_error(
"run infos file not found");
309 int run_num{-1}, runfile_index{-1};
311 Info(
"FillRunsTable",
"Reading run infos from %s", runinfos.
Data());
312 TFile runinfos_file(runinfos);
317 while ((run_key = (
TKey*)it())) {
326 if (!runfile_index) run_index =
run_index_t{run_num, std::nullopt};
327 else run_index =
run_index_t{run_num, runfile_index};
338 for (
auto index : index_list) {
372 runfile->SetSize(run->
GetValue64bit(
"Size") / 1024. / 1024.);
374 runfile->SetSize(run->
GetIntValue(
"Size") / 1024. / 1024.);
387 Info(
"FillRunsTable",
"Reading bad runfile infos from %s", badinfos.
Data());
393 auto br = all.
Next();
396 Error(
"FillRunsTable",
"%s:BadFiles.All contains run number %d which is not in %s",
397 badinfos.
Data(), br, runinfos.
Data());
398 throw std::runtime_error(
Form(
"inconsistency between %s:BadFiles.All and %s",
401 dbrun->SetBadAllRunFiles();
405 while (!
first.End()) {
406 auto br =
first.Next();
409 Error(
"FillRunsTable",
"%s:BadFiles.First contains run number %d which is not in %s",
410 badinfos.
Data(), br, runinfos.
Data());
411 throw std::runtime_error(
Form(
"inconsistency between %s:BadFiles.First and %s",
414 dbrun->GetFirstFile().SetBad();
417 for (
auto& ri : singles) {
421 catch (std::exception&
e) {
422 Error(
"FillRunsTable",
"%s:BadFiles.Singles contains run_index %s which is unknown",
423 badinfos.
Data(), ri.as_string().Data());
429 Int_t global_runfile_number = 0;
432 auto ril =
r->GetRunIndexList();
433 for (
auto& ri : ril) {
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 filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
char * Form(const char *fmt,...)
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
virtual Int_t GetNumber() const
A single raw data file associated with an experimental run ,,.
void SetScaler64(const Char_t *name, ULong64_t val)
Set value for 64-bit scaler with the given name for this run.
void Set(const Char_t *param, Double_t val)
Set numerical (non-scaler) characteristic of run.
void SetGlobalRunFileNumber(Int_t r)
void SetBad(Bool_t is_bad=kTRUE)
Description of an experimental run in database ,,.
void AddRunFile(KVDBRunFile *rf)
void SetNumber(Int_t n) override
const run_index_list & GetRunIndexList() const
KVDBRunFile & GetRunFile(const run_index_t &run_index)
TString GetFullPathToDataSetFile(const Char_t *filename) const
static Bool_t FindDataSetFile(const TString &dataset, const Char_t *filename)
Base class to describe database of an experiment ,,.
KVNumberList fListOfRuns
list of all run numbers
std::map< int, run_index_t > fMapGlobRunFileNumberToRunIndex
cannot be saved, no streamer for run_index_t
run_index_list SetRunIndexListFromString(const TString &) const
virtual void ReadComments()
virtual void ReadSystemList()
KVDBRun * GetDBRun(Int_t number) const
virtual KVSeqCollection * GetRuns() const
bool with_index_multiplier
const KVDBRunFile & GetDBRunFile(const run_index_t &r) const
Bool_t HasRawFilesWithIndex() const
TString fDataSet
the name of the dataset to which this database is associated
Calibration database for experiments using coupled detector arrays.
void LoadParameters(const KVString &)
KVExpSetUpDB()
Default constructor.
void ReadParameterFiles()
void Build(bool minimal=false) override
virtual ~KVExpSetUpDB()
Destructor.
Handle reading columns of numeric data in text files.
KVString GetCurrentLine()
ReadStatus ReadLine(const KVString &pattern="")
Bool_t OpenFileToRead(const KVString &filename)
Extended TList class which owns its objects by default.
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray", KVExpDB *db=nullptr)
virtual void MakeCalibrationTables(KVExpDB *)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Int_t GetIntValue(const Char_t *name) const
Bool_t HasValue64bit(const Char_t *name) const
ULong64_t GetValue64bit(const Char_t *name) const
const Char_t * GetStringValue(const Char_t *name) const
Strings used to represent a set of ranges of values.
void Add(TObject *obj) override
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
T * Get(const char *namecycle)
TKey * GetKey(const char *name, Short_t cycle=9999) const override
TList * GetListOfKeys() const override
THashList * GetTable() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
virtual const char * GetClassName() const
virtual TObject * ReadObj()
const char * GetName() const override
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Info(const char *method, const char *msgfmt,...) const
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
List of runfiles specified by run number and file index ,.
Specifies a runfile according to run number and file index ,.