4 #include "KVExpSetUpDB.h"
6 #include "KVMultiDetArray.h"
83 catch (std::runtime_error& rte) {
87 if (
TString(rte.what()) !=
"run infos file not found")
throw;
89 Info(
"Build",
"No informations on dataset runs available");
90 Info(
"Build",
"Dummy database runs numbered from 1 to 100 will be created");
91 for (
int i = 1; i <= 100; ++i) {
117 if (runinfos ==
"")
return;
119 Info(
"ReadScalerInfos",
"Reading scaler infos from %s", runinfos.
Data());
120 TFile runinfos_file(runinfos);
123 while ((run = (
KVDBRun*)it_run())) {
125 for (
auto& rf : file_list) {
129 int npar = scalist->GetNpar();
130 for (
int i = 0; i < npar; i += 2) {
131 TString parname = scalist->GetParameter(i)->GetName();
155 Info(
"ReadParameterFiles",
"Using file %s", path.Data());
208 Info(
"LoadParameters",
"%s does not exist or not found",
filename.Data());
212 Info(
"LoadParameters",
"file : %s found", fullpath.
Data());
238 for (
auto& run : runlist) {
295 throw std::runtime_error(
"run infos file not found");
297 int run_num{-1}, runfile_index{-1};
299 Info(
"FillRunsTable",
"Reading run infos from %s", runinfos.
Data());
300 TFile runinfos_file(runinfos);
305 while ((run_key = (
TKey*)it())) {
314 if (!runfile_index) run_index =
run_index_t{run_num, std::nullopt};
315 else run_index =
run_index_t{run_num, runfile_index};
326 for (
auto index : index_list) {
360 runfile->SetSize(run->
GetValue64bit(
"Size") / 1024. / 1024.);
362 runfile->SetSize(run->
GetIntValue(
"Size") / 1024. / 1024.);
375 Info(
"FillRunsTable",
"Reading bad runfile infos from %s", badinfos.
Data());
381 auto br = all.
Next();
384 Error(
"FillRunsTable",
"%s:BadFiles.All contains run number %d which is not in %s",
385 badinfos.
Data(), br, runinfos.
Data());
386 throw std::runtime_error(
Form(
"inconsistency between %s:BadFiles.All and %s",
389 dbrun->SetBadAllRunFiles();
393 while (!
first.End()) {
394 auto br =
first.Next();
397 Error(
"FillRunsTable",
"%s:BadFiles.First contains run number %d which is not in %s",
398 badinfos.
Data(), br, runinfos.
Data());
399 throw std::runtime_error(
Form(
"inconsistency between %s:BadFiles.First and %s",
402 dbrun->GetFirstFile().SetBad();
404 run_index_list singles(badfiles.
GetValue(
"BadFiles.Singles",
""));
405 for (
auto& ri : singles) {
409 catch (std::exception&
e) {
410 Error(
"FillRunsTable",
"%s:BadFiles.Singles contains run_index %s which is unknown",
411 badinfos.
Data(), ri.as_string().Data());
417 Int_t global_runfile_number = 0;
420 auto ril =
r->GetRunIndexList();
421 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)
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
run_index_list SetRunIndexListFromString(const TString &) const
virtual void ReadSystemList()
virtual void ReadComments()
KVDBRun * GetDBRun(Int_t number) const
virtual KVSeqCollection * GetRuns() const
bool with_index_multiplier
const KVDBRunFile & GetDBRunFile(const run_index_t &r) const
std::map< int, run_index_t > fMapGlobRunFileNumberToRunIndex
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()
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
Specifies a runfile according to run number and file index ,.