BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
show_avg_field.C
Go to the documentation of this file.
1// # define RUN_1_7
2// for RUN 1 to 7
3#ifdef RUN_1_7
4const char* system_name = "bmn";
5const char* parameter_name = "ch1";
6// for RUN greater than 7
7#else
8const char* system_name = "magnet";
9const char* parameter_name = "ch_1";
10#endif
11
12/**
13 * Function to calculate and show average magnetic field values (voltage, mV) from Tango for runs of the given
14 *period/session to UniConDa Parameters: period_number - period/session number start_run - number of the first run of
15 *the interval end_run - number of the end run of the interval isShowElog - whether show also corresponding e-Log values
16 * isOnlyDifferent - show average magnetic field values from Tango only for different e-Log values (current, A)
17 **/
18int show_avg_field(int period_number = 9,
19 int start_run = 8977,
20 int end_run = 9094,
21 bool isShowElog = true,
22 bool isOnlyDifferent = true)
23{
24 // get the given period
25 UniRunPeriod* pCurrentPeriod = UniRunPeriod::GetRunPeriod(period_number);
26 if (pCurrentPeriod == nullptr) {
27 cout << "The function encountered with errors: no experimental period was found with number " << period_number
28 << endl;
29 return -1;
30 }
31 const string red("\033[0;91m"), orange("\033[0;33m"), cyan("\033[0;96m"), reset("\033[0m");
32
33 TDatime period_start_time = pCurrentPeriod->GetStartDatetime();
34 TDatime* period_end_time = pCurrentPeriod->GetEndDatetime();
35 delete pCurrentPeriod;
36 if (period_end_time == nullptr) {
37 cout << "ERROR: there is no end time for Period " << period_number << "Exiting..." << endl;
38 return -2;
39 }
40
41 UniqueRunNumber* run_numbers;
42 int run_count = UniRun::GetRunNumbers(run_numbers, period_number, start_run, period_number, end_run);
43 if (run_count <= 0)
44 return -1;
45
46 int out_start_run_time = 0, no_end_time_run = 0, out_end_run_time = 0, no_field_elog = 0, diff_count = 0;
47 for (int i = 0; i < run_count; i++) {
48 // get run time
49 UniRun* pRun = UniRun::GetRun(run_numbers[i].period_number, run_numbers[i].run_number);
50 if (pRun == nullptr) {
51 cout << "The function encountered with errors: no experimental run was found ("
52 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
53 << endl
54 << endl;
55 continue;
56 }
57
58 TDatime startDate = pRun->GetStartDatetime();
59 TString strStartDate = startDate.AsSQLString();
60 if ((startDate < period_start_time) || (startDate > (*period_end_time))) {
61 out_start_run_time++;
62 cout << "ERROR: the start time of the run is out of range: " << startDate.AsSQLString() << endl;
63 delete pRun;
64 continue;
65 }
66
67 TDatime* endDate = pRun->GetEndDatetime();
68 if (endDate == nullptr) {
69 no_end_time_run++;
70 cout << "The function encountered with errors: no end datetime in the database for the run ("
71 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
72 << endl
73 << endl;
74 delete pRun;
75 continue;
76 }
77 if (((*endDate) < period_start_time) || ((*endDate) > (*period_end_time))) {
78 out_end_run_time++;
79 cout << "ERROR: the end time of the run is out of range: " << endDate->AsSQLString() << endl;
80 delete endDate;
81 delete pRun;
82 continue;
83 }
84 TString strEndDate = endDate->AsSQLString();
85 delete endDate;
86 delete pRun;
87
88 // calculate average magnetic field (voltage, mV) from the Tango database
89 TangoData db_tango(strStartDate.Data(), strEndDate.Data(), system_name, parameter_name); //, "", 1);
90 if (db_tango.GetTangoData() == nullptr) {
91 cout << "The function encountered with errors: result Tango data is null (" << run_numbers[i].period_number
92 << ":" << run_numbers[i].run_number << "). This run will be skipped!" << endl;
93 continue;
94 }
95
96 vector<double> vec_average = db_tango.GetAverageTangoData();
97 if (vec_average.empty()) {
98 cout << "The function encountered with errors: Tango data is empty or average value is wrong ("
99 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
100 << endl
101 << endl;
102 continue;
103 }
104 size_t data_count = db_tango.GetTangoData()->GetEntriesFast();
105
106 double average_field = vec_average[0];
107 double average_current = average_field * 900 / 55.87;
108 double average_coeff = average_field / 55.87;
109
110 if (!isShowElog) {
111 cout << "Run " << run_numbers[i].period_number << "-" << run_numbers[i].run_number
112 << " (number of time counts: " << data_count << ")" << endl;
113 cout << "Average magnetic field from Tango: " << average_field << " mV" << endl;
114 cout << "Calculated current: " << average_current << " A (ratio: " << average_coeff << ")" << endl << endl;
115 continue;
116 }
117
118 // get e-Log info
119 TObjArray* arrayRecords = ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number);
120 if (arrayRecords == nullptr) {
121 cout << "The function encountered with errors: no e-Log record was found (" << run_numbers[i].period_number
122 << ":" << run_numbers[i].run_number << "). This run will be skipped!" << endl
123 << endl;
124 continue;
125 }
126 int* pField = nullptr;
127 for (int j = 0; j < arrayRecords->GetEntriesFast(); j++) {
128 ElogRecord* pRecord = (ElogRecord*)arrayRecords->At(j);
129 pField = pRecord->GetSp41();
130 if (pField != nullptr)
131 break;
132 }
133
134 if (pField == nullptr) {
135 no_field_elog++;
136 cout << "The function encountered with errors: no SP-41 field set in e-Log ("
137 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
138 << endl
139 << endl;
140 delete arrayRecords;
141 continue;
142 }
143
144 double elog_voltage = (*pField) * 55.87 / 900;
145 delete arrayRecords;
146
147 // compare ELog magnet field and average field from Tango database
148 bool isDifferent = false;
149 if (fabs(average_field - elog_voltage) > 5)
150 isDifferent = true;
151 if ((isOnlyDifferent) && (!isDifferent)) {
152 delete pField;
153 continue;
154 }
155
156 cout << "Run " << run_numbers[i].period_number << "-" << run_numbers[i].run_number << endl;
157 cout << "Average Tango magnetic field: " << average_field << " mV (" << data_count << " counts)." << endl;
158 cout << "e-Log magnetic field: " << elog_voltage << " mV (" << (*pField) << " A)" << endl;
159 if (fabs(average_field - elog_voltage) > 5) {
160 diff_count++;
161 cout << "ERROR: e-Log and Tango magnetic fields differ by more than 5 mV!" << endl;
162 }
163 cout << endl;
164
165 delete pField;
166 }
167
168 cout << endl << red;
169 if (out_start_run_time > 0)
170 cout << "The start time of the run is out of range in " << out_start_run_time << " run(s)" << endl;
171 if (no_end_time_run > 0)
172 cout << "There is no end time in " << no_end_time_run << " run(s)" << endl;
173 if (out_end_run_time > 0)
174 cout << "The end time of the run is out of range in " << out_end_run_time << " run(s)" << endl;
175 if (no_field_elog > 0)
176 cout << "There is no field value (e-Log) in " << no_field_elog << " run(s)" << endl;
177 if (diff_count > 0)
178 cout << "e-Log and Tango magnetic fields differ in " << diff_count << " run(s)" << endl;
179 cout << reset;
180
181 delete run_numbers;
182 cout << "Macro finished successfully" << endl;
183 return 0;
184}
185
186/**
187 * Function to display magnetic field for a given time interval corresponding to the specified run range
188 * end_period == -1 means "end_period = start_period"
189 * end_run == -1 means "end_run = start_run"
190 **/
191int show_field_graph(int start_period = 8, int start_run = 6866, int end_period = -1, int end_run = -1)
192{
193 // get time of the begin run
194 UniRun* pStartRun = UniRun::GetRun(start_period, start_run);
195 if (pStartRun == nullptr) {
196 cout << "Macro finished with errors: no experimental run was found - " << start_period << ":" << start_run
197 << " (period:run)" << endl;
198 return -1;
199 }
200
201 TDatime startDate = pStartRun->GetStartDatetime();
202 TString strStartDate = startDate.AsSQLString();
203
204 TDatime* endDate = nullptr;
205 if ((end_period == -1) && (end_run == -1))
206 endDate = pStartRun->GetEndDatetime();
207 else {
208 if (end_period == -1)
209 end_period = start_period;
210
211 // get time of the end run
212 UniRun* pEndRun = UniRun::GetRun(end_period, end_run);
213 if (pEndRun == nullptr) {
214 cout << "Macro finished with errors: no experimental run was found - " << end_period << ":" << end_run
215 << " (period:run)" << endl;
216 delete pStartRun;
217 return -1;
218 }
219 endDate = pEndRun->GetEndDatetime();
220 delete pEndRun;
221 }
222
223 if (endDate == nullptr) {
224 cout << "Macro finished with errors: no end datetime in the database for this run" << endl;
225 delete pStartRun;
226 return -2;
227 }
228 TString strEndDate = endDate->AsSQLString();
229 cout << endl << "Time interval: " << strStartDate << " - " << strEndDate << endl;
230 delete pStartRun;
231
232 // get Tango data
233 TangoData db_tango(strStartDate.Data(), strEndDate.Data(), system_name, parameter_name); //, "", 1);
234 if (db_tango.GetTangoData() == nullptr) {
235 cout << "Macro finished with errors: return Tango data is null" << endl;
236 return -3;
237 }
238
239 vector<double> vec_average = db_tango.GetAverageTangoData();
240 if (!vec_average.empty()) {
241 size_t data_count = db_tango.GetTangoData()->GetEntriesFast();
242
243 double average_field = vec_average[0];
244 double average_current = average_field * 900 / 55.87;
245 double average_coeff = average_field / 55.87;
246
247 cout << "Average magnetic field from Tango for the interval: " << average_field << " mV"
248 << " (number of counts: " << data_count << ")" << endl;
249 cout << "Calculated current: " << average_current << " A (ratio: " << average_coeff << ")" << endl << endl;
250 }
251
252 // print
253 db_tango.PrintTangoDataMultiGraph("hall sensor voltage, mV");
254
255 return 0;
256}
257
258// additional function for displaying magnetic field for the given time interval
259int show_field_graph(const char* start_time, const char* end_time)
260{
261 TDatime startDate(start_time);
262 TString strStartDate = startDate.AsSQLString();
263 TDatime endDate(end_time);
264 TString strEndDate = endDate.AsSQLString();
265 // cout<<"strStartDate = "<<strStartDate<<", strEndDate = "<<strEndDate<<endl;
266
267 // get Tango data
268 TangoData db_tango(strStartDate.Data(), strEndDate.Data(), system_name, parameter_name);
269 if (db_tango.GetTangoData() == nullptr) {
270 cout << "Macro finished with errors: return Tango data is null" << endl;
271 return -3;
272 }
273
274 vector<double> vec_average = db_tango.GetAverageTangoData();
275 if (!vec_average.empty()) {
276 size_t data_count = db_tango.GetTangoData()->GetEntriesFast();
277
278 double average_field = vec_average[0];
279 double average_current = average_field * 900 / 55.87;
280 double average_coeff = average_field / 55.87;
281
282 cout << "Average magnetic field from TangoDB for the interval: " << average_field
283 << " mV. Calculated current: " << average_current << " A. Ratio: " << average_coeff
284 << ". Number of counts: " << data_count << endl;
285 }
286
287 // print
288 db_tango.PrintTangoDataMultiGraph("hall sensor voltage, mV");
289
290 return 0;
291}
292
293/**
294 * Function to calculate and write Tango average magnetic field values for runs of the given period/session to UniConDa
295 **/
296void write_avg_field_db(int period_number = 9,
297 int start_run = 1,
298 int end_run = 100000,
299 bool is_rewrite = true,
300 float allowed_tolerance_pct = 10)
301{
302 UniqueRunNumber* run_numbers;
303 int run_count = UniRun::GetRunNumbers(run_numbers, period_number, start_run, period_number, end_run);
304 if (run_count <= 0)
305 return;
306
307 int error_count = 0;
308 for (int i = 0; i < run_count; i++) {
309 // get run time
310 UniRun* pRun = UniRun::GetRun(run_numbers[i].period_number, run_numbers[i].run_number);
311 if (pRun == nullptr) {
312 cout << "The function encountered with errors: no experimental run was found ("
313 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
314 << endl;
315 continue;
316 }
317
318 // get start and end time of the run
319 TDatime startDate = pRun->GetStartDatetime();
320 TString strStartDate = startDate.AsSQLString();
321 TDatime* endDate = pRun->GetEndDatetime();
322 if (endDate == nullptr) {
323 cout << "The function encountered with errors: no end datetime in the database ("
324 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
325 << endl;
326 delete pRun;
327 continue;
328 }
329 TString strEndDate = endDate->AsSQLString();
330 // if difference between start and end time is less than 2 seconds than skip
331 if ((endDate->Convert() - startDate.Convert()) < 2) {
332 cout << "The function encountered with errors: run duration <= 1 seconds (" << run_numbers[i].period_number
333 << ":" << run_numbers[i].run_number << "). This run will be skipped!" << endl;
334 delete pRun;
335 continue;
336 }
337
338 TangoData db_tango(strStartDate.Data(), strEndDate.Data(), system_name, parameter_name);
339 if (db_tango.GetTangoData() == nullptr) {
340 cout << "The function encountered with errors: return data is null (" << run_numbers[i].period_number << ":"
341 << run_numbers[i].run_number << "). This run will be skipped!" << endl;
342 continue;
343 }
344
345 vector<double> vec_average = db_tango.GetAverageTangoData();
346 if (vec_average.empty()) {
347 cout << "The function encountered with errors: Tango data is empty or average value is wrong ("
348 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
349 << endl;
350 continue;
351 }
352
353 double average_field = vec_average[0];
354 size_t data_count = db_tango.GetTangoData()->GetEntriesFast();
355
356 cout << "Average magnetic field for run " << run_numbers[i].period_number << "-" << run_numbers[i].run_number
357 << ": " << average_field << " mV (" << data_count << " counts)." << endl;
358
359 // write average magnetic field value to the UniConDa run
360 if (pRun->GetFieldVoltage() == nullptr) {
361 pRun->SetFieldVoltage(&average_field);
362 cout << "Average magnetic field has been written to UniConDa" << endl << endl;
363 } else if (is_rewrite) {
364 double cur_voltage_value = *pRun->GetFieldVoltage();
365 // if cur_voltage value == 0 then check that average_field is really small than they corresponds
366 if ((cur_voltage_value == 0) and (average_field < 0.6))
367 cur_voltage_value = average_field;
368 double cur_tolerance_pct = std::abs(cur_voltage_value - average_field) / cur_voltage_value * 100; // in %
369 if (cur_tolerance_pct > allowed_tolerance_pct) {
370 cout << "ERROR: admissible tolerance (" << allowed_tolerance_pct
371 << "%) is exceeded, the current voltage value = " << cur_voltage_value << " mV, run period from "
372 << strStartDate.Data() << " to " << strEndDate.Data() << endl
373 << endl;
374 error_count++;
375 } else {
376 if (cur_tolerance_pct > 0.001)
377 cout << "ATTENTION: the current voltage value (" << cur_voltage_value
378 << " mV) will be rewritten with the new one within acceptable tolerance ("
379 << allowed_tolerance_pct << "%)" << endl;
380 pRun->SetFieldVoltage(&average_field);
381 cout << "Average magnetic field has been written to UniConDa" << endl << endl;
382 }
383 }
384
385 delete pRun;
386 }
387
388 if (error_count)
389 cout << "The count of exceeding the tolerance (skipped runs): " << error_count << endl;
390
391 delete run_numbers;
392 cout << "Macro finished successfully" << endl;
393}
394
395// additional function to compare magnetic field value (current, A) from e-Log database
396// and average magnetic field (voltage, mV) from UniCOnDa (saved before from Tango)
397int compare_avg_field(int period_number = 9, int start_run = 8977, int end_run = 9094)
398{
399 UniqueRunNumber* run_numbers;
400 int run_count = UniRun::GetRunNumbers(run_numbers, period_number, start_run, period_number, end_run);
401 if (run_count <= 0)
402 return -1;
403 const string red("\033[0;91m"), orange("\033[0;33m"), cyan("\033[0;96m"), reset("\033[0m");
404
405 int no_elog_record = 0, no_field_elog = 0, no_field_uniconda = 0;
406 vector<double> x, y;
407 bool* run_error = new bool[run_count];
408 for (int i = 0; i < run_count; i++) {
409 run_error[i] = 0;
410
411 // get e-Log info
412 TObjArray* arrayRecords = ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number);
413 if (arrayRecords == nullptr) {
414 no_elog_record++;
415 run_error[i] = 1;
416 cout << "The function encountered with errors: no e-Log record was found (" << run_numbers[i].period_number
417 << ":" << run_numbers[i].run_number << "). This run will be skipped!" << endl
418 << endl;
419 continue;
420 }
421
422 int* pField = nullptr;
423 for (int j = 0; j < arrayRecords->GetEntriesFast(); j++) {
424 ElogRecord* pRecord = (ElogRecord*)arrayRecords->At(j);
425 pField = pRecord->GetSp41();
426 if (pField != nullptr)
427 break;
428 }
429 if (pField == nullptr) {
430 no_field_elog++;
431 run_error[i] = 1;
432 cout << "The function encountered with errors: no SP-41 field was set in e-Log ("
433 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
434 << endl
435 << endl;
436 delete arrayRecords;
437 continue;
438 }
439 double elog_voltage = (*pField) * 55.87 / 900; // 0,062077778
440 delete arrayRecords;
441
442 // get UniConDa average field for run
443 UniRun* pRun = UniRun::GetRun(run_numbers[i].period_number, run_numbers[i].run_number);
444 if (pRun == nullptr) {
445 if (run_error[i] == 1)
446 run_error[i] = 3;
447 else
448 run_error[i] = 2;
449 cout << "The function encountered with errors: no experimental run was found ("
450 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
451 << endl
452 << endl;
453 continue;
454 }
455 double* avg_field = pRun->GetFieldVoltage();
456 delete pRun;
457 if (avg_field == nullptr) {
458 no_field_uniconda++;
459 if (run_error[i] == 1)
460 run_error[i] = 3;
461 else
462 run_error[i] = 2;
463 cout << "The function encountered with errors: no magnet field in the BM@N database ("
464 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
465 << endl
466 << endl;
467 continue;
468 }
469 double average_field = *avg_field;
470
471 cout << "Run " << run_numbers[i].period_number << ":" << run_numbers[i].run_number << endl;
472 cout << "Magnetic field current from e-Log: " << (*pField) << " A, " << elog_voltage << " mV" << endl;
473 cout << "Average magnetic field voltage from Tango: " << average_field << " mV" << endl << endl;
474
475 x.push_back(*pField);
476 y.push_back(average_field);
477 }
478
479 // canvas includes "U/I dependence" graph containing Utango values vs Ielog values
480 TCanvas* c1 = new TCanvas("c1", "U/I dependence", 100, 70, 700, 500);
481 TGraph* gr = new TGraph(x.size(), x.data(), y.data());
482 gr->SetTitle("");
483 gr->GetXaxis()->SetTitle("Ielog, A");
484 gr->GetYaxis()->SetTitle("Utango, mV");
485 gr->Draw("AP*");
486
487 TFitResultPtr fit_result = gr->Fit("pol1", "S");
488 // TMatrixDSym cov = fit_result->GetCovarianceMatrix();
489 // Double_t chi2 = fit_result->Chi2();
490 Double_t par0 = fit_result->Value(0);
491 Double_t par1 = fit_result->Value(1);
492 Double_t err0 = fit_result->Error(0);
493 Double_t err1 = fit_result->Error(1);
494 cout << "p1 = " << par1 << ". p1_error = " << err1 << ". p0 = " << par0 << ". p0_error = " << err0 << endl;
495
496 // calculate residuals for all runs
497 double* x2 = new double[run_count];
498 double* y2 = new double[run_count];
499 int iter = 0;
500 for (int i = 0; i < run_count; i++) {
501 if (run_error[i] == 0) {
502 x2[i] = i;
503 y2[i] = y[iter] - par1 * x[iter] - par0;
504 iter++;
505 } else {
506 x2[i] = i;
507 y2[i] = 0;
508 }
509 }
510
511 TCanvas* c2 = new TCanvas("c2", "The search for wrong field values", 200, 250, 1600, 600);
512 TGraph* grN = new TGraph(run_count, x2, y2);
513 grN->SetTitle("");
514 grN->GetXaxis()->SetTitle("run number");
515 grN->GetYaxis()->SetTitle("#DeltaU, mV");
516 grN->SetMarkerStyle(2);
517 grN->GetXaxis()->Set(run_count, 0, run_count - 1);
518
519 for (int i = 0; i < run_count; i++) {
520 if (run_error[i] != 0)
521 grN->GetXaxis()->SetBinLabel(i + 1, (TString::Format("Error %d", run_numbers[i].run_number).Data()));
522 else if ((y2[i] > 7) || (y2[i] < -7))
523 grN->GetXaxis()->SetBinLabel(i + 1, (TString::Format("%d", run_numbers[i].run_number).Data()));
524 }
525
526 grN->Draw("AP");
527
528 cout << endl << red;
529 if (no_elog_record > 0)
530 cout << "No e-Log record was found in " << no_elog_record << " run(s)" << endl;
531 if (no_field_elog > 0)
532 cout << "There is no field value (e-Log) in " << no_field_elog << " run(s)" << endl;
533 if (no_field_uniconda > 0)
534 cout << "There is no field value (UniConDa) in " << no_field_uniconda << " run(s)" << endl;
535 // if (diff_count > 0) cout<<"e-Log and Tango magnetic fields differ in "<<diff_count<<" run(s)"<<endl;
536 cout << reset;
537
538 return 0;
539}
friend F32vec4 fabs(const F32vec4 &a)
Definition P4_F32vec4.h:52
int i
Definition P4_F32vec4.h:22
double Double_t
ElogRecord.h Class for the table: record_.
Definition ElogRecord.h:20
int * GetSp41()
get sp 41 of the current record
Definition ElogRecord.h:161
static TObjArray * GetRecords(int period_number, int run_number, int findNeighbourRun=0)
get array of ElogRecord-s for a given or a neighbour run (the same period) from the database if findN...
double Value(unsigned int i) const
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual void SetBinLabel(Int_t bin, const char *label)
virtual void Set(Int_t nbins, const Double_t *xbins)
const char * AsSQLString() const
UInt_t Convert(Bool_t toGMT=kFALSE) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
void Draw(Option_t *chopt="") override
TAxis * GetXaxis() const
TAxis * GetYaxis() const
void SetTitle(const char *title="") override
virtual void SetTitle(const char *title="")
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
const char * Data() const
static TString Format(const char *fmt,...)
std::vector< double > GetAverageTangoData()
TObjArray * GetTangoData()
Definition TangoData.h:141
int PrintTangoDataMultiGraph(const char *y_axis="parameter", bool is3D=false)
UniRunPeriod.h Class for the table: run_period.
TDatime * GetEndDatetime()
get end datetime of the current run period
static UniRunPeriod * GetRunPeriod(int period_number)
get run period from the database
TDatime GetStartDatetime()
get start datetime of the current run period
UniRun.h Class for the table: run_.
Definition UniRun.h:21
static UniRun * GetRun(int period_number, int run_number)
get run from the database
Definition UniRun.cxx:161
TDatime * GetEndDatetime()
get end datetime of the current run
Definition UniRun.h:101
TDatime GetStartDatetime()
get start datetime of the current run
Definition UniRun.h:99
double * GetFieldVoltage()
get field voltage of the current run
Definition UniRun.h:121
static int GetRunNumbers(UniqueRunNumber *&run_numbers, int start_period, int start_run=0, int end_period=-1, int end_run=-1)
get numbers of runs stored in the Database for a selected range
Definition UniRun.cxx:804
int SetFieldVoltage(double *field_voltage)
set field voltage of the current run
Definition UniRun.cxx:665
const char * system_name
int show_field_graph(int start_period=8, int start_run=6866, int end_period=-1, int end_run=-1)
void write_avg_field_db(int period_number=9, int start_run=1, int end_run=100000, bool is_rewrite=true, float allowed_tolerance_pct=10)
const char * parameter_name
int show_avg_field(int period_number=9, int start_run=8977, int end_run=9094, bool isShowElog=true, bool isOnlyDifferent=true)
int compare_avg_field(int period_number=9, int start_run=8977, int end_run=9094)