BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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)
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)
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}
int i
Definition P4_F32vec4.h:22
kBlue
virtual void SetMarkerColor(Color_t mcolor=1)
TAxis * GetZaxis()
TAxis * GetXaxis()
TAxis * GetYaxis()
void Draw(Option_t *option="") override
virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w)
virtual void SetTitle(const char *title="")
int GetValue(vector< UniValue * > &parameter_value)
get value of detector parameter presented by an array
static UniDetectorParameter * GetDetectorParameter(int value_id)
get detector parameter from the database
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
void dch_noise_hist()