10 const char* detector_name =
"magnet";
11 const char* parameter_name =
"field_voltage";
13 for (
int i = 0;
i < run_count;
i++) {
16 if (pRun ==
nullptr) {
17 cout <<
"The function encountered with errors: no experimental run was found ("
24 if (field_voltage ==
nullptr) {
25 cout <<
"No field current in the database for this run (" << run_numbers[
i].
period_number <<
":"
26 << run_numbers[
i].
run_number <<
"). This run will be skipped!" << endl;
35 if (pDetector ==
nullptr) {
36 cout <<
"\nMacro finished with errors" << endl;
40 cout <<
"The magnet was added to detectors in the database" << endl;
47 if (pParameter ==
nullptr) {
48 cout <<
"\nMacro finished with errors" << endl;
52 cout <<
"The 'average_field_mv' parameter was added to the database" << endl;
58 dValue.
value = *field_voltage;
62 if (pDetectorParameter ==
nullptr) {
63 cout <<
"\nMacro finished with errors" << endl;
67 cout <<
"Field current was written to the database (" << run_numbers[
i].
period_number <<
":"
69 delete pDetectorParameter;
73 cout <<
"Macro finished successfully" << endl;
83 const char* detector_name =
"magnet";
84 const char* parameter_name =
"field_current";
86 for (
int i = 0;
i < run_count;
i++) {
89 if (pDetectorParameter ==
nullptr) {
97 delete pDetectorParameter;
101 cout <<
"Macro finished successfully" << endl;
int GetValue(vector< UniValue * > ¶meter_value)
get value of detector parameter presented by an array
static UniDetectorParameter * GetDetectorParameter(int value_id)
get detector parameter from the database
static UniDetectorParameter * CreateDetectorParameter(TString detector_name, int parameter_id, int start_period, int start_run, int end_period, int end_run, int value_key, unsigned char *parameter_value, Long_t size_parameter_value, TDatime *expiry_date)
add new detector parameter to the database
UniDetector.h Class for the table: detector_.
static int CheckDetectorExists(TString detector_name)
check detector exists in the database: 1- true, 0 - false, <0 - database operation error
static UniDetector * CreateDetector(TString detector_name, TString *detector_desc)
add new detector to the database
static UniParameter * CreateParameter(TString parameter_name, int parameter_type, bool is_array)
add new parameter to the database
static int CheckParameterExists(int parameter_id)
check parameter exists in the database: 1- true, 0 - false, <0 - database operation error
UniRun.h Class for the table: run_.
static UniRun * GetRun(int period_number, int run_number)
get run from the database
double * GetFieldVoltage()
get field voltage of the current run
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
void print_parameter(int period)
void move_field_2_parameter(int period)