BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
dch_noise_hist.C
Go to the documentation of this file.
1
// macro for getting 'noise channels' parameter value
2
// example runs for all run numbers from 12 to 688 (if run number is not present then error "table record wasn't found"
3
// wiil arise - it's ok)
4
void
dch_noise_hist
()
5
{
6
TCanvas
* c =
new
TCanvas
(
"c"
,
"Noise channels"
, 0, 0, 640, 480);
7
// TGraph2D* gr2 = new TGraph2D();
8
TH3I
* histo =
new
TH3I
(
"h3"
,
"Noise channels"
, 20, 1, 20, 70, 1, 70, 689, 0, 688);
9
histo->
SetMarkerColor
(
kBlue
);
10
histo->
GetXaxis
()->
SetTitle
(
"Slot"
);
11
histo->
GetYaxis
()->
SetTitle
(
"Channel"
);
12
histo->
GetZaxis
()->
SetTitle
(
"Run №"
);
13
14
UniqueRunNumber
* run_numbers;
15
int
run_count =
UniRun::GetRunNumbers
(run_numbers, 1, 12, 3, 688);
16
if
(run_count <= 0)
17
return
;
18
19
for
(
int
i
= 0;
i
< run_count;
i
++) {
20
// get noise parameter values presented by IIStructure: Int+Int (slot:channel)
21
UniDetectorParameter
* pDetectorParameter =
UniDetectorParameter::GetDetectorParameter
(
22
"DCH1"
,
"noise"
, run_numbers[
i
].period_number,
23
run_numbers[
i
].run_number);
//(detector_name, parameter_name, period_number, run_number)
24
if
(pDetectorParameter !=
nullptr
) {
25
vector<UniValue*> pValues;
26
pDetectorParameter->
GetValue
(pValues);
27
28
cout <<
"Element count: "
<< pValues.size() <<
" for run "
<< run_numbers[
i
].
period_number
<<
":"
29
<< run_numbers[
i
].
run_number
<<
" (period:run)"
<< endl;
30
for
(
int
j = 0; j < pValues.size(); j++)
31
histo->
Fill
(((
IIValue
*)pValues[j])->value1, ((
IIValue
*)pValues[j])->value2, run_numbers[
i
].
run_number
);
32
33
// clean memory after work
34
for
(
int
i
= 0;
i
< pValues.size();
i
++)
35
delete
pValues[
i
];
36
delete
pDetectorParameter;
37
}
38
}
39
40
delete
run_numbers;
41
42
histo->
Draw
();
43
}
i
int i
Definition
P4_F32vec4.h:22
kBlue
kBlue
TAttMarker::SetMarkerColor
virtual void SetMarkerColor(Color_t mcolor=1)
TCanvas
TH1::GetZaxis
TAxis * GetZaxis()
TH1::GetXaxis
TAxis * GetXaxis()
TH1::GetYaxis
TAxis * GetYaxis()
TH1::Draw
void Draw(Option_t *option="") override
TH3I
TH3::Fill
virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w)
TNamed::SetTitle
virtual void SetTitle(const char *title="")
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
UniRun::GetRunNumbers
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
Definition
UniRun.cxx:804
dch_noise_hist
void dch_noise_hist()
Definition
dch_noise_hist.C:4
IIValue
Definition
uni_db_structures.h:121
UniqueRunNumber
Definition
uni_db_structures.h:15
UniqueRunNumber::run_number
int run_number
Definition
uni_db_structures.h:27
UniqueRunNumber::period_number
int period_number
Definition
uni_db_structures.h:26
database
examples
uni_db
DCH
dch_noise_hist.C
Generated on
for BmnRoot by
1.17.0