BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
get_parameter_value_complex.C
Go to the documentation of this file.
1
// macro for getting parameter value (if parameter exist - you could check existing parameters by
2
// 'UniParameter::PrintAll()' function)
3
void
get_parameter_value_complex
()
4
{
5
bool
return_error =
false
;
6
7
// get noise parameter values presented by IIStructure: Int+Int (slot:channel)
8
UniDetectorParameter
* pDetectorParameter =
UniDetectorParameter::GetDetectorParameter
(
"DCH1"
,
"noise"
, 1, 133);
9
if
(pDetectorParameter !=
nullptr
) {
10
vector<UniValue*> pValues;
11
pDetectorParameter->
GetValue
(pValues);
12
13
// YOUR CODE (e.g print values)
14
for
(
int
i
= 0;
i
< pValues.size();
i
++)
15
cout <<
"Slot:Channel "
<< ((
IIValue
*)pValues[
i
])->value1 <<
":"
<< ((
IIValue
*)pValues[
i
])->value2 << endl;
16
17
// clean memory after work
18
for
(
int
i
= 0;
i
< pValues.size();
i
++)
19
delete
pValues[
i
];
20
if
(pDetectorParameter)
21
delete
pDetectorParameter;
22
}
else
23
return_error =
true
;
24
25
if
(return_error)
26
cout <<
"\nMacro finished with errors"
<< endl;
27
else
28
cout <<
"\nMacro finished successfully"
<< endl;
29
}
30
31
// macro for getting alignment value for the given period and run number
32
void
get_parameter_alignment
(
int
period_number = 7,
int
run_number = 4668)
33
{
34
bool
return_error =
false
;
35
36
// get noise parameter values presented by IIStructure: Int+Int (slot:channel)
37
UniDetectorParameter
* pDetectorParameter =
38
UniDetectorParameter::GetDetectorParameter
(
"gem"
,
"alignment_shift"
, period_number, run_number);
39
if
(pDetectorParameter !=
nullptr
) {
40
vector<UniValue*> pValues;
41
pDetectorParameter->
GetValue
(pValues);
42
43
for
(
int
i
= 0;
i
< pValues.size();
i
++) {
44
AlignmentValue
* pValue = (
AlignmentValue
*)pValues[
i
];
45
cout <<
"Station:Module = "
<< (unsigned)pValue->
station
<<
":"
<< (
unsigned
)pValue->
module
<< endl;
46
cout <<
"shiftX = "
<< pValue->
value
[0] <<
", shiftY = "
<< pValue->
value
[1]
47
<<
", shiftZ = "
<< pValue->
value
[2] << endl
48
<< endl;
49
}
50
51
// clean memory after work
52
for
(
int
i
= 0;
i
< pValues.size();
i
++)
53
delete
pValues[
i
];
54
if
(pDetectorParameter)
55
delete
pDetectorParameter;
56
}
else
57
return_error =
true
;
58
59
if
(return_error)
60
cout <<
"Macro finished with errors"
<< endl;
61
else
62
cout <<
"Macro finished successfully"
<< endl;
63
}
i
int i
Definition
P4_F32vec4.h:22
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_alignment
void get_parameter_alignment(int period_number=7, int run_number=4668)
Definition
get_parameter_value_complex.C:32
get_parameter_value_complex
void get_parameter_value_complex()
Definition
get_parameter_value_complex.C:3
AlignmentValue
Definition
uni_db_structures.h:334
AlignmentValue::station
uint8_t station
Definition
uni_db_structures.h:335
AlignmentValue::value
double value[3]
Definition
uni_db_structures.h:337
AlignmentValue::module
uint8_t module
Definition
uni_db_structures.h:336
IIValue
Definition
uni_db_structures.h:121
install
database
uni_db
examples
get_parameter_value_complex.C
Generated on
for BmnRoot by
1.17.0