BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
postrun_update.C
Go to the documentation of this file.
1// changing raw file path according to the real directory, where they are located
2int update_raw_file_path(const char* raw_file_directory = "/eos/nica/bmn/exp/raw/run9/beam/",
3 int period_number = 9,
4 int start_run = 1,
5 int end_run = 100000)
6{
8 if (connDb == nullptr) {
9 cout << "ERROR: connection to the UniConDa database failed" << endl;
10 return -1;
11 }
12
13 TSQLServer* db_server = connDb->GetSQLServer();
14
15 TString sql = TString::Format("update raw_file "
16 "set file_path = $1 || regexp_replace(file_path, '^.+[/\\\\]', '') "
17 "where period_number = $2 and run_number >= $3 and run_number <= $4");
18 TSQLStatement* stmt = db_server->Statement(sql);
19
20 // to remove incorrect raw files with duplicate paths (inserted before with incorrect parameters)
21 // delete from raw_file where file_id in (select rf1.file_id from raw_file rf1 cross join raw_file rf2
22 // where (rf1.file_id < rf2.file_id) and
23 //(regexp_replace(rf1.file_path, '^.+[/\\‍]', '') = regexp_replace(rf2.file_path, '^.+[/\\‍]', '')))
24
25 stmt->NextIteration();
26 stmt->SetString(0, raw_file_directory);
27 stmt->SetInt(1, period_number);
28 stmt->SetInt(2, start_run);
29 stmt->SetInt(3, end_run);
30
31 // write correct value to the database
32 if (!stmt->Process()) {
33 cout << "ERROR: updating information on raw file paths failed" << endl;
34 delete stmt;
35 delete connDb;
36 return -2;
37 }
38 delete stmt;
39 delete connDb;
40
41 return 0;
42}
43
44// correcting start and end times of the period/session according to the real first and last run
45int update_run_period_time(int period_number, int start_run, int end_run)
46{
48 if (connDb == nullptr) {
49 cout << "ERROR: connection to the UniConDa database failed" << endl;
50 return -1;
51 }
52
53 TSQLServer* db_server = connDb->GetSQLServer();
54
56 "update run_period set "
57 "start_datetime = (select start_datetime from run_ where period_number = $1 and run_number = $2), "
58 "end_datetime = (select end_datetime from run_ where period_number = $3 and run_number = $4) "
59 "where period_number = $5");
60 TSQLStatement* stmt = db_server->Statement(sql);
61
62 stmt->NextIteration();
63 stmt->SetInt(0, period_number);
64 stmt->SetInt(1, start_run);
65 stmt->SetInt(2, period_number);
66 stmt->SetInt(3, end_run);
67 stmt->SetInt(4, period_number);
68
69 // write correct value to the database
70 if (!stmt->Process()) {
71 cout << "ERROR: updating information on the start and end time of the run period failed" << endl;
72 delete stmt;
73 delete connDb;
74 return -2;
75 }
76 delete stmt;
77 delete connDb;
78
79 return 0;
80}
81
82// correcting detector parameter ranges according to the real first and last run numbers
83// 1. start_period_number::prev_start_run -> start_period_number::new_start_run
84// if prev_start_run == -1 then changes any old start run to new_start_run for the period
85// 2. end_period_number::prev_end_run -> end_period_number::new_end_run
86// if prev_end_run == -1 then changes any old end run to new_end_run for the period
87int update_detector_parameter_range(int period_number,
88 int new_start_run,
89 int new_end_run,
90 int prev_start_run = -1,
91 int prev_end_run = -1,
92 bool delete_prev_runs = false)
93{
95 if (connDb == nullptr) {
96 cout << "ERROR: connection to the UniConDa database failed" << endl;
97 return -1;
98 }
99
100 TSQLServer* db_server = connDb->GetSQLServer();
101
102 TString sql = TString::Format("update detector_parameter "
103 "set start_run = $1 "
104 "where start_period = $2 and ($3 = -1 or $3 = start_run)");
105 TSQLStatement* stmt = db_server->Statement(sql);
106
107 stmt->NextIteration();
108 stmt->SetInt(0, new_start_run);
109 stmt->SetInt(1, period_number);
110 stmt->SetInt(2, prev_start_run);
111
112 // write correct value to the database
113 if (!stmt->Process()) {
114 cout << "ERROR: updating information on the start number of the detector parameters failed" << endl;
115 delete stmt;
116 delete connDb;
117 return -2;
118 }
119 delete stmt;
120
121 sql = TString::Format("update detector_parameter "
122 "set end_run = $1 "
123 "where end_period = $2 and ($3 = -1 or $3 = end_run)");
124
125 stmt = db_server->Statement(sql);
126
127 stmt->NextIteration();
128 stmt->SetInt(0, new_end_run);
129 stmt->SetInt(1, period_number);
130 stmt->SetInt(2, prev_end_run);
131
132 // write correct value to the database
133 if (!stmt->Process()) {
134 cout << "ERROR: updating information on the end number of the detector parameters failed" << endl;
135 delete stmt;
136 delete connDb;
137 return -3;
138 }
139 delete stmt;
140
141 if (delete_prev_runs) {
142 sql = TString::Format("delete from run_ "
143 "where period_number = $1 and (run_number = $2 or run_number = $3)");
144 stmt = db_server->Statement(sql);
145
146 stmt->NextIteration();
147 stmt->SetInt(0, period_number);
148 stmt->SetInt(1, prev_start_run);
149 stmt->SetInt(2, prev_end_run);
150
151 // delete previous runs in the database
152 if (!stmt->Process()) {
153 cout << "ERROR: deleting previous runs failed" << endl;
154 delete stmt;
155 delete connDb;
156 return -4;
157 }
158 delete stmt;
159 }
160
161 delete connDb;
162
163 return 0;
164}
165
166// writing absent run metadata (beam, target, energy, field_voltage)
167// from e-Log to the UniConDa database for the given run range
168int update_run_metadata_from_elog(int period = 9, int start_run = 1, int end_run = 100000)
169{
170 // get all run numbers for the given period
171 UniqueRunNumber* run_numbers;
172 int run_count = UniRun::GetRunNumbers(run_numbers, period, start_run, period, end_run);
173 if (run_count <= 0)
174 return -1;
175 cout << "run count = " << run_count << endl;
176
177 // cycle by all runs for the given period
178 for (int i = 0; i < run_count; i++) {
179 // get the current run
180 UniRun* pCurrentRun = UniRun::GetRun(run_numbers[i].period_number, run_numbers[i].run_number);
181 if (pCurrentRun == nullptr) {
182 cout << "The function encountered with errors: no experimental run was found ("
183 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
184 << endl;
185 continue;
186 }
187
188 // get existing values (beam, target, energy, field, run_type) in UniConDa for the record
189 TString run_beam = pCurrentRun->GetBeamParticle().Strip(TString::kBoth);
190 TString run_target = pCurrentRun->GetTargetParticle();
191 double* run_energy = pCurrentRun->GetEnergy();
192 double* run_field = pCurrentRun->GetFieldVoltage();
193 int run_type = pCurrentRun->GetRunType();
194
195 // if some of the values are empty then get them from e-Log
196 if ((run_beam == "") || (run_energy == nullptr) || (run_field == nullptr)) {
197 // cout<<endl<<"Period:Run "<<run_numbers[i].period_number<<":"<<run_numbers[i].run_number<<endl;
198 TString elog_beam = "", elog_target = "";
199 double* elog_energy = nullptr;
200 int* elog_current = nullptr;
201 int elog_type = -1;
202
203 // get the corresonding e-Log records
204 TObjArray* pRecords = ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number);
205 // if not found then get e-Log information from the previous run
206 if ((pRecords == nullptr) || (pRecords->GetEntriesFast() == 0))
207 pRecords = ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number, -2);
208 TIter next(pRecords);
209 ElogRecord* curRecord;
210 while ((curRecord = (ElogRecord*)next()) != nullptr) {
211 TString tmp_elog_beam = curRecord->GetBeam().Strip(TString::kBoth);
212 if (tmp_elog_beam != "")
213 elog_beam = tmp_elog_beam;
214 TString tmp_elog_target = curRecord->GetTarget().Strip(TString::kBoth);
215 if (tmp_elog_target != "")
216 elog_target = curRecord->GetTarget();
217 if (curRecord->GetEnergy() != nullptr)
218 elog_energy = curRecord->GetEnergy();
219 if (curRecord->GetSp41() != nullptr)
220 elog_current = curRecord->GetSp41();
221 int tmp_elog_type = curRecord->GetTypeId();
222 if ((elog_type == -1) && (tmp_elog_type >= 1) && (tmp_elog_type <= 3))
223 elog_type = curRecord->GetTypeId();
224 }
225
226 // FILL DATA FROM E-LOG IF ABSENT
227 // cout<<"run_beam = "<<run_beam<<" && elog_beam = "<<elog_beam<<endl
228 // <<"run_target = "<<run_target<<" && elog_target = "<<elog_target<<endl
229 // <<"run_energy = "<<(run_energy == nullptr ? 0 : (*run_energy))<<" && elog_energy = "<<(elog_energy ==
230 // nullptr ? 0 : (*elog_energy))<<endl
231 // <<"run_field = "<<(run_field == nullptr ? 0 : (*run_field))<<" && elog_field = "<<(elog_current ==
232 // nullptr ? 0 : ((*elog_current)/900.0*55.87))<<endl;
233 if ((run_beam == "") && (elog_beam != "")) {
234 cout << "Period:Run " << run_numbers[i].period_number << ":" << run_numbers[i].run_number
235 << ". Recording beam particle... new value = " << elog_beam << " (old value = " << run_beam << ")"
236 << endl;
237 pCurrentRun->SetBeamParticle(elog_beam);
238 cout << "Period:Run " << run_numbers[i].period_number << ":" << run_numbers[i].run_number
239 << ". Recording target particle... new value = " << elog_target
240 << " (old value = " << (run_target == "" ? "-" : run_target) << ")" << endl;
241 pCurrentRun->SetTargetParticle(elog_target);
242 }
243 if ((run_energy == nullptr) && (elog_energy != nullptr)) {
244 cout << "Period:Run " << run_numbers[i].period_number << ":" << run_numbers[i].run_number
245 << ". Recording beam energy... new value = " << *elog_energy
246 << " (old value = " << (run_energy == nullptr ? 0 : (*run_energy)) << ")" << endl;
247 pCurrentRun->SetEnergy(elog_energy);
248 }
249 if ((run_field == nullptr) && (elog_current != nullptr)) {
250 cout << "Period:Run " << run_numbers[i].period_number << ":" << run_numbers[i].run_number
251 << ". Recording field voltage... new value = " << ((*elog_current) / 900.0 * 55.87)
252 << " (old value = " << (run_field == nullptr ? 0 : (*run_field)) << ")" << endl;
253 pCurrentRun->SetFieldVoltage(new double((*elog_current) / 900.0 * 55.87));
254 }
255 if ((elog_type != -1) && (run_type != elog_type)) {
256 cout << "Period:Run " << run_numbers[i].period_number << ":" << run_numbers[i].run_number
257 << ". Recording run type... new value = " << elog_type << " (old value = " << run_type << ")"
258 << endl;
259 pCurrentRun->SetRunType(elog_type);
260 }
261 } // if ((run_beam == "") || (run_target == nullptr) || (run_energy == nullptr) || (run_field == nullptr))
262 } // for (int i = 0; i < run_count; i++)
263
264 return 0;
265}
266
267// check that run metadata in the UniConDa database is the same as in the Electronic Logbook
268int compare_uniconda_elog(int period = 9,
269 int start_run = 1,
270 int end_run = 100000,
271 bool isChangeRunType = false,
272 bool isShowInfo = false)
273{
274 UniqueRunNumber* run_numbers;
275 int run_count = UniRun::GetRunNumbers(run_numbers, period, start_run, period, end_run);
276 if (run_count <= 0)
277 return -1;
278 cout << "run count = " << run_count << endl;
279
280 // cycle by all runs for the given period
281 for (int i = 0; i < run_count; i++) {
282 // get the current run info from the UniConDa database
283 UniRun* pCurrentRun = UniRun::GetRun(run_numbers[i].period_number, run_numbers[i].run_number);
284 if (pCurrentRun == nullptr) {
285 cout << "The function encountered with errors: no experimental run was found ("
286 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << "). This run will be skipped!"
287 << endl;
288 continue;
289 }
290 // cout << "Period:Run " << run_numbers[i].period_number << ":" << run_numbers[i].run_number << endl;
291
292 TString uniconda_beam = pCurrentRun->GetBeamParticle().Strip(TString::kBoth);
293 TString uniconda_target = pCurrentRun->GetTargetParticle();
294 double* uniconda_energy = pCurrentRun->GetEnergy();
295 // double* uniconda_field = pCurrentRun->GetFieldVoltage(); // it is already compared by another macro
296 int uniconda_type = pCurrentRun->GetRunType();
297
298 // get e-Log information
299 TObjArray* arrayRecords = ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number);
300 if (arrayRecords == nullptr) {
301 cout << "The function encountered with errors: no e-Log record was found (" << run_numbers[i].period_number
302 << ":" << run_numbers[i].run_number << "). This run will be skipped!" << endl;
303 continue;
304 }
305 bool isElogRecord = false;
306 TString elog_beam = "", elog_target = "";
307 double* elog_energy = nullptr;
308 int elog_type = -1;
309 for (int j = 0; j < arrayRecords->GetEntriesFast(); j++) {
310 ElogRecord* pRecord = (ElogRecord*)arrayRecords->At(j);
311 int tmp_elog_type = pRecord->GetTypeId();
312 if ((tmp_elog_type < 1) || (tmp_elog_type > 3))
313 continue;
314 isElogRecord = true;
315 elog_type = pRecord->GetTypeId();
316 elog_beam = pRecord->GetBeam();
317 elog_target = pRecord->GetTarget();
318 if ((elog_energy == nullptr) && (pRecord->GetEnergy() != nullptr))
319 elog_energy = pRecord->GetEnergy();
320 }
321
322 // compare beam and target information in UniConDa and e-Log
323 if (isElogRecord) {
324 if (uniconda_beam.CompareTo(elog_beam.Strip(TString::kBoth), TString::kIgnoreCase) != 0)
325 cout << "ERROR: different beam info found for run " << run_numbers[i].period_number << ":"
326 << run_numbers[i].run_number << " (" << uniconda_beam << " <> " << elog_beam << ")" << endl;
327 if (uniconda_target.CompareTo(elog_target.Strip(TString::kBoth), TString::kIgnoreCase) != 0)
328 cout << "ERROR: different target info found for run " << run_numbers[i].period_number << ":"
329 << run_numbers[i].run_number << " (" << uniconda_target << " <> " << elog_target << ")" << endl;
330 } else {
331 // compare beam and target value of the previous e-Log record with the UniConDa beam
332 TString elog_previous_beam = "", elog_previous_target = "";
333 TObjArray* arrayPreviousRecords =
334 ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number, -2);
335 if (arrayPreviousRecords != nullptr) {
336 for (int j = 0; j < arrayPreviousRecords->GetEntriesFast(); j++) {
337 ElogRecord* pRecord = (ElogRecord*)arrayPreviousRecords->At(j);
338 int tmp_elog_type = pRecord->GetTypeId();
339 if ((tmp_elog_type < 1) || (tmp_elog_type > 3))
340 continue;
341 isElogRecord = true;
342 elog_previous_beam = pRecord->GetBeam();
343 elog_previous_target = pRecord->GetTarget();
344 break;
345 }
346 }
347 if (!isElogRecord) {
348 cout << "WARNING: no previous e-Log record found for run " << run_numbers[i].period_number << ":"
349 << run_numbers[i].run_number << endl;
350 continue;
351 }
352
353 if ((isElogRecord)
354 && (uniconda_beam.CompareTo(elog_previous_beam.Strip(TString::kBoth), TString::kIgnoreCase) == 0))
355 {
356 if (isShowInfo)
357 cout << "INFO: the same beam information found in the previous e-Log record for run "
358 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << endl;
359 } else
360 cout << endl
361 << "ERROR: no beam information found in e-Log for run " << run_numbers[i].period_number << ":"
362 << run_numbers[i].run_number << endl;
363 if ((isElogRecord)
364 && (uniconda_target.CompareTo(elog_previous_target.Strip(TString::kBoth), TString::kIgnoreCase) == 0))
365 {
366 if (isShowInfo)
367 cout << "INFO: the same target information found in the previous e-Log record for run "
368 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << endl;
369 } else
370 cout << "ERROR: different target info found for run " << run_numbers[i].period_number << ":"
371 << run_numbers[i].run_number << " (" << uniconda_target << " <> " << elog_previous_target << ")"
372 << endl;
373 }
374
375 // compare beam energy information in UniConDa and e-Log
376 if (elog_energy != nullptr) {
377 if (uniconda_energy == nullptr)
378 cout << "ERROR: no beam energy information found in UniConDa for run " << run_numbers[i].period_number
379 << ":" << run_numbers[i].run_number << endl;
380 else if (((*uniconda_energy) - (*elog_energy)) > 0.000001)
381 cout << "ERROR: different beam energy found for run " << run_numbers[i].period_number << ":"
382 << run_numbers[i].run_number << " (" << *uniconda_energy << " <> " << *elog_energy << ")" << endl;
383 } else {
384 if (uniconda_energy == nullptr)
385 cout << "WARNING: no beam energy information found in e-Log and UniConDa for run "
386 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << endl;
387 else {
388 // compare beam energy value of the previous e-Log record with the UniConDa energy
389 double* elog_previous_energy = nullptr;
390 TObjArray* arrayPreviousRecords =
391 ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number, -2);
392 if (arrayPreviousRecords != nullptr) {
393 for (int j = 0; j < arrayPreviousRecords->GetEntriesFast(); j++) {
394 ElogRecord* pRecord = (ElogRecord*)arrayPreviousRecords->At(j);
395 if (pRecord->GetEnergy() != nullptr) {
396 elog_previous_energy = pRecord->GetEnergy();
397 break;
398 }
399 }
400 }
401 if ((elog_previous_energy != nullptr) and (((*uniconda_energy) - (*elog_previous_energy)) < 0.000001)) {
402 if (isShowInfo)
403 cout << "INFO: the same beam energy information found in the previous e-Log record for run "
404 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << endl;
405 } else
406 cout << "ERROR: no beam energy information found in e-Log for run " << run_numbers[i].period_number
407 << ":" << run_numbers[i].run_number << endl;
408 }
409 }
410
411 // compare run type in UniConDa and e-Log
412 if (elog_type != -1) {
413 if (uniconda_type != elog_type) {
414 cout << "ERROR: different run type found for run " << run_numbers[i].period_number << ":"
415 << run_numbers[i].run_number << " (" << uniconda_type << " <> " << elog_type << ")" << endl;
416 // write value from e-Log to UniConDa
417 if (isChangeRunType)
418 pCurrentRun->SetRunType(elog_type);
419 }
420 } else {
421 // compare type value of the previous e-Log record with the UniConDa type
422 int elog_previous_type = -1;
423 TObjArray* arrayPreviousRecords =
424 ElogRecord::GetRecords(run_numbers[i].period_number, run_numbers[i].run_number, -2);
425 if (arrayPreviousRecords != nullptr) {
426 for (int j = 0; j < arrayPreviousRecords->GetEntriesFast(); j++) {
427 ElogRecord* pRecord = (ElogRecord*)arrayPreviousRecords->At(j);
428 int tmp_previous_elog_type = pRecord->GetTypeId();
429 if ((tmp_previous_elog_type >= 1) && (tmp_previous_elog_type <= 3))
430 elog_previous_type = pRecord->GetTypeId();
431 }
432 }
433 if (elog_previous_type != -1)
434 if (uniconda_type == elog_previous_type) {
435 if (isShowInfo)
436 cout << "INFO: the run type found in the previous e-Log record for run "
437 << run_numbers[i].period_number << ":" << run_numbers[i].run_number << endl;
438 } else {
439 cout << "ERROR: different run type found for run " << run_numbers[i].period_number << ":"
440 << run_numbers[i].run_number << " (" << uniconda_type << " <> " << elog_previous_type << ")"
441 << endl;
442 // write value from e-Log to UniConDa
443 if (isChangeRunType)
444 pCurrentRun->SetRunType(elog_previous_type);
445 }
446 else
447 cout << "ERROR: no run type is defined in e-Log for run " << run_numbers[i].period_number << ":"
448 << run_numbers[i].run_number << endl;
449 }
450 } // for (int i = 0; i < run_count; i++)
451
452 return 0;
453}
454
455/**
456 * Main post run procedure to correct|update obtained metadata parameters
457 **/
458int postrun_update(int period_number = 9,
459 int start_run = 8968,
460 int end_run = 9094,
461 int prev_start_run = 1,
462 int prev_end_run = 100000)
463{
464 update_detector_parameter_range(period_number, start_run, end_run, prev_start_run, prev_end_run);
465 update_run_period_time(period_number, start_run, end_run);
466 update_run_metadata_from_elog(period_number, start_run, end_run);
467
468 compare_uniconda_elog(period_number, start_run, end_run);
469
470 return 0;
471}
int i
Definition P4_F32vec4.h:22
ElogRecord.h Class for the table: record_.
Definition ElogRecord.h:20
int * GetSp41()
get sp 41 of the current record
Definition ElogRecord.h:161
double * GetEnergy()
get energy of the current record
Definition ElogRecord.h:187
TString GetBeam()
get beam of the current record
Definition ElogRecord.h:185
TString GetTarget()
get target of the current record
Definition ElogRecord.h:195
int GetTypeId()
get type id of the current record
Definition ElogRecord.h:127
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...
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
virtual TSQLStatement * Statement(const char *, Int_t=100)
virtual Bool_t NextIteration()=0
virtual Bool_t SetString(Int_t, const char *, Int_t=256)
virtual Bool_t Process()=0
virtual Bool_t SetInt(Int_t, Int_t)
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
TSubString Strip(EStripType s=kTrailing, char c=' ') const
static TString Format(const char *fmt,...)
static UniConnection * Open()
TSQLServer * GetSQLServer()
UniRun.h Class for the table: run_.
Definition UniRun.h:21
double * GetEnergy()
get energy of the current run
Definition UniRun.h:113
int GetRunType()
get run type of the current run
Definition UniRun.h:97
static UniRun * GetRun(int period_number, int run_number)
get run from the database
Definition UniRun.cxx:161
int SetTargetParticle(TString target_particle)
set target particle of the current run
Definition UniRun.cxx:591
int SetRunType(int run_type)
set run type of the current run
Definition UniRun.cxx:451
TString GetBeamParticle()
get beam particle of the current run
Definition UniRun.h:109
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
int SetEnergy(double *energy)
set energy of the current run
Definition UniRun.cxx:624
int SetBeamParticle(TString beam_particle)
set beam particle of the current run
Definition UniRun.cxx:558
TString GetTargetParticle()
get target particle of the current run
Definition UniRun.h:111
int compare_uniconda_elog(int period=9, int start_run=1, int end_run=100000, bool isChangeRunType=false, bool isShowInfo=false)
int update_raw_file_path(const char *raw_file_directory="/eos/nica/bmn/exp/raw/run9/beam/", int period_number=9, int start_run=1, int end_run=100000)
int postrun_update(int period_number=9, int start_run=8968, int end_run=9094, int prev_start_run=1, int prev_end_run=100000)
Main post run procedure to correct|update obtained metadata parameters.
int update_detector_parameter_range(int period_number, int new_start_run, int new_end_run, int prev_start_run=-1, int prev_end_run=-1, bool delete_prev_runs=false)
int update_run_period_time(int period_number, int start_run, int end_run)
int update_run_metadata_from_elog(int period=9, int start_run=1, int end_run=100000)