10#include "KVINDRADB_e475s.h"
17#include "KVDBParameterSet.h"
19#include "KVMultiDetArray.h"
22#include "KVNumberList.h"
39 cout <<
"init de KVINDRADB_e475s" << endl;
41 fCalibrations = AddTable(
"Calibrations",
"List of available calibrations");
110 Error(
"ReadPedestalList()",
"Could not open file %s",
115 Info(
"ReadPedestalList()",
116 "Reading calibration parameters...");
121 while (finput.good()) {
122 TString calib_det =
"", calib_acq =
"", calib_file =
"";
125 cout << sline << endl;
128 calib_file = ((
TObjString*)(*toks)[0])->GetString();
130 calib_det = ((
TObjString*)(*toks)[1])->GetString();
132 calib_acq = ((
TObjString*)(*toks)[2])->GetString();
138 ifstream fin(stit.
Data());
159 Error(
"ReadCalibrations()",
"Could not open file %s",
164 Info(
"ReadCalibrations()",
165 "Reading calibration parameters...");
169 TString calib_det, calib_gain, calib_file;
171 while (finput.good()) {
174 cout << sline << endl;
176 calib_det = ((
TObjString*)(*toks)[0])->GetString();
177 calib_gain = ((
TObjString*)(*toks)[1])->GetString();
178 calib_file = ((
TObjString*)(*toks)[2])->GetString();
180 ifstream fin(stit.
Data());
198 Info(
"ReadCalibFile()",
199 "Reading calibration parameters of file %s%s", dettype.
Data(), detgain.
Data());
206 TString calib_type, calib_signal, calib_runs, calib_ring, calib_mods;
207 unique_ptr<TObjArray> toks;
208 unique_ptr<TObjArray> tokspara;
217 sline = ((
TObjString*)toks->At(0))->GetString();
223 calib_signal = sline;
224 cout << calib_signal << endl;
225 if (calib_signal != dettype + detgain)
Error(
"ReadCalibFile()",
"Erreur de synchro ...");
230 cout << calib_runs << endl;
236 cout << calib_ring << endl;
242 cout << calib_mods << endl;
244 detname.
Form(
"%s_%02d%02d", dettype.
Data(), calib_ring.
Atoi(), calib_mods.
Atoi());
247 sline.
ReplaceAll(
"<PARAMETER> Function=",
"");
248 cout << sline << endl;
254 tokspara.reset(sparaline.
Tokenize(
" "));
255 if (tokspara->GetEntries() != ff.
GetNpar()) cout << tokspara->GetEntries() <<
" " << ff.
GetNpar() << endl;
273 list_record.
Add(parset);
285 Error(
"ReadCalibFile()",
"Pb de chargements ...");
305 Info(
"ReadPedestalFile()",
306 "Reading pedestal value of file %s - %s", dettype.
Data(), detgain.
Data());
313 TString calib_type, calib_signal, calib_det, calib_acq;
314 TString calib_runs, calib_ring, calib_mods;
324 cout << calib_type << endl;
326 while (sline.
BeginsWith(
"<LIST> KVDetector=")) {
329 cout << calib_det << endl;
331 while (sline.
BeginsWith(
"<LIST> KVACQParam=")) {
334 cout << calib_acq << endl;
339 cout << calib_runs << endl;
346 cout << calib_ring << endl;
352 cout << calib_mods << endl;
354 sprintf(detname,
"%s_%02d%02d", calib_det.
Data(), calib_ring.
Atoi(), calib_mods.
Atoi());
357 sline.
ReplaceAll(
"<PARAMETER> Function=",
"");
358 cout << sline << endl;
381 list_record->
Add(parset);
393 Error(
"ReadCalibFile()",
"Pb de chargements ...");
403 list_record->
Clear();
char * Form(const char *fmt,...)
To store calibration parameters in a database ,.
void SetParamName(UShort_t i, const Char_t *name)
void SetParameter(UShort_t i, Double_t val)
Record folder for the database.
virtual Bool_t AddRecord(KVDBRecord *add)
const Char_t * GetDataSetDir() const
TString GetCalibFileName(const Char_t *type) const
Bool_t OpenCalibFile(const Char_t *type, std::ifstream &fs) const
Database for E475s experiment (2006)
void init()
Define duplicate run, create the tables of the database.
void ReadPedestalFile(std::ifstream &fin, TString, TString)
virtual ~KVINDRADB_e475s()
Destructor.
KVDBTable * fCalibrations
KVINDRADB_e475s()
Default constructor.
void ReadCalibFile(std::ifstream &fin, TString, TString)
DataBase of parameters for an INDRA campaign.
KVINDRADBRun * GetRun(Int_t run) const
KVDBTable * fPedestals
table of pedestal files
Strings used to represent a set of ranges of values.
virtual Int_t GetEntries() const
virtual Double_t GetParameter(const TString &name) const
virtual Int_t GetNpar() const
virtual TString GetExpFormula(Option_t *option="") const
virtual const char * GetParName(Int_t ipar) const
virtual void SetParameter(const TString &name, Double_t value)
void Clear(Option_t *option="") override
void Add(TObject *obj) override
TObject * At(Int_t idx) const override
Int_t GetEntries() 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
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)