BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
put_parameter_value_complex.C
Go to the documentation of this file.
1// macro for adding parameter value (if parameter exist - you could check existing parameters by
2// 'UniParameter::PrintAll()' function)
4{
5 bool return_error = false;
6
7 // add noise parameter value presented by IIStructure: Int+Int (slot:channel)
8 vector<UniValue*> pValues;
9
10 int count = 48 - 33 + 1; // slot: 15, channel: 33-48
11 for (int i = 0; i < count; i++) {
12 IIValue* pValue = new IIValue;
13 pValue->value1 = 15;
14 pValue->value2 = 33 + i;
15
16 pValues.push_back(pValue);
17 }
18 count = 64 - 49 + 1; // slot: 16, channel: 49-64
19 for (int i = 0; i < count; i++) {
20 IIValue* pValue = new IIValue;
21 pValue->value1 = 16;
22 pValue->value2 = 49 + i;
23
24 pValues.push_back(pValue);
25 }
26
27 UniDetectorParameter* pDetectorParameter =
28 UniDetectorParameter::CreateDetectorParameter("DCH1", "noise", 1, 77, 1, 77, pValues);
29 if (pDetectorParameter == nullptr)
30 return_error = true;
31
32 // clean memory after work
33 for (int i = 0; i < pValues.size(); i++)
34 delete pValues[i];
35 if (pDetectorParameter)
36 delete pDetectorParameter;
37
38 if (return_error)
39 cout << "\nMacro finished with errors" << endl;
40 else
41 cout << "\nMacro finished successfully" << endl;
42}
int i
Definition P4_F32vec4.h:22
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
void put_parameter_value_complex()