4 #include "KVExpSetUpDB.h"
6 #include "KVMultiDetArray.h"
77 catch (std::runtime_error& rte) {
81 if(
TString(rte.what())!=
"run infos file not found")
throw;
83 Info(
"Build",
"No informations on dataset runs available");
84 Info(
"Build",
"Dummy database runs numbered from 1 to 100 will be created");
85 for (
int i = 1; i <= 100; ++i) {
110 if (runinfos ==
"")
return;
112 Info(
"ReadScalerInfos",
"Reading scaler infos from %s", runinfos.
Data());
113 TFile runinfos_file(runinfos);
116 while ((run = (
KVDBRun*)it_run())) {
120 for (
int i = 0; i < npar; i += 2) {
175 throw std::runtime_error(
"run infos file not found");
177 int run_num{-1}, runfile_index{-1};
179 Info(
"FillRunsTable",
"Reading run infos from %s", runinfos.
Data());
180 TFile runinfos_file(runinfos);
185 while ((run_key = (
TKey*)it())) {
194 if (!runfile_index) run_index =
run_index_t{run_num, std::nullopt};
195 else run_index =
run_index_t{run_num, runfile_index};
207 for(
auto index : index_list)
241 runfile->SetSize(run->
GetValue64bit(
"Size") / 1024. / 1024.);
243 runfile->SetSize(run->
GetIntValue(
"Size") / 1024. / 1024.);
257 Info(
"FillRunsTable",
"Reading bad runfile infos from %s", badinfos.
Data());
264 auto br = all.
Next();
267 Error(
"FillRunsTable",
"%s:BadFiles.All contains run number %d which is not in %s",
268 badinfos.
Data(), br, runinfos.
Data());
269 throw std::runtime_error(
Form(
"inconsistency between %s:BadFiles.All and %s",
272 dbrun->SetBadAllRunFiles();
278 auto br =
first.Next();
281 Error(
"FillRunsTable",
"%s:BadFiles.First contains run number %d which is not in %s",
282 badinfos.
Data(), br, runinfos.
Data());
283 throw std::runtime_error(
Form(
"inconsistency between %s:BadFiles.First and %s",
286 dbrun->GetFirstFile().SetBad();
288 run_index_list singles(badfiles.
GetValue(
"BadFiles.Singles",
""));
289 for(
auto& ri : singles)
293 }
catch (std::exception&
e) {
294 Error(
"FillRunsTable",
"%s:BadFiles.Singles contains run_index %s which is unknown",
295 badinfos.
Data(), ri.as_string().Data());
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,...)
virtual Int_t GetNumber() const
A single raw data file associated with an experimental run ,,.
void SetBad(Bool_t is_bad=kTRUE)
Declare this runfile to be 'bad', i.e. not to be used for analysis.
Description of an experimental run in database ,,.
virtual void SetScaler64(const Char_t *name, ULong64_t val)
Set value for 64-bit scaler with the given name for this run.
void AddRunFile(KVDBRunFile *rf)
void SetNumber(Int_t n) override
TString GetFullPathToDataSetFile(const Char_t *filename)
Base class to describe database of an experiment ,,.
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.
KVExpSetUpDB()
Default constructor.
virtual ~KVExpSetUpDB()
Destructor.
Extended TList class which owns its objects by default.
virtual void MakeCalibrationTables(KVExpDB *)
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
KVNamedParameter * GetParameter(Int_t idx) const
return the parameter object with index idx
Int_t GetIntValue(const Char_t *name) const
Bool_t HasValue64bit(const Char_t *name) const
Int_t GetNpar() const
return the number of stored parameters
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
T * Get(const char *namecycle)
TKey * GetKey(const char *name, Short_t cycle=9999) const override
TList * GetListOfKeys() const override
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
TString & Remove(EStripType s, char c)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Specifies a runfile according to run number and file index ,.