KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVINDRAUpDater_e475s.cpp
1/*
2$Id: KVINDRAUpDater_e475s.cpp,v 1.7 2009/04/15 09:52:45 ebonnet Exp $
3$Revision: 1.7 $
4$Date: 2009/04/15 09:52:45 $
5*/
6
7//Created by KVClassFactory on Tue Sep 18 12:14:51 2007
8//Author: Eric Bonnet
9
10#include "KVINDRAUpDater_e475s.h"
11#include "KVDBRun.h"
12#include "KVDetector.h"
13#include "KVCalibrator.h"
14#include "KVDBParameterSet.h"
15#include "KVINDRA.h"
16#include "KVSilicon_e475s.h"
17#include "KVChIo_e475s.h"
18#include "KVCsI_e475s.h"
19#include "KVEBYEDAT_ACQParam.h"
20#include "KVINDRADB.h"
21
22#include "TList.h"
23#include "TString.h"
24
25using namespace std;
26
28
29
30
31
33
35{
36 //Default constructor
37}
38
39
40
43
48
49
50
57
59{
60
61
62 //Set calibration parameters for this run.
63 //This will:
64 // remove all the calibrators of all the detectors ready to receive the calibrators for the run (handled by child classes),
65 // set calibration parameters for the run
66 // set pedestals for the run
67
68 cout << "Setting calibration parameters of INDRA array for run " << run << ":" <<
69 endl;
70 KVDBRun* kvrun = gIndraDB->GetRun(run);
71 if (!kvrun) {
72 Error("SetParameters(UInt_t)", "Run %u not found in database!", run);
73 return;
74 }
75 //Reset all calibrators of all detectors first
76 TIter next(fArray->GetDetectors());
77 KVDetector* kvd;
78 while ((kvd = (KVDetector*) next())) {
79 if (kvd->InheritsFrom("KVSiLi") || kvd->InheritsFrom("KVSi75")) {
80 if (kvd->GetListOfCalibrators())
81 kvd->RemoveCalibrators();
82 kvd->SetCalibrators();
83 }
84 else {
85 if (kvd->GetListOfCalibrators()) {
86 kvd->RemoveCalibrators();
87 TIter lacq(kvd->GetACQParamList());
88 KVEBYEDAT_ACQParam* acq = 0;
89 while ((acq = (KVEBYEDAT_ACQParam*)lacq())) {
90 acq->SetPedestal(0);
91 }
92 }
93 }
94 }
95 SetCalibParameters(kvrun);
96 SetPedestals(kvrun);
97
98}
99
100
101
102
103
105
107{
108
109 KVRList* param_list = kvrun->GetLinks("Calibrations");
110
111 if (!param_list)
112 return;
113 if (!param_list->GetSize())
114 return;
115
116 //KVDetector *kvd;
117 KVDBParameterSet* kvps;
118 TIter next_ps(param_list);
119 TString str;
120
121 // Setting all calibration parameters available
122 while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres
123 str = kvps->GetName();
124 if (gIndra->GetDetector(str.Data())) {
125
126 if (gIndra->GetDetector(str.Data())->InheritsFrom("KVSilicon_e475s")) {
127 ((KVSilicon_e475s*)gIndra->GetDetector(str.Data()))->SetCalibrator(kvps);
128 }
129 else if (gIndra->GetDetector(str.Data())->InheritsFrom("KVChIo_e475s")) {
130 ((KVChIo_e475s*)gIndra->GetDetector(str.Data()))->SetCalibrator(kvps);
131 }
132 else if (gIndra->GetDetector(str.Data())->InheritsFrom("KVCsI_e475s")) {
133 ((KVCsI_e475s*)gIndra->GetDetector(str.Data()))->SetCalibrator(kvps);
134 }
135 else {
136 Warning("SetCalibParameters(KVDBRun*)",
137 "Calibrator %s %s not found ! ",
138 kvps->GetName(), kvps->GetTitle());
139 }
140 } //detector found
141 } //boucle sur les parameters
142
143}
144
145
146
147
148
150
152{
153
154 KVRList* param_list = kvrun->GetLinks("Pedestals");
155
156 if (!param_list)
157 return;
158 if (!param_list->GetSize())
159 return;
160
161 KVDetector* det;
162 KVDBParameterSet* kvps;
163 TIter next_ps(param_list);
164 KVString str;
165 Double_t pied_value;
166
167 // Setting all pedestal values available
168 while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres
169 str = kvps->GetName();
170 if ((det = gIndra->GetDetector(str.Data()))) {
171 pied_value = kvps->GetParameter(1);
172 det->SetPedestal(kvps->GetTitle(), pied_value);
173 } //detector found
174 } //boucle sur les parameters
175
176}
177
178
unsigned int UInt_t
double Double_t
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".
Description of an experimental run in database ,,.
Definition KVDBRun.h:36
Base class for detector geometry description.
Definition KVDetector.h:160
KVList * GetListOfCalibrators() const
Definition KVDetector.h:386
virtual void RemoveCalibrators()
GANIL VXI/VME 16 bit (maximum) EBYEDAT acquisition parameter.
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
const KVSeqCollection * GetDetectors() const
KVINDRADBRun * GetRun(Int_t run) const
Definition KVINDRADB.h:133
Sets run parameters for INDRA_e475s dataset.
virtual ~KVINDRAUpDater_e475s()
Destructor.
void SetCalibParameters(KVDBRun *run)
Wrapper for TRefArray adding some functionality.
Definition KVRList.h:37
virtual Int_t GetSize() const
Definition KVRList.h:77
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73
KVMultiDetArray * fArray
associated array
Definition KVUpDater.h:29
const char * GetName() const override
const char * GetTitle() const override
virtual Bool_t InheritsFrom(const char *classname) const
void Error(const char *location, const char *fmt,...)
void Warning(const char *location, const char *fmt,...)
ClassImp(TPyArg)