KaliVeda
Toolkit for HIC analysis
KVINDRAUpDater.cpp
1 /*
2 $Id: KVINDRAUpDater.cpp,v 1.12 2008/01/10 14:17:34 franklan Exp $
3 $Revision: 1.12 $
4 $Date: 2008/01/10 14:17:34 $
5 $Author: franklan $
6 */
7 
8 #include "KVINDRAUpDater.h"
9 #include "KVINDRA.h"
10 #include "KVCalibrator.h"
11 #include "KVNucleus.h"
12 #include "KVDBParameterSet.h"
13 #include "KVINDRADBRun.h"
14 #include "KVIDGridManager.h"
15 #include "KVDBChIoPressures.h"
16 #include "KVChIo.h"
17 #include "KVBase.h"
18 #include "KVSilicon.h"
19 #include "KVCsI.h"
20 #include "KVINDRADB.h"
21 using namespace std;
22 
23 
24 
27 
30 {
31  //Default ctor for KVINDRAUpDater object.
32 }
33 
34 
35 
36 
48 
49 void KVINDRAUpDater::SetParameters(UInt_t run, Bool_t physics_parameters_only)
50 {
51  //Set the parameters of INDRA for this run
52  //This will:
53  // set the multiplicity trigger of fArray using the database value for the run
54  // set the target corresponding to the run
55  // set the ChIo pressures for the run
56  //If physics_parameters_only==kFALSE:
57  // set special detector gains for run (if any)
58  // set calibration parameters for the run
59  // set identification parameters for the run
60  //
61 
62  cout << "Setting parameters of INDRA array for run " << run << ":" <<
63  endl;
64  KVDBRun* kvrun = gExpDB->GetDBRun(run);
65  if (!kvrun) {
66  Error("SetParameters(UInt_t)", "Run %u not found in database!", run);
67  return;
68  }
69  SetTrigger(kvrun);
70  SetTarget(kvrun);
71 
72  CheckStatusOfDetectors(kvrun);
73  SetChIoPressures(kvrun);
74 
75  if (!physics_parameters_only) {
76  SetGains(kvrun);
77  SetCalibrationParameters(run);
78  SetIdentificationParameters(run);
79  }
80 }
81 
82 
83 
84 //void KVINDRAUpDater::SetCalibrationParameters(UInt_t run)
85 //{
86 // //Set calibration parameters for this run.
87 // //This will:
88 // // reset all the calibrators of all the detectors ready to receive the calibrators for the run (handled by child classes),
89 // // set calibration parameters for the run
90 // // set pedestals for the run
91 // // set PHD parameters of silicon detectors for run
92 
93 // cout << "Setting calibration parameters of INDRA array for run " << run << ":" <<
94 // endl;
95 // KVDBRun* kvrun = gExpDB->GetDBRun(run);
96 // if (!kvrun) {
97 // Error("SetParameters(UInt_t)", "Run %u not found in database!", run);
98 // return;
99 // }
100 // //Reset all calibrators of all detectors first
101 // TIter next(fArray->GetDetectors());
102 // KVDetector* kvd;
103 // KVCalibrator* kvc;
104 // while ((kvd = (KVDetector*) next())) {
105 // if (kvd->GetListOfCalibrators()) {
106 // TIter next_cal(kvd->GetListOfCalibrators());
107 // while ((kvc = (KVCalibrator*) next_cal())) {
108 // kvc->Reset();
109 // }
110 // }
111 // }
112 // SetCalibParameters(kvrun);
113 // //SetPedestals(kvrun);
114 // SetPHDs(kvrun);
115 //}
116 
117 
120 
122 {
123  //Set trigger used during this run
124 
125  cout << "--> Setting Trigger:" << endl;
126  GetINDRA()->SetTrigger(kvrun->GetTrigger());
127  cout << " M>=" << (Int_t)GetINDRA()->GetTrigger() << endl;
128 }
129 
130 
131 
133 
135 {
136 
137  KVRList* absdet = kvrun->GetLinks("Absent Detectors");
138  KVRList* oooacq = kvrun->GetLinks("OoO ACQPars");
139  KVRList* ooodet = kvrun->GetLinks("OoO Detectors");
140 
141  TIter next(fArray->GetDetectors());
142  KVDetector* det;
143  KVEBYEDAT_ACQParam* acq;
144 
145  Int_t ndet_absent = 0;
146  Int_t ndet_ooo = 0;
147  Int_t nacq_ooo = 0;
148 
149  while ((det = (KVDetector*)next())) {
150  //Test de la presence ou non du detecteur
151  if (!absdet) {
152  det->SetPresent();
153  }
154  else {
155  if (absdet->FindObject(det->GetName(), "Absent Detector")) {
156  det->SetPresent(kFALSE);
157  ndet_absent += 1;
158  }
159  else {
160  det->SetPresent();
161  }
162  }
163  if (det->IsPresent()) {
164  //Test du bon fonctionnement ou non du detecteur
165  if (!ooodet) {
166  det->SetDetecting();
167  }
168  else {
169  if (ooodet->FindObject(det->GetName(), "OoO Detector")) {
170  det->SetDetecting(kFALSE);
171  ndet_ooo += 1;
172  }
173  else {
174  det->SetDetecting();
175  }
176  }
177  //Test du bon fonctionnement ou non des parametres d acquisition
178 // if (det->IsDetecting()) {
179 // TIter next_acq(det->GetACQParamList());
180 // if (!oooacq) {
181 // while ((acq = (KVACQParam*)next_acq())) {
182 // acq->SetWorking();
183 // }
184 // }
185 // else {
186 // Int_t noff = 0;
187 // while ((acq = (KVACQParam*)next_acq())) {
188 // if (oooacq->FindObject(acq->GetName(), "OoO ACQPar")) {
189 // acq->SetWorking(kFALSE);
190 // noff += 1;
191 // nacq_ooo += 1;
192 // }
193 // else {
194 // acq->SetWorking();
195 // }
196 // }
197 // if (noff == 3) {
198 // det->SetDetecting(kFALSE);
199 // ndet_ooo += 1;
200 // nacq_ooo -= 3;
201 // }
202 // }
203 // }
204  }
205  }
206  Info("KVINDRAUpDater", "%d detecteurs absents", ndet_absent);
207  Info("KVINDRAUpDater", "%d detecteurs ne fonctionnent pas", ndet_ooo);
208  Info("KVINDRAUpDater", "%d parametres d acquisition ne fonctionnent pas", nacq_ooo);
209 }
210 
211 
212 
218 
220 {
221  //Set gains used during this run
222  //First all detector gains are set to 1.
223  //Then, any detectors for which a different gain has been defined
224  //will have its gain set to the value for the run
225  TIter next(fArray->GetDetectors());
226  KVDetector* kvd;
227  while ((kvd = (KVDetector*) next()))
228  kvd->SetGain(1.00);
229  KVRList* gain_list = kvrun->GetLinks("Gains");
230  if (!gain_list) {
231  return;
232  }
233  cout << "--> Setting Gains:" << endl;
234  Int_t ndets = gain_list->GetSize();
235  cout << " Setting gains for " << ndets << " detectors : " << endl;
236  for (int i = 0; i < ndets; i++) {
237  KVDBParameterSet* dbps = (KVDBParameterSet*) gain_list->At(i);
238  kvd = fArray->GetDetector(dbps->GetName());
239  if (kvd) {
240  kvd->SetGain(dbps->GetParameter(0));
241  cout << " " << kvd->GetName() << " : G=" << kvd->
242  GetGain() << endl;
243  }
244  else {
245  Error("SetGains", "le detecteur %s n ext pas present", dbps->GetName());
246  }
247  }
248 }
249 
250 
251 //
252 // void KVINDRAUpDater::SetIDGrids(UInt_t run)
253 // {
254 // // Use global ID grid manager gIDGridManager to set identification grids for all
255 // // ID telescopes for this run. First, any previously set grids are removed.
256 // // Then all grids for current run are set in the associated ID telescopes.
257 //
258 // cout << "--> Setting Identification Grids" << endl;
259 // TIter next_idt(gMultiDetArray->GetListOfIDTelescopes());
260 // KVIDTelescope *idt;
261 // while ((idt = (KVIDTelescope *) next_idt()))
262 // {
263 // idt->RemoveGrids();
264 // }
265 // gIDGridManager->SetGridsInTelescopes(run);
266 // }
267 
268 
269 
276 
278 {
279  //Update ChIo pressures for this run with values in database (if any)
280  //
281  //if pressure is equal to 0 (no gas)
282  //mark the corresponding ChIo's as non detecting detector (see KVDetector::SetDetecting())
283  //
284 
285  KVRList* param_list = kvrun->GetLinks("ChIo Pressures");
286  if (!param_list) {
287  return;
288  }
289  KVChIo* kvd;
290  KVDBChIoPressures* kvps;
291  TIter next_ps(param_list);
292  KVSeqCollection* chios = GetINDRA()->GetListOfChIo();
293  if (!chios) {
294  Error("SetChIoPressures",
295  "fArray->GetListOfChIo() returns null list pointer");
296  return;
297  }
298  cout << "--> Setting ChIo pressures" << endl;
299  TIter next_chio(chios);
300  while ((kvps = (KVDBChIoPressures*) next_ps())) {
301  cout << " Ring 2/3: " << kvps->
302  GetPressure(CHIO_2_3) << "mbar" << endl;
303  cout << " Ring 4/5: " << kvps->
304  GetPressure(CHIO_4_5) << "mbar" << endl;
305  cout << " Ring 6/7: " << kvps->
306  GetPressure(CHIO_6_7) << "mbar" << endl;
307  cout << " Ring 8/12: " << kvps->
308  GetPressure(CHIO_8_12) << "mbar" << endl;
309  cout << " Ring 13/17: " << kvps->
310  GetPressure(CHIO_13_17) << "mbar" << endl;
311  while ((kvd = (KVChIo*) next_chio())) {
312  if (!strcmp(kvd->GetType(), "CI")) {
313  //check detector type: ="CI" for standard INDRA chio
314  if (kvd->GetRingNumber() == 2)
315  kvd->SetPressure(kvps->GetPressure(CHIO_2_3));
316  if (kvd->GetRingNumber() == 4)
317  kvd->SetPressure(kvps->GetPressure(CHIO_4_5));
318  if (kvd->GetRingNumber() == 6)
319  kvd->SetPressure(kvps->GetPressure(CHIO_6_7));
320  if (kvd->GetRingNumber() >= 8 && kvd->GetRingNumber() <= 12)
321  kvd->SetPressure(kvps->GetPressure(CHIO_8_12));
322  if (kvd->GetRingNumber() >= 13 && kvd->GetRingNumber() <= 17)
323  kvd->SetPressure(kvps->GetPressure(CHIO_13_17));
324  if (kvd->GetPressure() == 0.0) {
325  kvd->SetDetecting(kFALSE);
326  }
327  else {
328  kvd->SetDetecting(kTRUE);
329  }
330  }
331  }
332  next_chio.Reset();
333  }
334 }
335 
336 
337 
338 
340 
342 {
343 
344 
345  KVRList* param_list = kvrun->GetLinks("Channel-Volt");
346  if (!param_list)
347  return;
348  if (!param_list->GetSize())
349  return;
350 
351  KVDetector* kvd;
352  KVDBParameterSet* kvps;
353  KVCalibrator* kvc;
354  TIter next_ps(param_list);
355 
356 
357  TString str;
358 
359  // Setting Channel-Volts calibration parameters
360  while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres
361  str = kvps->GetName();
362  str.Remove(str.Sizeof() - 4, 3); //Removing 3 last letters (ex : "_PG")
363  kvd = fArray->GetDetector(str.Data());
364  if (!kvd)
365  Warning("SetChVoltParameters(UInt_t)", "Dectector %s not found !",
366  str.Data());
367  else { // detector found
368  kvc = kvd->GetCalibrator(kvps->GetName(), kvps->GetTitle());
369  if (!kvc)
370  Warning("SetChVoltParameters(UInt_t)",
371  "Calibrator %s %s not found !", kvps->GetName(),
372  kvps->GetTitle());
373  else { //calibrator found
374  for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
375  kvc->SetParameter(i, kvps->GetParameter(i));
376  }
377  kvc->SetStatus(kTRUE); // calibrator ready
378  } //calibrator found
379  } //detector found
380  } //boucle sur les parameters
381 }
382 
383 
384 
385 
387 
389 {
390 
391  KVRList* param_list = kvrun->GetLinks("Volt-Energy ChIo-Si");
392  if (!param_list)
393  return;
394  if (!param_list->GetSize()) {
395  return;
396  }
397 
398  KVDetector* kvd;
399  KVDBParameterSet* kvps;
400  KVCalibrator* kvc;
401  TIter next_ps(param_list);
402 
403  // Setting Channel-Volts calibration parameters
404  while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres
405  kvd = fArray->GetDetector(kvps->GetName());
406  if (!kvd) {
407  /*
408  Warning("SetVoltEnergyParameters(UInt_t)",
409  "Dectector %s not found !", kvps->GetName());
410  */
411  }
412  else { // detector found
413  kvc = kvd->GetCalibrator(kvps->GetName(), kvps->GetTitle());
414  if (!kvc)
415  Warning("SetVoltEnergyParameters(UInt_t)",
416  "Calibrator %s %s not found !", kvps->GetName(),
417  kvps->GetTitle());
418  else { //calibrator found
419  for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
420  kvc->SetParameter(i, kvps->GetParameter(i));
421  }
422  kvc->SetStatus(kTRUE); // calibrator ready
423  } //calibrator found
424  } //detector found
425  } //boucle sur les parameters
426 }
427 
428 
429 
430 //void KVINDRAUpDater::SetCalibParameters(KVDBRun* run)
431 //{
432 // SetChVoltParameters(run);
433 // SetVoltEnergyChIoSiParameters(run);
434 // SetLitEnergyCsIParameters(run);
435 // SetCsIGainCorrectionParameters(run);
436 //}
437 
438 
439 //void KVINDRAUpDater::SetPedestals(KVDBRun* kvrun)
440 //{
441 // //Set pedestals for this run
442 
443 // SetChIoSiPedestals(kvrun);
444 // SetCsIPedestals(kvrun);
445 
446 //}
447 
448 
449 
455 
457 {
458  // Sets KVCsI::fGainCorrection data member, used by KVCsI::GetCorrectedLumiereTotale
459  // to return the total light output corrected by a run-dependent factor.
460  // We set all detectors' correction to 1, then set the corrections defined for this
461  // run, if any.
462 
463  AbstractMethod("SetCsIGainCorrectionParameters");
464 
465  TIter next_csi(GetINDRA()->GetListOfCsI());
466  KVCsI* csi;
467 // while ((csi = (KVCsI*)next_csi())) {
468 // csi->SetTotalLightGainCorrection(1.0);
469 // }
470 
471  KVRList* param_list = kvrun->GetLinks("CsIGainCorr");
472  if (!param_list) {
473  return;
474  }
475  if (!param_list->GetSize()) {
476  return;
477  }
478 
479  TIter next_ps(param_list);
480  KVDBParameterSet* dbps;
481  while ((dbps = (KVDBParameterSet*)next_ps())) {
482 
483  csi = (KVCsI*)fArray->GetDetector(dbps->GetName());
484  if (!csi) {
485  // the name of the parameter set should be the name of the detector;
486  // however, it may be the name of an acquisition parameter associated with
487  // the detector!
488 // KVACQParam* a = fArray->GetACQParam(dbps->GetName());
489 // if (a) csi = (KVCsI*)a->GetDetector();
490  // still no good ?
491  if (!csi) {
492  Warning("SetCsIGainCorrectionParameters",
493  "Cannot find detector associated with %s", dbps->GetName());
494  continue;
495  }
496  }
497 // csi->SetTotalLightGainCorrection(dbps->GetParameter());
498 // Info("SetCsIGainCorrectionParameters", "%s gain correction = %f", csi->GetName(), csi->GetTotalLightGainCorrection());
499  }
500 }
501 
502 
503 
504 
507 
509 {
510 
511  // Setting Light- Energy CsI calibration parameters for Z=1
512  KVRList* param_list = kvrun->GetLinks("Light-Energy CsI Z=1");
513 
514  if (param_list && param_list->GetSize()) {
515 
516  KVDetector* kvd;
517  KVDBParameterSet* kvps;
518  KVCalibrator* kvc;
519  TIter next_ps(param_list);
520  TString str;
521 
522  while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres
523  str = kvps->GetName();
524  kvd = fArray->GetDetector(str.Data());
525  if (!kvd)
526  Warning("SetLitEnergyCsIParameters(UInt_t)",
527  "Dectector %s not found !", str.Data());
528  else { // detector found
529  kvc = kvd->GetCalibrator(kvps->GetTitle());
530  if (!kvc) {
531  Warning("SetLitEnergyCsIParameters(UInt_t)",
532  "Calibrator %s %s not found ! - it will be created",
533  kvps->GetName(), kvps->GetTitle());
534  //kvd->SetCalibrators();
535  kvc = kvd->GetCalibrator(kvps->GetTitle());
536  }
537  for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
538  kvc->SetParameter(i, kvps->GetParameter(i));
539  kvc->SetStatus(kTRUE); // calibrator ready
540  }
541  } //detector found
542  } //boucle sur les parameters
543  }
544  // Setting Light- Energy CsI calibration parameters for Z>1
545  param_list = kvrun->GetLinks("Light-Energy CsI Z>1");
546 
547  if (!param_list || !param_list->GetSize()) {
548  return;
549  }
550 
551  KVDetector* kvd;
552  KVDBParameterSet* kvps;
553  KVCalibrator* kvc;
554  TString str;
555 
556  TIter next_ps2(param_list);
557  while ((kvps = (KVDBParameterSet*) next_ps2())) { // boucle sur les parametres
558  str = kvps->GetName();
559  kvd = fArray->GetDetector(str.Data());
560  if (!kvd)
561  Warning("SetLitEnergyCsIParameters(UInt_t)",
562  "Dectector %s not found !", str.Data());
563  else { // detector found
564  kvc = kvd->GetCalibrator(kvps->GetTitle());
565  if (!kvc) {
566  Warning("SetLitEnergyCsIParameters(UInt_t)",
567  "Calibrator %s %s not found ! - it will be created",
568  kvps->GetName(), kvps->GetTitle());
569  //kvd->SetCalibrators();
570  kvc = kvd->GetCalibrator(kvps->GetTitle());
571  }
572  for (Int_t i = 0; i < kvc->GetNumberParams(); i++) {
573  kvc->SetParameter(i, kvps->GetParameter(i));
574  kvc->SetStatus(kTRUE); // calibrator ready
575  }
576  } //detector found
577  } //boucle sur les parameters
578 }
579 
580 
581 
582 //void KVINDRAUpDater::SetChIoSiPedestals(KVDBRun* kvrun)
583 //{
584 // //read Chio-Si-Etalons pedestals
585 
586 // if (!kvrun->GetKey("Pedestals"))
587 // return;
588 // if (!kvrun->GetKey("Pedestals")->GetLinks())
589 // return;
590 // if (!kvrun->GetKey("Pedestals")->GetLinks()->At(0))
591 // return;
592 
593 // ifstream file_pied_chiosi;
594 // if (!KVBase::
595 // SearchAndOpenKVFile(kvrun->GetKey("Pedestals")->GetLinks()->At(0)->
596 // GetName(), file_pied_chiosi, fDataSet.Data())) {
597 // Error("SetPedestals", "Problem opening file %s",
598 // kvrun->GetKey("Pedestals")->GetLinks()->At(0)->GetName());
599 // return;
600 // }
601 // cout << "--> Setting Pedestals" << endl;
602 // cout << " ChIo/Si/Etalons: " << kvrun->GetKey("Pedestals")->
603 // GetLinks()->At(0)->GetName() << endl;
604 
605 // //skip first 5 lines - header
606 // TString line;
607 // for (int i = 5; i; i--) {
608 // line.ReadLine(file_pied_chiosi);
609 // }
610 
611 // int cou, mod, type, n_phys, n_gene;
612 // float ave_phys, sig_phys, ave_gene, sig_gene;
613 
614 // while (file_pied_chiosi.good()) {
615 
616 // file_pied_chiosi >> cou >> mod >> type >> n_phys >> ave_phys >>
617 // sig_phys >> n_gene >> ave_gene >> sig_gene;
618 
619 // KVDetector* det = GetINDRA()->GetDetectorByType(cou, mod, type);
620 // if (det) {
621 // switch (type) {
622 
623 // case ChIo_GG:
624 
625 // det->SetPedestal("GG", ave_gene);
626 // break;
627 
628 // case ChIo_PG:
629 
630 // det->SetPedestal("PG", ave_gene);
631 // break;
632 
633 // case Si_GG:
634 
635 // det->SetPedestal("GG", ave_gene);
636 // break;
637 
638 // case Si_PG:
639 
640 // det->SetPedestal("PG", ave_gene);
641 // break;
642 
643 // case SiLi_GG:
644 
645 // det->SetPedestal("GG", ave_gene);
646 // break;
647 
648 // case SiLi_PG:
649 
650 // det->SetPedestal("PG", ave_gene);
651 // break;
652 
653 // case Si75_GG:
654 
655 // det->SetPedestal("GG", ave_gene);
656 // break;
657 
658 // case Si75_PG:
659 
660 // det->SetPedestal("PG", ave_gene);
661 // break;
662 
663 // default:
664 
665 // break;
666 // }
667 // }
668 // }
669 // file_pied_chiosi.close();
670 //}
671 
673 
674 //void KVINDRAUpDater::SetCsIPedestals(KVDBRun* kvrun)
675 //{
676 // if (!kvrun->GetKey("Pedestals"))
677 // return;
678 // if (!kvrun->GetKey("Pedestals")->GetLinks())
679 // return;
680 // if (!kvrun->GetKey("Pedestals")->GetLinks()->At(1))
681 // return;
682 
683 // //read CsI pedestals
684 // ifstream file_pied_csi;
685 // if (!KVBase::
686 // SearchAndOpenKVFile(kvrun->GetKey("Pedestals")->GetLinks()->At(1)->
687 // GetName(), file_pied_csi, fDataSet.Data())) {
688 // Error("SetPedestals", "Problem opening file %s",
689 // kvrun->GetKey("Pedestals")->GetLinks()->At(1)->GetName());
690 // return;
691 // }
692 // cout << "--> Setting Pedestals" << endl;
693 // cout << " CsI : " << kvrun->GetKey("Pedestals")->
694 // GetLinks()->At(1)->GetName() << endl;
695 
696 // int cou, mod, type, n_phys, n_gene;
697 // float ave_phys, sig_phys, ave_gene, sig_gene;
698 // TString line;
699 
700 // //skip first 5 lines - header
701 // for (int i = 5; i; i--) {
702 // line.ReadLine(file_pied_csi);
703 // }
704 
705 // while (file_pied_csi.good()) {
706 
707 // file_pied_csi >> cou >> mod >> type >> n_phys >> ave_phys >> sig_phys
708 // >> n_gene >> ave_gene >> sig_gene;
709 
710 // KVDetector* det = GetINDRA()->GetDetectorByType(cou, mod, type);
711 // if (det) {
712 // switch (type) {
713 
714 // case CsI_R:
715 
716 // det->SetPedestal("R", ave_gene);
717 // break;
718 
719 // case CsI_L:
720 
721 // det->SetPedestal("L", ave_gene);
722 // break;
723 
724 // default:
725 
726 // break;
727 // }
728 // }
729 // }
730 // file_pied_csi.close();
731 //}
732 
733 
735 
737 {
738  return (KVINDRA*)fArray;
739 }
740 
741 
742 
743 
750 
752 {
753  //If the environment variable
754  // name_of_dataset.INDRADB.PHD: name_of_file
755  //is set, then the corresponding file (which must be in $KVROOT/KVFiles/name_of_dataset)
756  //is read and used to set the (Moulton) pulse-height defect parameters of all silicon
757  //detectors.
758 
759  TString phdfile = gExpDB->GetDBEnv("PHD");
760 
761  if (phdfile != "") {
762  cout << "--> Setting Si pulse height defect parameters (Moulton)" << endl;
763 
764  //get full path to file
765  TString path;
766  if (KVBase::SearchKVFile(phdfile.Data(), path, gDataSet->GetName())) {
767  //read file with a TEnv
768  TEnv phds;
769  if (phds.ReadFile(path.Data(), kEnvLocal) != 0) {
770  Error("SetPHDs", "TEnv::ReadFile != 0, cannot read PHD file");
771  }
772  //loop over all silicons
773  TIter next_si(GetINDRA()->GetListOfSi());
774  KVSilicon* si;
775  while ((si = (KVSilicon*)next_si())) {
776  Int_t group = phds.GetValue(si->GetName(), 0);
777  if (group) {
778  Double_t p1 = phds.GetValue(Form("Group%d.p1", group), 0.0);
779  Double_t p2 = phds.GetValue(Form("Group%d.p2", group), 0.0);
780  //set parameters for this detector
781  //using si->SetMoultonPHDParameters(Double_t a_1, Double_t a_2, Double_t b_1, Double_t b_2)
782  //in our case,
783  // a_1 = 0.0223 a_2 = 0.5682 b_1 = p2 b_2 = p1
784  si->SetMoultonPHDParameters(0.0223, 0.5682, p2, p1);
785  }
786  }
787  //set flag in INDRA to say this has been done
788  GetINDRA()->PHDSet();
789  }
790  else {
791  Error("SetPHDs", "File %s not found", phdfile.Data());
792  }
793  }
794 }
795 
796 
int Int_t
unsigned int UInt_t
bool Bool_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
kEnvLocal
void AbstractMethod(const char *method)
char * Form(const char *fmt,...)
virtual const Char_t * GetType() const
Definition: KVBase.h:177
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
Definition: KVBase.cpp:538
Base class for all detector calibrations.
Definition: KVCalibrator.h:99
Int_t GetNumberParams() const
Definition: KVCalibrator.h:153
void SetParameter(int i, Double_t par_val) const
Definition: KVCalibrator.h:158
void SetStatus(Bool_t ready)
Definition: KVCalibrator.h:166
Ionisation chamber detectors of the INDRA multidetector array.
Definition: KVChIo.h:30
virtual Double_t GetPressure() const
Definition: KVChIo.h:49
virtual void SetPressure(Double_t P)
Definition: KVChIo.h:44
CsI(Tl) scintillation detectors of the INDRA multidetector array.
Definition: KVCsI.h:16
CHIO pressure parameters.
virtual Float_t GetPressure(UInt_t chio_number)
To store calibration parameters in a database ,.
Double_t GetParameter(UShort_t i=0) const
virtual KVRList * GetLinks(const Char_t *key) const
Returns the list of records linked to this record in table "key".
Definition: KVDBRecord.cpp:206
Description of an experimental run in database ,,.
Definition: KVDBRun.h:36
Int_t GetTrigger() const
Definition: KVDBRun.h:104
Base class for detector geometry description.
Definition: KVDetector.h:160
void SetDetecting(Bool_t yes=kTRUE)
Definition: KVDetector.h:677
KVCalibrator * GetCalibrator(const Char_t *name, const Char_t *type) const
Definition: KVDetector.h:815
virtual Bool_t IsPresent() const
Definition: KVDetector.h:663
void SetGain(Double_t gain)
Definition: KVDetector.h:842
void SetPresent(Bool_t yes=kTRUE)
Definition: KVDetector.h:668
GANIL VXI/VME 16 bit (maximum) EBYEDAT acquisition parameter.
KVDBRun * GetDBRun(Int_t number) const
Definition: KVExpDB.h:76
virtual TString GetDBEnv(const Char_t *) const
Definition: KVExpDB.cpp:680
UInt_t GetRingNumber() const
Class implementing necessary methods for setting INDRA parameters for each run, using information sto...
virtual void SetVoltEnergyChIoSiParameters(KVDBRun *)
KVINDRA * GetINDRA()
virtual void SetChIoPressures(KVDBRun *)
virtual void SetCalibParameters(KVDBRun*);
virtual void SetPHDs(KVDBRun *)
virtual void SetChVoltParameters(KVDBRun *)
virtual void SetPedestals(KVDBRun*);
virtual void SetGains(KVDBRun *)
virtual void SetTrigger(KVDBRun *)
virtual void SetCalibrationParameters(UInt_t);
void CheckStatusOfDetectors(KVDBRun *)
virtual void SetLitEnergyCsIParameters(KVDBRun *)
Setting Light- Energy CsI calibration parameters for Z=1.
virtual void SetParameters(UInt_t run, Bool_t physics_parameters_only=kFALSE)
virtual void SetCsIGainCorrectionParameters(KVDBRun *)
INDRA multidetector array geometry.
Definition: KVINDRA.h:71
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:37
virtual Int_t GetSize() const
Definition: KVRList.h:77
virtual KVBase * FindObject(const Char_t *name, const Char_t *type) const
Definition: KVRList.cpp:106
KaliVeda extensions to ROOT collection classes.
Silicon detectors of the INDRA array.
Definition: KVSilicon.h:19
void SetMoultonPHDParameters(Double_t a1, Double_t a2, Double_t b1, Double_t b2)
Definition: KVSilicon.cpp:123
virtual const char * GetValue(const char *name, const char *dflt) const
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
void Reset()
const char * GetName() const override
const char * GetTitle() const override
TObject * At(Int_t idx) const override
const char * Data() const
void Error(const char *location, const char *fmt,...)
void Info(const char *location, const char *fmt,...)
void Warning(const char *location, const char *fmt,...)
ClassImp(TPyArg)