4#include "KVINDRADB_e613.h"
6#include "KVFileReader.h"
8#include "KVDBParameterSet.h"
9#include "KVDBChIoPressures.h"
30 Info(
"KVINDRADB_e613",
"Hi coquine, tu es sur la manip e613 ...");
61 if (!strcmp(
GetDBEnv(
"Runlist.Separator"),
"<TAB>"))
134 Error(
"ReadChIoPressures()",
"Could not open file %s",
138 Info(
"ReadChIoPressures()",
"Reading ChIo pressures parameters...");
150 Float_t pressure[5] = { 0, 0, 0, 0, 0 };
165 par_list->
Add(parset);
168 for (
int zz = 0; zz < 5; zz++) pressure[zz] = 0.;
175 Error(
"ReadChIoPressures",
"Pb de format, il faut RunRange\tRun1-Run2 ... ");
183 else if (fin.eof()) {
188 par_list->
Add(parset);
191 for (
int zz = 0; zz < 5; zz++) pressure[zz] = 0.;
200 Error(
"ReadChIoPressures",
"Pb de format, il faut numero de la chio (ex 2_3)\tpression");
207 printf(
"%s %lf\n", chio.
Data(), press.
Atof());
210 read_pressure =
kTRUE;
212 if (chio ==
"2_3") pressure[0] = press.
Atof();
213 else if (chio ==
"4_5") pressure[1] = press.
Atof();
214 else if (chio ==
"6_7") pressure[2] = press.
Atof();
215 else if (chio ==
"8_12") pressure[3] = press.
Atof();
216 else if (chio ==
"13_17") pressure[4] = press.
Atof();
218 printf(
"#%s# ne correspond a rien\n", chio.
Data());
262 Info(
"ReadGainList()",
"Reading gains ...");
266 while (flist.
IsOK()) {
271 Int_t nt = toks->GetEntries();
273 unique_ptr<KVSeqCollection> sl;
276 Warning(
"ReadGainList",
"format non gere");
281 det_type = ((
TObjString*)toks->At(1))->GetString();
288 sscanf(((
TObjString*)toks->At(2))->GetString().Data(),
"R%d", &ring);
291 Warning(
"ReadGainList",
"format non gere");
294 sl.reset(sl->GetSubListWithMethod(
Form(
"%d", ring),
"GetRingNumber"));
306 while (ffile.
IsOK()) {
316 printf(
"%s Ring %d -> Runs=%s Gain=%1.3lf\n", det_type.
Data(), ring, nl.
AsString(), gain);
319 while ((obj = it.
Next())) {
356 Error(
"ReadPedestalList",
"Fichier %s, inconnu au bataillon", gDataSet->
GetDataSetEnv(
"INDRADB.Pedestals",
""));
368 Info(
"ReadPedestalList",
"liste des runs par defaut %s", default_run_list.
AsString());
370 while (flist.
IsOK()) {
374 if (
file !=
"" && !
file.BeginsWith(
'#')) {
376 Info(
"ReadPedestalList",
"Lecture de %s", fp.
Data());
381 if (!strcmp(
rec->GetName(),
"RunRange")) {
396 Info(
"ReadPedestalList",
"End of reading");
422 Info(
"ReadChannelVolt",
"liste des runs par defaut %s", default_run_list.
AsString());
427 Error(
"ReadChannelVolt",
"Fichier %s, inconnu au bataillon", gDataSet->
GetDataSetEnv(
"INDRADB.ElectronicCalibration",
""));
448 while (flist.
IsOK()) {
452 if (
file !=
"" && !
file.BeginsWith(
'#')) {
454 Info(
"ReadChannelVolt",
"Lecture de %s", fp.
Data());
457 if (fp.
Contains(
"PGtoVolt")) sgain =
"PG";
458 cal_type =
"Channel-Volt " + sgain;
471 while (!nring.
End()) {
474 Info(
"ReadChannelVolt",
"Couronne %d, run associee %d", rr,
TString(
rec->GetValue()).Atoi());
494 a0 = a0 - pied * a1 + pied * pied * a2;
495 a1 = a1 - 2 * pied * a2;
509 Warning(
"ReadChannelVolt",
"Pas de run reference numero %d", runref);
517 Info(
"ReadChannelVolt",
"pas de gain defini pour le run %d et le detecteur %s", runref,
rec->GetName());
530 a0 = a1 = a2 = gain = 0;
531 Warning(
"ReadChannelVolt",
"Pb de format %s",
rec->GetValue());
541 Info(
"ReadChannelVolt",
"End of reading");
561 Error(
"ReadVoltEnergyChIoSi",
"Fichier %s, inconnu au bataillon", gDataSet->
GetDataSetEnv(
"INDRADB.ChIoSiVoltMeVCalib",
""));
574 Info(
"ReadVoltEnergyChIoSi",
"liste des runs par defaut %s", default_run_list.
AsString());
576 while (flist.
IsOK()) {
580 if (
file !=
"" && !
file.BeginsWith(
'#')) {
582 Info(
"ReadPedestalList",
"Lecture de %s", fp.
Data());
607 Info(
"ReadVoltEnergyChIoSi",
"End of reading");
char * Form(const char *fmt,...)
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
CHIO pressure parameters.
To store calibration parameters in a database ,.
Double_t GetParameter(UShort_t i=0) const
void SetParameters(Double_t val,...)
void SetParameter(UShort_t i, Double_t val)
virtual KVDBRecord * GetLink(const Char_t *key, const Char_t *link) const
Returns the record named "link" in the table named "key".
virtual Int_t GetNumber() const
virtual Bool_t AddRecord(KVDBRecord *add)
virtual KVDBTable * GetTable(const Char_t *table) const
virtual Bool_t AddTable(KVDBTable *table)
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
virtual void ReadSystemList()
TString GetCalibFileName(const Char_t *type) const
const KVNumberList & GetRunList() const
virtual void LinkListToRunRange(TList *list, const KVNumberList &nl)
Link the records contained in the list to the set of runs (see LinkRecordToRunRanges).
virtual void LinkRecordToRunRange(KVDBRecord *rec, UInt_t first_run, UInt_t last_run)
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
virtual KVSeqCollection * GetRuns() const
Handle reading columns of numeric data in text files.
KVString GetCurrentLine()
ReadStatus ReadLine(const KVString &pattern="")
Double_t GetDoubleReadPar(Int_t pos) const
KVString GetReadPar(Int_t pos) const
Bool_t OpenFileToRead(const KVString &filename)
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
const KVSeqCollection * GetDetectors() const
Database entry for each run of an INDRA experiment.
Database for E613 experiment (2011)
virtual void ReadChIoPressures()
virtual void ReadVoltEnergyChIoSi()
virtual void ReadGainList()
virtual void ReadPedestalList()
virtual void ReadChannelVolt()
virtual ~KVINDRADB_e613()
Destructor.
KVINDRADB_e613()
Default constructor.
DataBase of parameters for an INDRA campaign.
KVDBTable * fChanVolt
ChIo/Si channel-volt calibration parameters.
virtual void ReadOoOACQParams()
void ReadNewRunList()
Read new-style runlist (written using KVDBRun v.10 or later)
KVINDRAPulserDataTree * fPulserData
mean values of pulsers for all detectors & runs
virtual void ReadOoODetectors()
KVINDRADBRun * GetRun(Int_t run) const
virtual void ReadCsITotalLightGainCorrections()
KVDBTable * fPedestals
table of pedestal files
KVDBTable * fVoltMeVChIoSi
ChIo/Si volt-energy calibration.
KVDBTable * fGains
(optional) table of detector gains, in case they change from run to run
virtual void ReadAbsentDetectors()
virtual void ReadCalibCsI()
Base class for detectors of INDRA array.
UInt_t GetRingNumber() const
Handles TTree with mean pulser data for every run.
void SetRunList(KVSeqCollection *runs)
Bool_t IsNewRunList() const
void SetRLCommentChar(Char_t c)
void ReadRunList(const Char_t *name="")
KVRunListLine * GetLineReader() const
void SetRLSeparatorChar(Char_t c)
virtual void Build(Int_t run=-1)
virtual Bool_t IsBuilt() const
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.
Int_t GetIntValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
Strings used to represent a set of ranges of values.
const Char_t * AsString(Int_t maxchars=0) const
void SetList(const TString &)
KVSeqCollection * GetSubListWithType(const Char_t *retvalue) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
THashList * GetTable() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
void Clear(Option_t *option="") override
void Add(TObject *obj) override
virtual void SetTitle(const char *title="")
const char * GetName() const override
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
virtual const char * GetName() 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
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
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)