BmnRoot
Loading...
Searching...
No Matches
BmnQaMonitor.cxx
Go to the documentation of this file.
1#include "BmnQaMonitor.h"
2
3const Int_t nRuns = 2; // 6, 7
4
6: fServer(nullptr),
7 gem(nullptr),
8 silicon(nullptr),
9 csc(nullptr),
10 tof400(nullptr),
11 tof700(nullptr),
12 dch(nullptr),
13 mwpc(nullptr),
14 ecal(nullptr),
15 zdc(nullptr),
16 dst(nullptr),
17 triggers(nullptr),
18 runs(nullptr),
19 setups(nullptr),
20 fRefHistosNames(nullptr),
21 fCanvases(nullptr),
22 fSteering(new BmnOfflineQaSteering()),
23 fHistos(nullptr),
24 fCurRunInfo(nullptr),
25 fRefRunInfo(nullptr)
26{
27 nReleases = fSteering->GetNReleases();
28
29 nSetups = 2; // BM@N, SRC
30 runs = new Int_t[nRuns]{6, 7};
31 setups = new TString[nRuns]{"BM@N", "SRC"};
32
33 nCanvases = fSteering->GetNCanvases();
34 nDims = 2; // 1d, 2d
35
36 // Default parameters if release, period, setup are not being initialized in future
37 fRelease = -1;
38 fPeriod = -1;
39 fSetup = -1;
40 if (!dir.IsNull())
41 fHistoDir = dir;
42 else
43 Fatal("BmnQaMonitor::BmnQaMonitor(TString dir)", "Histogram directory is empty or does no exist!!!");
44 isOneRefDrawn = kFALSE;
45
46 // 1. Create lists with information on ...
47 CreateInfoLists();
48
49 // 2. Start web-server ...
50 InitServer();
51
52 // 3. Register canvases to be shown ...
53 RegisterCanvases();
54
55 // 4. Register user's commands to be used for ...
56 RegisterUserCommands();
57}
58
60 delete gem;
61 delete silicon;
62 delete csc;
63
64 delete tof400;
65 delete tof700;
66 delete dch;
67 delete mwpc;
68
69 delete ecal;
70 delete zdc;
71
72 delete dst;
73
74 delete triggers;
75
76 delete fServer;
77}
78
79void BmnQaMonitor::CreateInfoLists() {
80 // Create run and reference lists for all periods and setups ...
81 vector <TString> listOfReleases = fSteering->GetListOfReleases();
82
83 fRefList = new TList();
84 fRefList->SetName("refList");
85
86 BmnRunInfo***** bri = new BmnRunInfo****[nReleases];
87
88 for (Int_t iRelease = 0; iRelease < nReleases; iRelease++) {
89 bri[iRelease] = new BmnRunInfo***[nRuns];
90 TList *listForRel = new TList();
91 listForRel->SetName(listOfReleases[iRelease].Data());
92 fRefList->Add(listForRel);
93
94 for (Int_t iRun = 0; iRun < nRuns; iRun++) {
95 bri[iRelease][iRun] = new BmnRunInfo**[nSetups];
96 TList *listForPeriod = new TList();
97 listForPeriod->SetName(Form("%d", runs[iRun]));
98 listForRel->Add(listForPeriod);
99
100 for (Int_t iSetup = 0; iSetup < nSetups; iSetup++) {
101 TString prefix = TString::Format("RELEASE%s_RUN%d_SETUP_%s_", listOfReleases[iRelease].Data(), runs[iRun], setups[iSetup].Data());
102
103 pair <Int_t, Int_t> borderFiles = fSteering->GetBorderRuns(runs[iRun], setups[iSetup]);
104 const Int_t nFiles = borderFiles.second - borderFiles.first + 1;
105
106 TList *listForSetup = new TList();
107 listForSetup->SetName(Form("%s", setups[iSetup].Data()));
108 listForPeriod->Add(listForSetup);
109
110 bri[iRelease][iRun][iSetup] = new BmnRunInfo*[nFiles];
111
112 for (Int_t iFile = borderFiles.first; iFile < borderFiles.second + 1; iFile++) {
113 TFile* f = new TFile(Form("%s/%s/run%d/%s/qa_%d.root", fHistoDir.Data(), listOfReleases[iRelease].Data(), runs[iRun], setups[iSetup].Data(), iFile), "r");
114 if (!f->IsOpen()) {
115 delete f;
116 continue;
117 }
118
119 UniRun* run = UniRun::GetRun(runs[iRun], iFile);
120 if (run) {
121 bri[iRelease][iRun][iSetup][iFile - borderFiles.first] = new BmnRunInfo(run);
122 listForSetup->Add((TObject*) bri[iRelease][iRun][iSetup][iFile - borderFiles.first]);
123 }
124 delete f;
125 }
126 }
127 }
128 }
129
130 // Create info canvas ...
131 TString name = "infoCanvas";
132 infoCanvas = new TCanvas(name, name, 3 * 320, 1 * 240 * 2 / 3);
133 infoCanvas->Divide(3, 1);
134}
135
136void BmnQaMonitor::DivideCanvases() {
137 for (Int_t iDim = 0; iDim < nDims; iDim++)
138 for (Int_t iCanvas = 0; iCanvas < nCanvases; iCanvas++) {
139 TString name = TString(fCanvases[iDim][iCanvas]->GetName());
140 TString prefix = name.Contains("1d") ? "1d" : "2d";
141 Int_t nRows = fSteering->GetCanvasSizes(runs[fPeriod], setups[fSetup].Data(), name, prefix).first;
142 Int_t nColumns = fSteering->GetCanvasSizes(runs[fPeriod], setups[fSetup].Data(), name, prefix).second;
143
144 if (nRows == -1 && nColumns == -1)
145 continue;
146 else {
147 fCanvases[iDim][iCanvas]->Divide(nColumns, nRows);
148 }
149 }
150}
151
153 AllHistos* currHistos = GetCurrentRun(fCurrentRun);
154 vector <TH1F*> h1Curr = currHistos->Get1D();
155 vector <TH2F*> h2Curr = currHistos->Get2D();
156
157 AllHistos* refHistos = GetReferenceRun(run);
158 vector <TH1F*> h1Ref = refHistos->Get1D();
159 vector <TH2F*> h2Ref = refHistos->Get2D();
160
161 vector <TNamed*> hCurr;
162 vector <TNamed*> hRef;
163
164 if (!isOneRefDrawn)
165 fRefHistosNames = new vector <TString>;
166
167 for (auto it : h1Curr)
168 hCurr.push_back((TNamed*) it);
169 for (auto it : h2Curr)
170 hCurr.push_back((TNamed*) it);
171 for (auto it : h1Ref)
172 hRef.push_back((TNamed*) it);
173 for (auto it : h2Ref)
174 hRef.push_back((TNamed*) it);
175
176 Int_t period = fSteering->GetRunAndSetupByRunId(run).first;
177 TString setup = fSteering->GetRunAndSetupByRunId(run).second;
178 vector <TString> detectors = fSteering->GetDetectors(period, setup);
179 detectors.push_back("TRIGGERS");
180 detectors.push_back("DST");
181
182 for (Int_t iDim = 0; iDim < nDims; iDim++)
183 for (Int_t iCanvas = 0; iCanvas < nCanvases; iCanvas++) {
184 TCanvas * c = fCanvases[iDim][iCanvas];
185 Int_t padCounter = 1;
186 TString nameCanvas = (TString) c->GetName();
187
188 for (auto det : detectors) {
189 if (!nameCanvas.Contains(det.Data()))
190 continue;
191
192 for (auto itCurr : hCurr)
193 for (auto itRef : hRef) {
194 TString currName = (TString) itCurr->GetName();
195 TString refName = (TString) itRef->GetName();
196
197 if (currName != refName)
198 continue;
199
200 TString nameHisto = (TString) itRef->GetName();
201 if (!nameHisto.Contains(det.Data()) || !nameHisto.Contains(nameCanvas.Data()))
202 continue;
203 TVirtualPad* pad = c->cd(padCounter);
204
205 // Remove a reference histo if drawn ...
206 if (isOneRefDrawn) {
207 vector <TString>& vec = *fRefHistosNames;
208 for (auto it : vec) {
209 TObject* obj = pad->GetPrimitive(it.Data());
210 if (!obj)
211 continue;
212
213 pad->GetListOfPrimitives()->Remove(obj);
214 }
215 } else {
216 TString baseName = TString(itRef->GetName());
217 baseName += ", Ref";
218 itRef->SetName(baseName.Data());
219 fRefHistosNames->push_back(itRef->GetName());
220 }
221
222 // 1d histos for triggers are drawn in logarithmic scale !!!
223 // if (nameCanvas.Contains("TRIGGERS_1d"))
224 // pad->SetLogy();
225
226 // We do not draw reference for a 2d-histo !!!
227 if (!currName.Contains("vs.") && !refName.Contains("vs.")) {
228 TH1F* cur = (TH1F*) itCurr;
229
230 if (!refName.Contains(", Ref")) {
231 refName += ", Ref";
232 itRef->SetName(refName.Data());
233 }
234
235 TH1F* ref = (TH1F*) itRef;
236
237 Double_t maxCurr = cur->GetMaximum();
238 Double_t maxRef = ref->GetMaximum();
239
240 if (maxRef > maxCurr) {
241 TH1F* h = (TH1F*) pad->GetPrimitive(cur->GetName());
242 pad->GetListOfPrimitives()->Remove(h);
243
244 ref->Draw();
245 ref->SetLineColor(kRed);
246 cur->GetYaxis()->SetRangeUser(0., maxRef * 1.3);
247
248 if (ref->GetSumOfWeights() > FLT_EPSILON)
249 cur->DrawNormalized("same", ref->Integral());
250 } else {
251 if (ref->GetSumOfWeights() > FLT_EPSILON)
252 ref->DrawNormalized("same", cur->Integral())->SetLineColor(kRed);
253 }
254 }
255
256 pad->Update();
257 pad->Modified();
258
259 padCounter++;
260 }
261 }
262 c->Update();
263 c->Modified();
264 }
265 isOneRefDrawn = kTRUE;
266
267 TList* periodList = (TList*) fRefList->At(fRelease);
268 TList* setupList = (TList*) periodList->At(fPeriod);
269 TList* runList = (TList*) setupList->At(fSetup);
270 TIter it(runList);
271 while (BmnRunInfo * tmp = (BmnRunInfo*) it.Next()) {
272 if (tmp->GetRunNumber() == run) {
273 fRefRunInfo = tmp;
274 break;
275 }
276 }
277 DrawInfoC();
278}
279
281 AllHistos* allHistos = GetCurrentRun(run);
282 vector <TH1F*> h1 = allHistos->Get1D();
283 vector <TH2F*> h2 = allHistos->Get2D();
284
285 if (isOneRefDrawn)
286 delete fRefHistosNames;
287
288 isOneRefDrawn = kFALSE;
289
290 // Put all histograms together
291 vector <TNamed*> h;
292 for (auto it : h1)
293 h.push_back((TNamed*) it);
294 for (auto it : h2)
295 h.push_back((TNamed*) it);
296
297 Int_t period = fSteering->GetRunAndSetupByRunId(run).first;
298 TString setup = fSteering->GetRunAndSetupByRunId(run).second;
299 vector <TString> detectors = fSteering->GetDetectors(period, setup);
300 detectors.push_back("TRIGGERS");
301 detectors.push_back("DST");
302 // Divide canvases according to number of divisions assumed ...
304 DivideCanvases();
305
306 for (Int_t iDim = 0; iDim < nDims; iDim++)
307 for (Int_t iCanvas = 0; iCanvas < nCanvases; iCanvas++) {
308 TCanvas* c = fCanvases[iDim][iCanvas];
309 Int_t padCounter = 1;
310 TString nameCanvas = (TString) c->GetName();
311
312 for (auto det : detectors) {
313 if (!nameCanvas.Contains(det.Data()))
314 continue;
315
316 for (auto it : h) {
317 TString nameHisto = (TString) it->GetName();
318 if (!nameHisto.Contains(det.Data()) || !nameHisto.Contains(nameCanvas.Data()))
319 continue;
320
321 /*TVirtualPad* pad = */c->cd(padCounter);
322 // 1d-histograms for triggers are drawn in logarithmic scale !!!
323 // if (nameCanvas.Contains("TRIGGERS_1d"))
324 // pad->SetLogy();
325 Bool_t isColz = nameHisto.Contains("vs.") ? kTRUE : kFALSE;
326 if (isColz) {
327 TH2F* tmp = (TH2F*) it;
328 tmp->Draw("colz");
329 } else {
330 TH1F* tmp = (TH1F*) it;
331 it->Draw();
332 tmp->GetYaxis()->UnZoom();
333 }
334 padCounter++;
335 }
336 }
337 }
338 fCurrentRun = run;
339
340 TList* periodList = (TList*) fRefList->At(fRelease);
341 TList* setupList = (TList*) periodList->At(fPeriod);
342 TList* runList = (TList*) setupList->At(fSetup);
343 TIter it(runList);
344 while (BmnRunInfo * tmp = (BmnRunInfo*) it.Next()) {
345 if (tmp->GetRunNumber() == run) {
346 fCurRunInfo = tmp;
347 break;
348 }
349 }
350 DrawInfoC();
351}
352
353void BmnQaMonitor::InitServer() {
354 const Char_t* cgiStr = Form("fastcgi:%d", 9000);
355 const Char_t* httpStr = Form("http:%d;noglobal", 8080);
356
357 // Start http-server ...
358 fServer = new THttpServer(httpStr);
359
360 // Start fast-cgi engine to the server ...
361 fServer->CreateEngine(cgiStr);
362 fServer->SetTimer(100, kFALSE);
363}
364
365void BmnQaMonitor::RegisterCanvases() {
366 fCanvases = new TCanvas**[nDims];
367 for (Int_t iDim = 0; iDim < nDims; iDim++) {
368 fCanvases[iDim] = new TCanvas*[nCanvases];
369 for (Int_t iCanvas = 0; iCanvas < nCanvases; iCanvas++) {
370 TString prefix = (iDim == 0) ? "1d" : "2d";
371
372 fCanvases[iDim][iCanvas] =
373 new TCanvas(Form("%s_%s", fSteering->GetListOfCanvases()[iCanvas].Data(), prefix.Data()),
374 Form("%s_%s", fSteering->GetListOfCanvases()[iCanvas].Data(), prefix.Data()), 800, 800);
375 }
376 }
377
378
379 // Create all possible sets with detectors and triggers to be shown for all possible runs, setups ...
380 gem = new BmnCoordinateDetQa**[nRuns];
381 silicon = new BmnCoordinateDetQa**[nRuns];
382 csc = new BmnCoordinateDetQa**[nRuns];
383
384 tof400 = new BmnTimeDetQa**[nRuns];
385 tof700 = new BmnTimeDetQa**[nRuns];
386 mwpc = new BmnTimeDetQa**[nRuns];
387 dch = new BmnTimeDetQa**[nRuns];
388
389 ecal = new BmnCalorimeterDetQa**[nRuns];
390 zdc = new BmnCalorimeterDetQa**[nRuns];
391
392 triggers = new BmnTrigDetQa**[nRuns];
393
394 dst = new BmnDstQa**[nRuns];
395
396 for (Int_t iRun = 0; iRun < nRuns; iRun++) {
397 gem[iRun] = new BmnCoordinateDetQa*[nSetups];
398 silicon[iRun] = new BmnCoordinateDetQa*[nSetups];
399 if (iRun != 0)
400 csc[iRun] = new BmnCoordinateDetQa*[nSetups];
401
402 tof400[iRun] = new BmnTimeDetQa*[nSetups];
403 tof700[iRun] = new BmnTimeDetQa*[nSetups];
404 mwpc[iRun] = new BmnTimeDetQa*[nSetups];
405 dch[iRun] = new BmnTimeDetQa*[nSetups];
406
407 ecal[iRun] = new BmnCalorimeterDetQa*[nSetups];
408 zdc[iRun] = new BmnCalorimeterDetQa*[nSetups];
409
410 triggers[iRun] = new BmnTrigDetQa*[nSetups];
411
412 dst[iRun] = new BmnDstQa*[nSetups];
413
414 for (Int_t iSetup = 0; iSetup < nSetups; iSetup++) {
415 if (iRun == 0 && iSetup == 1) // Configuration does not exist!!!
416 continue;
417 vector <TString> detectors = fSteering->GetDetectors(runs[iRun], setups[iSetup]);
418 vector <TString> triggs = fSteering->GetTriggers(runs[iRun], setups[iSetup]);
419
420 if (detectors.size() == 0 && triggs.size() == 0)
421 continue;
422
423 UInt_t id = fSteering->GetBorderRuns(runs[iRun], setups[iSetup]).first;
424 for (auto det : detectors) {
425 if (det == "GEM")
426 gem[iRun][iSetup] = new BmnCoordinateDetQa(det, id);
427 else if (det == "SILICON")
428 silicon[iRun][iSetup] = new BmnCoordinateDetQa(det, id);
429 else if (det == "CSC" && iRun != 0)
430 csc[iRun][iSetup] = new BmnCoordinateDetQa(det, id);
431 else if (det == "TOF400")
432 tof400[iRun][iSetup] = new BmnTimeDetQa(det, id);
433 else if (det == "TOF700")
434 tof700[iRun][iSetup] = new BmnTimeDetQa(det, id);
435 else if (det == "MWPC")
436 mwpc[iRun][iSetup] = new BmnTimeDetQa(det, id);
437 else if (det == "DCH")
438 dch[iRun][iSetup] = new BmnTimeDetQa(det, id);
439 else if (det == "ECAL")
440 ecal[iRun][iSetup] = new BmnCalorimeterDetQa(det, id);
441 else if (det == "ZDC")
442 zdc[iRun][iSetup] = new BmnCalorimeterDetQa(det, id);
443 }
444
445 triggers[iRun][iSetup] = new BmnTrigDetQa(triggs, id);
446 dst[iRun][iSetup] = new BmnDstQa(id);
447 }
448 }
449
450 for (Int_t iRun = 0; iRun < nRuns; iRun++)
451 for (Int_t iSetup = 0; iSetup < nSetups; iSetup++) {
452
453 if (iRun == 0 && iSetup == 1) // Configuration does not exist!!!
454 continue;
455
456 // Filling vector histogram names ...
457 GetHistoNames <BmnTrigDetQa> (triggers[iRun][iSetup]);
458
459 GetHistoNames <BmnCoordinateDetQa> (gem[iRun][iSetup]);
460 GetHistoNames <BmnCoordinateDetQa> (silicon[iRun][iSetup]);
461 if (iRun != 0)
462 GetHistoNames <BmnCoordinateDetQa> (csc[iRun][iSetup]);
463
464 GetHistoNames <BmnTimeDetQa> (tof400[iRun][iSetup]);
465 GetHistoNames <BmnTimeDetQa> (tof700[iRun][iSetup]);
466 GetHistoNames <BmnTimeDetQa> (dch[iRun][iSetup]);
467 GetHistoNames <BmnTimeDetQa> (mwpc[iRun][iSetup]);
468
469 GetHistoNames <BmnCalorimeterDetQa> (ecal[iRun][iSetup]);
470 GetHistoNames <BmnCalorimeterDetQa> (zdc[iRun][iSetup]);
471
472 GetHistoNames <BmnDstQa> (dst[iRun][iSetup]);
473
474 // Get histograms by names ...
475 GetHistosToBeRegistered <BmnTrigDetQa> (triggers[iRun][iSetup]);
476
477 GetHistosToBeRegistered <BmnCoordinateDetQa> (gem[iRun][iSetup]);
478 GetHistosToBeRegistered <BmnCoordinateDetQa> (silicon[iRun][iSetup]);
479 if (iRun != 0)
480 GetHistosToBeRegistered <BmnCoordinateDetQa> (csc[iRun][iSetup]);
481
482 GetHistosToBeRegistered <BmnTimeDetQa> (tof400[iRun][iSetup]);
483 GetHistosToBeRegistered <BmnTimeDetQa> (tof700[iRun][iSetup]);
484 GetHistosToBeRegistered <BmnTimeDetQa> (dch[iRun][iSetup]);
485 GetHistosToBeRegistered <BmnTimeDetQa> (mwpc[iRun][iSetup]);
486
487 GetHistosToBeRegistered <BmnCalorimeterDetQa> (ecal[iRun][iSetup]);
488 GetHistosToBeRegistered <BmnCalorimeterDetQa> (zdc[iRun][iSetup]);
489
490 GetHistosToBeRegistered <BmnDstQa> (dst[iRun][iSetup]);
491 }
492
493 for (Int_t iDim = 0; iDim < nDims; iDim++) {
494 for (Int_t iCanvas = 0; iCanvas < nCanvases; iCanvas++)
495 fServer->Register("/Objects", fCanvases[iDim][iCanvas]);
496 }
497
498 fServer->Register("/Objects", fRefList);
499 fServer->Register("/Objects", infoCanvas);
500}
501
502void BmnQaMonitor::RegisterUserCommands() {
503 TString cmdTitle0 = "SelectRelease";
504 TString cmdTitle1 = "SelectPeriod";
505 TString cmdTitle2 = "SelectSetup";
506 TString cmdTitle3 = "SelectRun";
507 TString cmdTitle4 = "SelectReference";
508 TString cmdTitle5 = "Clear";
509 //
510 // Displaying current histograms ...
511 fServer->Register("/", this);
512 fName += "_";
513
514 // Release
515 TString cmd0 = "/" + fName + "/->SetRelease(%arg1%)";
516 fServer->RegisterCommand(cmdTitle0.Data(), cmd0.Data(), "button;");
517
518 // Period
519 TString cmd1 = "/" + fName + "/->SetPeriod(%arg1%)";
520 fServer->RegisterCommand(cmdTitle1.Data(), cmd1.Data(), "button;");
521
522 // Setup
523 TString cmd2 = "/" + fName + "/->SetSetup(%arg1%)";
524 fServer->RegisterCommand(cmdTitle2.Data(), cmd2.Data(), "button;");
525
526 // Run
527 TString cmd3 = "/" + fName + "/->ShowCurrentHistos(%arg1%)";
528 fServer->RegisterCommand(cmdTitle3.Data(), cmd3.Data(), "button;");
529
530 // Reference
531 TString cmd4 = "/" + fName + "/->ShowReferenceHistos(%arg1%)";
532 fServer->RegisterCommand(cmdTitle4.Data(), cmd4.Data(), "button;");
533
534 // Clear canvas
535 TString cmd5 = "/" + fName + "/->ClearCanvases()";
536 fServer->RegisterCommand(cmdTitle5.Data(), cmd5.Data(), "button;");
537}
538
540 for (Int_t iDim = 0; iDim < nDims; iDim++)
541 for (Int_t iCanvas = 0; iCanvas < nCanvases; iCanvas++)
542 fCanvases[iDim][iCanvas]->Clear("C");
543}
544
545AllHistos * BmnQaMonitor::GetRun(UInt_t run) {
546 Int_t period = fSteering->GetRunAndSetupByRunId(run).first;
547 TString setup = fSteering->GetRunAndSetupByRunId(run).second;
548
549 if (fHistos)
550 delete fHistos;
551
552 fHistos = new AllHistos();
553 if (run == 0) {
555 return fHistos;
556 }
557
558 if (fHistoNames.size() == 0) {
559 cout << "BmnQaMonitor::GetHistosFromFile(), No histos to be displayed" << endl;
560 return fHistos;
561 }
562
563 TString path = fHistoDir + "/" + fSteering->GetListOfReleases()[fRelease] + "/" +
564 TString::Format("run%d", runs[fPeriod]) + "/" + setups[fSetup] +
565 TString::Format("/qa_%d.root", run);
566
567 TFile* file = new TFile(path.Data(), "read");
568 if (!file->IsOpen()) {
569 cout << "File does not exist! Exiting ... " << endl;
570 return fHistos;
571 }
572
573 for (auto it : fHistoNames) {
574 if (!it.Contains(TString::Format("RUN%d_SETUP_%s", period, setup.Data()).Data()))
575 continue;
576
577 TNamed* h = nullptr;
578 h = (TNamed*) file->Get(TString("TRIGGERS/" + it).Data()); // FIXME!! Not elegant representation
579
580 if (!h)
581 h = (TNamed*) file->Get(TString("GEM/" + it).Data());
582 if (!h)
583 h = (TNamed*) file->Get(TString("SILICON/" + it).Data());
584 if (!h)
585 h = (TNamed*) file->Get(TString("CSC/" + it).Data());
586 if (!h)
587 h = (TNamed*) file->Get(TString("TOF400/" + it).Data());
588 if (!h)
589 h = (TNamed*) file->Get(TString("TOF700/" + it).Data());
590 if (!h)
591 h = (TNamed*) file->Get(TString("DCH/" + it).Data());
592 if (!h)
593 h = (TNamed*) file->Get(TString("MWPC/" + it).Data());
594 if (!h)
595 h = (TNamed*) file->Get(TString("ECAL/" + it).Data());
596 if (!h)
597 h = (TNamed*) file->Get(TString("ZDC/" + it).Data());
598 if (!h)
599 h = (TNamed*) file->Get(TString("DST/" + it).Data());
600
601 if (h) {
602 TString hName = TString::Format("%s", h->GetName());
603
604 if (hName.Contains(".vs")) // .vs in histogram name must be present if 2d-histogram assumed
605 fHistos->Set2D((TH2F*) h);
606 else
607 fHistos->Set1D((TH1F*) h);
608 }
609 }
610 cout << "Run #" << run << " processed " << endl;
611 return fHistos;
612}
613
614void BmnQaMonitor::DrawInfoC() {
615 TLatex Tl;
616 TVirtualPad *pad = infoCanvas->cd(1);
617 pad->Clear();
618 Tl.SetTextAlign(12);
619 Tl.SetTextSize(0.10);
620 Tl.SetTextColor(kBlue);
621 if (fCurRunInfo) {
622 Tl.DrawLatex(0.1, 0.9, Form("Current Run: %i", fCurRunInfo->GetRunNumber()));
623 Tl.DrawLatex(0.1, 0.75, Form("Energy: %1.2f", fCurRunInfo->GetEnergy()));
624 Tl.DrawLatex(0.1, 0.6, Form("Beam: %s", fCurRunInfo->GetBeamParticle().Data()));
625 Tl.DrawLatex(0.1, 0.45, Form("Target: %s", fCurRunInfo->GetTargetParticle().Data()));
626 Tl.Draw();
627 }
628 pad->Modified();
629 pad->Update();
630
631 pad = infoCanvas->cd(2);
632 pad->Clear();
633 Tl.SetTextAlign(12);
634 Tl.SetTextSize(0.10);
635 Tl.SetTextColor(kRed);
636 if (fRefRunInfo) {
637 Tl.DrawLatex(0.1, 0.9, Form("Ref. Run: %i", fRefRunInfo->GetRunNumber()));
638 Tl.DrawLatex(0.1, 0.75, Form("Energy: %1.2f", fRefRunInfo->GetEnergy()));
639 Tl.DrawLatex(0.1, 0.6, Form("Beam: %s", fRefRunInfo->GetBeamParticle().Data()));
640 Tl.DrawLatex(0.1, 0.45, Form("Target: %s", fRefRunInfo->GetTargetParticle().Data()));
641 Tl.Draw();
642 }
643 pad->Update();
644 pad->Modified();
645
646 pad = infoCanvas->cd(3);
647 pad->Clear();
648 Tl.SetTextAlign(12);
649 Tl.SetTextSize(0.10);
650 Tl.SetTextColor(kBlack);
651 Tl.DrawLatex(0.1, 0.9, Form("Release: %s", fSteering->GetListOfReleases()[fRelease].Data()));
652 Tl.DrawLatex(0.1, 0.75, Form("Period: %d", runs[fPeriod]));
653 Tl.DrawLatex(0.1, 0.6, Form("Setup: %s", setups[fSetup].Data()));
654
655 pad->Update();
656 pad->Modified();
657
658}
659
const Int_t nRuns
float f
Definition P4_F32vec4.h:21
vector< TH1F * > Get1D()
void Set1D(TH1F *h)
void Set2D(TH2F *h)
vector< TH2F * > Get2D()
pair< Int_t, Int_t > GetCanvasSizes(Int_t run, TString setup, TString name, TString dim)
vector< TString > GetListOfReleases()
vector< TString > GetDetectors(Int_t period, TString setup="BM@N")
pair< Int_t, TString > GetRunAndSetupByRunId(Int_t id)
vector< TString > GetTriggers(Int_t period, TString setup="BM@N")
pair< Int_t, Int_t > GetBorderRuns(Int_t period, TString setup="BM@N")
vector< TString > GetListOfCanvases()
void ShowReferenceHistos(Int_t)
void ShowCurrentHistos(Int_t)
virtual ~BmnQaMonitor()
TString GetBeamParticle()
get beam particle of the current run
Definition BmnRunInfo.h:18
Double_t GetEnergy()
get energy of the current run
Definition BmnRunInfo.h:22
TString GetTargetParticle()
get target particle of the current run
Definition BmnRunInfo.h:20
Int_t GetRunNumber()
get run number of the current run
Definition BmnRunInfo.h:14
static UniRun * GetRun(int period_number, int run_number)
get run from the database
Definition UniRun.cxx:177
-clang-format
Definition setup.py:1
name
Definition setup.py:7