BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
get_parameter_value_json.C
Go to the documentation of this file.
1
// macro for getting parameter value in JSON format
2
void
get_parameter_value_json
()
3
{
4
// get 'on' parameter value (boolean value)
5
UniDetectorParameter
* pDetectorParameter =
UniDetectorParameter::GetDetectorParameter
(
6
"DCH1"
,
"my_json"
, 1, 77);
//(detector_name, parameter_name, period_number, run_number)
7
if
(pDetectorParameter ==
nullptr
) {
8
cout <<
"\nMacro finished with errors"
<< endl;
9
return
;
10
}
11
12
JsonValue
* json_value = (
JsonValue
*)pDetectorParameter->
GetValue
();
13
cout <<
"JSON value for DCH1:my_json"
<< endl << json_value->
value
.dump(4) << endl;
14
15
// clean memory after work
16
delete
json_value;
17
delete
pDetectorParameter;
18
19
cout <<
"\nMacro finished successfully"
<< endl;
20
}
UniDetectorParameter
Definition
UniDetectorParameter.h:23
UniDetectorParameter::GetValue
int GetValue(vector< UniValue * > ¶meter_value)
get value of detector parameter presented by an array
Definition
UniDetectorParameter.cxx:1109
UniDetectorParameter::GetDetectorParameter
static UniDetectorParameter * GetDetectorParameter(int value_id)
get detector parameter from the database
Definition
UniDetectorParameter.cxx:165
get_parameter_value_json
void get_parameter_value_json()
Definition
get_parameter_value_json.C:2
JsonValue
Definition
uni_db_structures.h:375
JsonValue::value
json value
Definition
uni_db_structures.h:376
database
uni_db
examples
get_parameter_value_json.C
Generated on
for BmnRoot by
1.17.0