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 ...");
37 void KVINDRADB_e613::make_minimal_database()
46 if (!strcmp(
GetDBEnv(
"Runlist.Separator"),
"<TAB>"))
71 void KVINDRADB_e613::extend_minimal_database()
77 ReadVoltEnergyChIoSi();
79 ReadAbsentDetectors();
89 ReadCsITotalLightGainCorrections();
109 void KVINDRADB_e613::ReadChIoPressures()
126 if (!OpenCalibFile(
"Pressures", fin)) {
127 KVError::Error(
this,
"ReadChIoPressures()",
"Could not open file %s",
131 Info(
"ReadChIoPressures()",
"Reading ChIo pressures parameters...");
143 Float_t pressure[5] = { 0, 0, 0, 0, 0 };
158 par_list->
Add(parset);
161 for (
int zz = 0; zz < 5; zz++) pressure[zz] = 0.;
168 KVError::Error(
this,
"ReadChIoPressures",
"Pb de format, il faut RunRange\tRun1-Run2 ... ");
176 else if (fin.eof()) {
181 par_list->
Add(parset);
184 for (
int zz = 0; zz < 5; zz++) pressure[zz] = 0.;
193 KVError::Error(
this,
"ReadChIoPressures",
"Pb de format, il faut numero de la chio (ex 2_3)\tpression");
200 printf(
"%s %lf\n", chio.
Data(), press.
Atof());
203 read_pressure =
kTRUE;
205 if (chio ==
"2_3") pressure[0] = press.
Atof();
206 else if (chio ==
"4_5") pressure[1] = press.
Atof();
207 else if (chio ==
"6_7") pressure[2] = press.
Atof();
208 else if (chio ==
"8_12") pressure[3] = press.
Atof();
209 else if (chio ==
"13_17") pressure[4] = press.
Atof();
211 printf(
"#%s# ne correspond a rien\n", chio.
Data());
229 void KVINDRADB_e613::ReadGainList()
255 Info(
"ReadGainList()",
"Reading gains ...");
257 fGains =
AddTable(
"Gains",
"Gains of detectors during runs");
259 while (flist.
IsOK()) {
266 unique_ptr<KVSeqCollection> sl;
281 sscanf(((
TObjString*)toks->
At(2))->GetString().Data(),
"R%d", &ring);
287 sl.reset(sl->GetSubListWithMethod(
Form(
"%d", ring),
"GetRingNumber"));
299 while (ffile.
IsOK()) {
309 printf(
"%s Ring %d -> Runs=%s Gain=%1.3lf\n", det_type.
Data(), ring, nl.
AsString(), gain);
312 while ((obj = it.Next())) {
314 par->SetParameter(gain);
315 fGains->AddRecord(par);
338 void KVINDRADB_e613::ReadPedestalList()
352 fPedestals->SetTitle(
"Values of pedestals");
361 Info(
"ReadPedestalList",
"liste des runs par defaut %s", default_run_list.
AsString());
363 while (flist.
IsOK()) {
367 if (
file !=
"" && !
file.BeginsWith(
'#')) {
369 Info(
"ReadPedestalList",
"Lecture de %s", fp.
Data());
373 while ((rec = (
TEnvRec*)it.Next())) {
374 if (!strcmp(
rec->GetName(),
"RunRange")) {
380 fPedestals->AddRecord(par);
389 Info(
"ReadPedestalList",
"End of reading");
400 void KVINDRADB_e613::ReadChannelVolt()
415 Info(
"ReadChannelVolt",
"liste des runs par defaut %s", default_run_list.
AsString());
441 while (flist.
IsOK()) {
445 if (
file !=
"" && !
file.BeginsWith(
'#')) {
447 Info(
"ReadChannelVolt",
"Lecture de %s", fp.
Data());
450 if (fp.
Contains(
"PGtoVolt")) sgain =
"PG";
451 cal_type =
"Channel-Volt " + sgain;
456 while ((rec = (
TEnvRec*)it.Next())) {
460 if (srec.BeginsWith(
"Ring.")) {
461 srec.ReplaceAll(
"Ring.",
"");
464 while (!nring.
End()) {
467 Info(
"ReadChannelVolt",
"Couronne %d, run associee %d", rr,
TString(
rec->GetValue()).Atoi());
470 else if (srec.BeginsWith(
"Pedestal")) {
471 srec.ReplaceAll(
"Pedestal.",
"");
477 toks = spar.Tokenize(
",");
487 a0 = a0 - pied * a1 + pied * pied * a2;
488 a1 = a1 - 2 * pied * a2;
502 KVError::Warning(
this,
"ReadChannelVolt",
"Pas de run reference numero %d", runref);
510 Info(
"ReadChannelVolt",
"pas de gain defini pour le run %d et le detecteur %s", runref,
rec->GetName());
518 fChanVolt->AddRecord(par);
523 a0 = a1 = a2 = gain = 0;
534 Info(
"ReadChannelVolt",
"End of reading");
545 void KVINDRADB_e613::ReadVoltEnergyChIoSi()
567 Info(
"ReadVoltEnergyChIoSi",
"liste des runs par defaut %s", default_run_list.
AsString());
569 while (flist.
IsOK()) {
573 if (
file !=
"" && !
file.BeginsWith(
'#')) {
575 Info(
"ReadPedestalList",
"Lecture de %s", fp.
Data());
579 while ((rec = (
TEnvRec*)it.Next())) {
583 toks = spar.Tokenize(
",");
592 fVoltMeVChIoSi->AddRecord(par);
600 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 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
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)
KVINDRADB_e613()
Default constructor.
DataBase of parameters for an INDRA campaign.
void ReadNewRunList()
Read new-style runlist (written using KVDBRun v.10 or later)
KVINDRADBRun * GetRun(Int_t run) const
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
const char * GetName() const override
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
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
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
void Error(UserClass p, const char *location, const char *va_(fmt),...)
void Warning(UserClass p, const char *location, const char *va_(fmt),...)