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>"))
138 Error(
"ReadChIoPressures()",
"Could not open file %s",
142 Info(
"ReadChIoPressures()",
"Reading ChIo pressures parameters...");
154 Float_t pressure[5] = { 0, 0, 0, 0, 0 };
169 par_list->
Add(parset);
172 for (
int zz = 0; zz < 5; zz++) pressure[zz] = 0.;
179 Error(
"ReadChIoPressures",
"Pb de format, il faut RunRange\tRun1-Run2 ... ");
187 else if (fin.eof()) {
192 par_list->
Add(parset);
195 for (
int zz = 0; zz < 5; zz++) pressure[zz] = 0.;
204 Error(
"ReadChIoPressures",
"Pb de format, il faut numero de la chio (ex 2_3)\tpression");
211 printf(
"%s %lf\n", chio.
Data(), press.
Atof());
214 read_pressure =
kTRUE;
216 if (chio ==
"2_3") pressure[0] = press.
Atof();
217 else if (chio ==
"4_5") pressure[1] = press.
Atof();
218 else if (chio ==
"6_7") pressure[2] = press.
Atof();
219 else if (chio ==
"8_12") pressure[3] = press.
Atof();
220 else if (chio ==
"13_17") pressure[4] = press.
Atof();
222 printf(
"#%s# ne correspond a rien\n", chio.
Data());
266 Info(
"ReadGainList()",
"Reading gains ...");
270 while (flist.
IsOK()) {
275 Int_t nt = toks->GetEntries();
277 unique_ptr<KVSeqCollection> sl;
280 Warning(
"ReadGainList",
"format non gere");
285 det_type = ((
TObjString*)toks->At(1))->GetString();
292 sscanf(((
TObjString*)toks->At(2))->GetString().Data(),
"R%d", &ring);
295 Warning(
"ReadGainList",
"format non gere");
298 sl.reset(sl->GetSubListWithMethod(
Form(
"%d", ring),
"GetRingNumber"));
310 while (ffile.
IsOK()) {
320 printf(
"%s Ring %d -> Runs=%s Gain=%1.3lf\n", det_type.
Data(), ring, nl.
AsString(), gain);
323 while ((obj = it.
Next())) {
360 Error(
"ReadPedestalList",
"Fichier %s, inconnu au bataillon", (
const char*)gDataSet->
GetDataSetEnv(
"INDRADB.Pedestals",
""));
372 Info(
"ReadPedestalList",
"liste des runs par defaut %s", default_run_list.
AsString());
374 while (flist.
IsOK()) {
378 if (
file !=
"" && !
file.BeginsWith(
'#')) {
380 Info(
"ReadPedestalList",
"Lecture de %s", fp.
Data());
385 if (!strcmp(
rec->GetName(),
"RunRange")) {
400 Info(
"ReadPedestalList",
"End of reading");
426 Info(
"ReadChannelVolt",
"liste des runs par defaut %s", default_run_list.
AsString());
431 Error(
"ReadChannelVolt",
"Fichier %s, inconnu au bataillon", (
const char*)gDataSet->
GetDataSetEnv(
"INDRADB.ElectronicCalibration",
""));
452 while (flist.
IsOK()) {
456 if (
file !=
"" && !
file.BeginsWith(
'#')) {
458 Info(
"ReadChannelVolt",
"Lecture de %s", fp.
Data());
461 if (fp.
Contains(
"PGtoVolt")) sgain =
"PG";
462 cal_type =
"Channel-Volt " + sgain;
475 while (!nring.
End()) {
478 Info(
"ReadChannelVolt",
"Couronne %d, run associee %d", rr,
TString(
rec->GetValue()).Atoi());
498 a0 = a0 - pied * a1 + pied * pied * a2;
499 a1 = a1 - 2 * pied * a2;
513 Warning(
"ReadChannelVolt",
"Pas de run reference numero %d", runref);
521 Info(
"ReadChannelVolt",
"pas de gain defini pour le run %d et le detecteur %s", runref,
rec->GetName());
534 a0 = a1 = a2 = gain = 0;
535 Warning(
"ReadChannelVolt",
"Pb de format %s",
rec->GetValue());
545 Info(
"ReadChannelVolt",
"End of reading");
565 Error(
"ReadVoltEnergyChIoSi",
"Fichier %s, inconnu au bataillon", (
const char*)gDataSet->
GetDataSetEnv(
"INDRADB.ChIoSiVoltMeVCalib",
""));
578 Info(
"ReadVoltEnergyChIoSi",
"liste des runs par defaut %s", default_run_list.
AsString());
580 while (flist.
IsOK()) {
584 if (
file !=
"" && !
file.BeginsWith(
'#')) {
586 Info(
"ReadPedestalList",
"Lecture de %s", fp.
Data());
611 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 ,.
void SetParameters(const std::vector< Double_t > &pars)
Double_t GetParameter(UShort_t i=0) const
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)
ValType GetDataSetEnv(const Char_t *type, const ValType &defval) const
virtual void ReadSystemList()
virtual KVSeqCollection * GetRuns() const
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
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)
const KVSeqCollection * GetDetectors() const
Database entry for each run of an INDRA experiment.
Database for E613 experiment (2011)
void Build(bool=false) override
void ReadChIoPressures() override
void ReadGainList() override
void ReadPedestalList() override
void ReadChannelVolt() override
void ReadVoltEnergyChIoSi() override
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()
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()
KVINDRADBRun * GetRun(Int_t run) const
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)
KVRunListLine * GetLineReader() const
void ReadRunList(const Char_t *name="")
void SetRLSeparatorChar(Char_t c)
void Build(Int_t run=-1) override
Correspondance between CsI detectors and pin lasers is set up if known.
KVINDRADetector * GetDetector(const Char_t *name) const override
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray", KVExpDB *db=nullptr)
virtual Bool_t IsBuilt() const
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)