BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
put_parameter_value_json.C
Go to the documentation of this file.
1// macro for adding parameter value in JSON format
3{
4 /*
5 UniParameter* pParameter = UniParameter::CreateParameter("my_json", JsonType, false);
6 if (pParameter == nullptr)
7 {
8 cout << "\nMacro finished with errors" << endl;
9 return;
10 }
11 // clean memory after work
12 delete pParameter;
13 */
14
15 JsonValue json_value;
16 json_value.value = json::parse(R"({"simulation": true, "pi": 3.141})");
17 UniDetectorParameter* pDetectorParameter =
18 UniDetectorParameter::CreateDetectorParameter("DCH1", "my_json", 1, 77, 1, 77, &json_value);
19 if (pDetectorParameter == nullptr) {
20 cout << "\nMacro finished with errors" << endl;
21 return;
22 }
23 // clean memory after work
24 delete pDetectorParameter;
25
26 cout << "\nMacro finished successfully" << endl;
27}
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_json()