KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVDataQualityAuditReporting_INDRAFAZIA.cpp
1#include "KVDataQualityAuditReporting_INDRAFAZIA.h"
2#include "KVINDRA.h"
3#include "KVFAZIA.h"
4
5#include <KVFAZIADetector.h>
6#include <KVGeoDNTrajectory.h>
7#include <TColor.h>
8#include <TLatex.h>
9#include <TLegend.h>
10#include <TMarker.h>
11#include "TLegend.h"
12
14
15
16
18
20{
21 // Make an A4-size canvas
22 Double_t w = 297 * 6;
23 Double_t h = 210 * 6;
24 if (style == canvas_t::kPortrait) std::swap(w, h);
25 myCanvas = ::new TCanvas("c", "c", w, h);
26 myCanvas->SetWindowSize(w + (w - myCanvas->GetWw()), h + (h - myCanvas->GetWh()));
27}
28
29
30
33
35{
36 // sort fazia telescopes into bins of theta
37
38 TIter itdet(gFazia->GetDetectors());
39 KVDetector* det;
40
41 while ((det = (KVDetector*)itdet())) {
42 if (det->IsLabelled("SI1")) {
43 int bin = TMath::Nint(det->GetTheta() * (1 / theta_bin));
44 fazia_map[bin].push_back(det);
45 }
46 }
47 // Now sort detectors in vectors in order of increasing theta
48 for (auto& p : fazia_map) {
49 std::sort(std::begin(p.second), std::end(p.second), [](KVDetector * a, KVDetector * b) {
50 return a->GetTheta() < b->GetTheta();
51 });
52 }
53}
54
55
56
58
60{
61 if (!gMultiDetArray) {
62 auto dsm = new KVDataSetManager;
63 dsm->Init();
65 }
66
67 make_fazia_map(0.4);
68
70
71 TString pdf_file = Form("%s_DataQualityAudit_%s.pdf", dataset_name.Data(), fAudit->GetName());
72 auto first_page = pdf_file + "(";
73 auto last_page = pdf_file + ")";
74 current_page = first_page;
75 // INDRA Z identification bilan
76 int nx(2), ny(3);
77 myCanvas->Divide(nx, ny);
78 int pad = 1;
79 std::vector<TString> indra_id_types = {"SI_CSI", indra_csi_idtype};
80 for (auto id : indra_id_types) {
81 for (int ring = 6; ring <= 17; ++ring) {
82 if (id == "SI_CSI" && ring > 9) break;
83
84 myCanvas->cd(pad)->SetFillStyle(4000);//transparent pad
85 INDRA_ring_reporting_Z(ring, id);
86 ++pad;
87 if (pad > nx * ny) {
89 myCanvas->Print(current_page, Form("Title:INDRA Z %s ID Quality by Ring", id.Data()));
90 if (current_page == first_page) current_page = pdf_file;
91 myCanvas->Clear();
92 myCanvas->Divide(nx, ny);
93 pad = 1;
94 }
95 }
96 if (pad != 1) {
98 myCanvas->Print(current_page, Form("Title:INDRA Z %s ID Quality by Ring", id.Data()));
99 if (current_page == first_page) current_page = pdf_file;
100 myCanvas->Clear();
101 myCanvas->Divide(nx, ny);
102 pad = 1;
103 }
104 nx = 4;
105 ny = 3;
106 myCanvas->Clear();
107 myCanvas->Divide(nx, ny);
108 pad = 1;
109 for (int ring = 6; ring <= 17; ++ring) {
110 if (id == "SI_CSI") {
111 if (ring < 8) continue; // no isotopes for 6/7
112 if (ring > 9) break; // no si-csi after ring 9
113 }
114
115 INDRA_ring_mean_A_vs_Z(ring, id, pad, nx, ny);
116 }
117 if (pad != 1) {
118 myCanvas->Print(current_page, Form("Title:INDRA <A> vs Z %s by Ring", id.Data()));
119 myCanvas->Clear();
120 myCanvas->Divide(nx, ny);
121 pad = 1;
122 }
123 for (int ring = 6; ring <= 9; ++ring) { // no calibrations for ring>9
124 INDRA_ring_Z_threshold_vs_Z(ring, id, pad, nx, ny);
125 }
126 if (pad != 1) {
127 myCanvas->Print(current_page, Form("Title:INDRA Z thresh. vs Z %s by Ring", id.Data()));
128 myCanvas->Clear();
129 myCanvas->Divide(nx, ny);
130 pad = 1;
131 }
132 }
133
134 // FAZIA Z identification bilan
135 std::vector<TString> fazia_id_types = {"SI1", "SI1_SI2", fazia_si_csi_idtype, "CSI"};
136 nx = 4;
137 ny = 3;
138 for (auto id : fazia_id_types) {
139 myCanvas->Clear();
140 myCanvas->Divide(nx, ny);
141 pad = 1;
142 int group_num = 1;
143 for (auto& p : fazia_map) {
144 myCanvas->cd(pad);
145
146 FAZIA_group_reporting_Z(group_num, p.second, id);
147 ++group_num;
148 ++pad;
149 if (pad > nx * ny) {
151 myCanvas->Print(pdf_file, Form("Title:FAZIA Z %s ID Quality by Group", id.Data()));
152 myCanvas->Clear();
153 myCanvas->Divide(nx, ny);
154 pad = 1;
155 }
156 }
157 if (pad != 1) {
159 myCanvas->Print(pdf_file, Form("Title:FAZIA Z %s ID Quality by Group", id.Data()));
160 }
161
162 myCanvas->Clear();
163 myCanvas->Divide(nx, ny);
164 pad = 1;
165 group_num = 1;
166 for (auto& p : fazia_map) {
167 myCanvas->cd(pad);
168
169 FAZIA_group_mean_A_vs_Z(group_num, p.second, id);
170 ++group_num;
171 ++pad;
172 if (pad > nx * ny) {
173 myCanvas->Print(pdf_file, Form("Title:FAZIA <A> vs Z %s by Group", id.Data()));
174 myCanvas->Clear();
175 myCanvas->Divide(nx, ny);
176 pad = 1;
177 }
178 }
179 if (pad != 1) myCanvas->Print(pdf_file, Form("Title:FAZIA <A> vs Z %s by Group", id.Data()));
180
181 myCanvas->Clear();
182 myCanvas->Divide(nx, ny);
183 pad = 1;
184 group_num = 1;
185 for (auto& p : fazia_map) {
186 myCanvas->cd(pad);
187
188 FAZIA_group_Z_threshold_vs_Z(group_num, p.second, id);
189 ++group_num;
190 ++pad;
191 if (pad > nx * ny) {
192 myCanvas->Print(pdf_file, Form("Title:FAZIA Z thresh. vs Z %s by Group", id.Data()));
193 myCanvas->Clear();
194 myCanvas->Divide(nx, ny);
195 pad = 1;
196 }
197 }
198 if (pad != 1) myCanvas->Print(pdf_file, Form("Title:FAZIA Z thresh. vs Z %s by Group", id.Data()));
199
200 myCanvas->Clear();
201 myCanvas->Divide(nx, ny);
202 pad = 1;
203 group_num = 1;
204 for (auto& p : fazia_map) {
205 myCanvas->cd(pad);
206
207 FAZIA_group_A_threshold_vs_Z(group_num, p.second, id);
208 ++group_num;
209 ++pad;
210 if (pad > nx * ny) {
211 myCanvas->Print(pdf_file, Form("Title:FAZIA A thresh. vs Z %s by Group", id.Data()));
212 myCanvas->Clear();
213 myCanvas->Divide(nx, ny);
214 pad = 1;
215 }
216 }
217 if (pad != 1) myCanvas->Print(pdf_file, Form("Title:FAZIA A thresh. vs Z %s by Group", id.Data()));
218 }
219 myCanvas->Clear();
220 myCanvas->Print(last_page, "Title:Last page");
221}
222
223
224
226
228{
229 if (!gIndra) {
230 Error("INDRA_ring_reporting", "You need to build INDRA first...");
231 return;
232 }
233 TList tels;
234 for (int mod = 1; mod <= 24; ++mod) {
235 TString name = Form("%s_%02d%02d", idtype.Data(), ring, mod);
236 auto tel = gIndra->GetIDTelescope(name);
237 if (tel) tels.Add(tel);
238 }
239
240 auto get_module_number = [](const KVIDTelescope * idt) {
241 return (int)dynamic_cast<KVINDRADetector*>(idt->GetDetector(1))->GetModuleNumber();
242 };
243 auto zmean = fReport.get_mean_Z_for_telescopes(&tels, get_module_number);
244 auto zmax = fReport.get_max_Z_for_telescopes(&tels, get_module_number, 24);
245 auto zmax_iso = fReport.get_max_Z_with_isotopes_for_telescopes(&tels, get_module_number, 30);
246 zmax_iso->SetMarkerColor(kOrange - 2);
247 auto zmin = fReport.get_min_Z_for_telescopes(&tels, get_module_number, 25);
248 TMultiGraph* mg = ::new TMultiGraph;
249 mg->SetTitle(Form("Ring %d %s Min/Mean/Max Z vs. Module", ring, idtype.Data()));
250 mg->Add(zmin);
251 mg->Add(zmean);
252 mg->Add(zmax);
253 mg->Add(zmax_iso);
254 mg->Draw("ap");
255}
256
257
259
260void KVDataQualityAuditReporting_INDRAFAZIA::INDRA_ring_mean_A_vs_Z(int ring, const TString& idtype, int& pad, int nx, int ny)
261{
262 TList tels;
263 for (int mod = 1; mod <= 24; ++mod) {
264 TString name = Form("%s_%02d%02d", idtype.Data(), ring, mod);
265 auto tel = gIndra->GetIDTelescope(name);
266 if (!tel) break;
267 tels.Add(tel);
268 }
269 int nmods = tels.GetEntries();
270 // 24 => 4 sets of 6, 16 => 2 sets of 8, 8 => 1 set of 8
271 int mod_set = (nmods > 16 ? 6 : 8);
272 int color_step = TColor::GetPalette().GetSize() / (mod_set + 1);
273 KVIDTelescope* idt;
274 nmods = 0;
275 while (tels.GetEntries()) {
276 TMultiGraph* mg = ::new TMultiGraph;
277 int i = 1;
278 while (i <= mod_set) {
279 idt = (KVIDTelescope*)tels.Remove(tels.First()); // "pop" the first one in the list
280 if (fAudit->HasTelescope(idt->GetName())) {
281 auto gr = fReport[idt->GetName()].get_mean_isotopic_mass_by_Z();
282 gr->SetMarkerColor(TColor::GetPalette()[color_step * i]);
283 gr->SetMarkerStyle(markers[i - 1]);
284 gr->SetLineWidth(0);
285 mg->Add(gr);
286 }
287 ++i;
288 ++nmods;
289 }
290 myCanvas->cd(pad);
291 ++pad;
292 // change title of graph => title of pad
293 mg->SetTitle(Form("INDRA <A> vs. Z %s Ring %d [%d-%d]", idtype.Data(), ring, nmods - mod_set + 1, nmods));
294 mg->Draw("ap");
295 TLegend* leg;
296 if (i > 12) {
297 leg = gPad->BuildLegend(.11, .89, .61, .69);
298 leg->SetNColumns(3);
299 }
300 else if (i > 6) {
301 leg = gPad->BuildLegend(.11, .89, .61, .69);
302 leg->SetNColumns(2);
303 }
304 else {
305 leg = gPad->BuildLegend(.11, .89, .61, .69);
306 }
307 leg->SetBorderSize(0);
308 leg->SetFillColorAlpha(kWhite, 1.00);
309 if (pad > nx * ny) {
310 myCanvas->Print(current_page, Form("Title:INDRA <A> vs Z %s by Ring", idtype.Data()));
311 myCanvas->Clear();
312 myCanvas->Divide(nx, ny);
313 pad = 1;
314 }
315 }
316}
317
318
319
321
322void KVDataQualityAuditReporting_INDRAFAZIA::INDRA_ring_Z_threshold_vs_Z(int ring, const TString& idtype, int& pad, int nx, int ny)
323{
324 TList tels;
325 for (int mod = 1; mod <= 24; ++mod) {
326 TString name = Form("%s_%02d%02d", idtype.Data(), ring, mod);
327 auto tel = gIndra->GetIDTelescope(name);
328 if (!tel) break;
329 tels.Add(tel);
330 }
331 int nmods = tels.GetEntries();
332 // 24 => 4 sets of 6, 16 => 2 sets of 8, 8 => 1 set of 8
333 int mod_set = (nmods > 16 ? 6 : 8);
334 int color_step = TColor::GetPalette().GetSize() / (mod_set + 1);
335 KVIDTelescope* idt;
336 nmods = 0;
337 while (tels.GetEntries()) {
338 TMultiGraph* mg = ::new TMultiGraph;
339 int i = 1;
340 while (i <= mod_set) {
341 idt = (KVIDTelescope*)tels.Remove(tels.First()); // "pop" the first one in the list
342 if (fAudit->HasTelescope(idt->GetName())) {
343 auto gr = fReport[idt->GetName()].get_element_thresholds_by_Z_mev_per_nuc(TColor::GetPalette()[color_step * i]);
344 gr->SetMarkerStyle(markers[i - 1]);
345 gr->SetLineWidth(0);
346 mg->Add(gr);
347 if (gr->GetMean(2) < 0) {
348 // threshold = -1 => uncalibrated particles
349 std::cout << idt->GetName() << " : particles are UNCALIBRATED";
350 // check detector calibrations
351 KVGeoDNTrajectory* traj;
352 if (idt->GetSize() > 1) traj = (KVGeoDNTrajectory*)idt->GetDetector(2)->GetNode()->GetForwardTrajectories()->First();
354 int nuncal = 0;
355 traj->IterateFrom();
357 while ((dn = traj->GetNextNode())) nuncal += (!dn->GetDetector()->IsCalibrated());
358 if (nuncal == traj->GetN()) std::cout << " ... just like ALL DETECTORS";
359 else {
360 std::cout << " ... just like ";
361 traj->IterateFrom();
363 while ((dn = traj->GetNextNode())) {
364 if (!dn->GetDetector()->IsCalibrated()) {
365 std::cout << dn->GetName() << " ";
366 }
367 }
368 }
369 std::cout << std::endl;
370 }
371 }
372 ++i;
373 ++nmods;
374 }
375 myCanvas->cd(pad);
376 ++pad;
377 // change title of graph => title of pad
378 mg->SetTitle(Form("INDRA Z thresh. [MeV/u] vs. Z %s Ring %d [%d-%d]", idtype.Data(), ring, nmods - mod_set + 1, nmods));
379 mg->Draw("ap");
380 double x1, x2;
381// if(idtype == "CSI")
382// {
383// return;// no legend - doesn't fit
384// //x1 = .39; x2 = .89;
385// }
386// else
387// {
388 x1 = .11;
389 x2 = .61;
390// }
391 TLegend* leg;
392 if (mod_set > 12) {
393 leg = gPad->BuildLegend(x1, .89, x2, .69);
394 leg->SetNColumns(3);
395 }
396 else if (mod_set > 6) {
397 leg = gPad->BuildLegend(x1, .89, x2, .69);
398 leg->SetNColumns(2);
399 }
400 else {
401 leg = gPad->BuildLegend(x1, .89, x2, .69);
402 }
403 leg->SetBorderSize(0);
404 leg->SetFillColorAlpha(kWhite, 1.00);
405 if (pad > nx * ny) {
406 myCanvas->Print(current_page, Form("Title:INDRA Z thresh. vs Z %s by Ring", idtype.Data()));
407 myCanvas->Clear();
408 myCanvas->Divide(nx, ny);
409 pad = 1;
410 }
411 }
412}
413
414
415
417
418void KVDataQualityAuditReporting_INDRAFAZIA::fill_telescopes_of_group(TList& tels, std::vector<KVDetector*>& dets, const TString& idtype, double& theta_min, double& theta_max)
419{
420 for (auto d : dets) {
421 int index = dynamic_cast<KVFAZIADetector*>(d)->GetIndex();
422 TString name = Form("ID_%s_%d", idtype.Data(), index);
423 auto tel = gFazia->GetIDTelescope(name);
424 if (tel) {
425 if (fAudit->HasTelescope(tel->GetName())) tels.Add(tel);
426 else {
427 if (tel->IsReadyForID()) std::cout << tel->GetName() << " is absent from audit - BUT IS READY TO IDENTIFY!" << std::endl;
428 }
429 }
430 theta_min = std::min(theta_min, d->GetTheta());
431 theta_max = std::max(theta_min, d->GetTheta());
432 }
433}
434
435
436
438
439void KVDataQualityAuditReporting_INDRAFAZIA::FAZIA_group_reporting_Z(int group_num, std::vector<KVDetector*>& dets, const TString& idtype)
440{
441 TList tels;
442 double theta_min{360}, theta_max{0};
443 Info("FAZIA_group_reporting_Z", "Group %d", group_num);
444 fill_telescopes_of_group(tels, dets, idtype, theta_min, theta_max);
445
446 int index = 0;
447 auto get_index = [&](const KVIDTelescope*) {
448 return index++;
449 };
450 auto zmean = fReport.get_mean_Z_for_telescopes(&tels, get_index);
451 index = 0;
452 auto zmax = fReport.get_max_Z_for_telescopes(&tels, get_index, 24);
453 index = 0;
454 auto zmax_iso = fReport.get_max_Z_with_isotopes_for_telescopes(&tels, get_index, 30);
455 zmax_iso->SetMarkerColor(kOrange - 2);
456 index = 0;
457 auto zmin = fReport.get_min_Z_for_telescopes(&tels, get_index, 25);
458 TMultiGraph* mg = ::new TMultiGraph;
459 mg->SetTitle(Form("Group %d [%.2f#leq#theta#leq%.2f] %s Min/Mean/Max Z", group_num, theta_min, theta_max, idtype.Data()));
460 mg->Add(zmin);
461 mg->Add(zmean);
462 mg->Add(zmax);
463 mg->Add(zmax_iso);
465 mg->Draw("ap");
466}
467
468
469
471
472void KVDataQualityAuditReporting_INDRAFAZIA::FAZIA_group_mean_A_vs_Z(int group_num, std::vector<KVDetector*>& dets, const TString& idtype)
473{
474 TList tels;
475 double theta_min{360}, theta_max{0};
476 fill_telescopes_of_group(tels, dets, idtype, theta_min, theta_max);
477
478 int color_step = TColor::GetPalette().GetSize() / (dets.size() + 1);
479 int i = 1;
480 TIter next(&tels);
481 KVIDTelescope* idt;
482 TMultiGraph* mg = ::new TMultiGraph;
483 while ((idt = (KVIDTelescope*)next())) {
484 auto gr = fReport[idt->GetName()].get_mean_isotopic_mass_by_Z();
485 gr->SetMarkerColor(TColor::GetPalette()[color_step * i]);
486 gr->SetMarkerStyle(markers[i - 1]);
487 gr->SetLineWidth(0);
488 mg->Add(gr);
489 ++i;
490 }
491 // change title of graph => title of pad
492 mg->SetTitle(Form("FAZIA <A> vs. Z %s Group %d [%.2f#leq#theta#leq%.2f]", idtype.Data(), group_num, theta_min, theta_max));
493 mg->Draw("ap");
494 TLegend* leg;
495 if (i > 12) {
496 leg = gPad->BuildLegend(.11, .89, .61, .69);
497 leg->SetNColumns(3);
498 }
499 else if (i > 6) {
500 leg = gPad->BuildLegend(.11, .89, .61, .69);
501 leg->SetNColumns(2);
502 }
503 else {
504 leg = gPad->BuildLegend(.11, .89, .61, .69);
505 }
506 leg->SetBorderSize(0);
507 leg->SetFillColorAlpha(kWhite, 1.00);
508}
509
510
511
513
514void KVDataQualityAuditReporting_INDRAFAZIA::FAZIA_group_Z_threshold_vs_Z(int group_num, std::vector<KVDetector*>& dets, const TString& idtype)
515{
516 TList tels;
517 double theta_min{360}, theta_max{0};
518 fill_telescopes_of_group(tels, dets, idtype, theta_min, theta_max);
519
520 int color_step = TColor::GetPalette().GetSize() / (dets.size() + 1);
521 int i = 1;
522 TIter next(&tels);
523 KVIDTelescope* idt;
524 TMultiGraph* mg = ::new TMultiGraph;
525 while ((idt = (KVIDTelescope*)next())) {
526 auto gr = fReport[idt->GetName()].get_element_thresholds_by_Z_mev_per_nuc(TColor::GetPalette()[color_step * i]);
527 gr->SetMarkerStyle(markers[i - 1]);
528 gr->SetLineWidth(0);
529 mg->Add(gr);
530 if (gr->GetMean(2) < 0) {
531 // threshold = -1 => uncalibrated particles
532 std::cout << idt->GetName() << " : particles are UNCALIBRATED";
533 // check detector calibrations
534 KVGeoDNTrajectory* traj = nullptr;
535 if (idt->GetSize() > 1) traj = (KVGeoDNTrajectory*)idt->GetDetector(2)->GetNode()->GetForwardTrajectories()->First();
536 else {
539 else {
540 if (idt->GetDetector(1)->IsCalibrated()) std::cout << " ... but " << idt->GetDetector(1)->GetName() << " is calibrated...";
541 else std::cout << " ... just like " << idt->GetDetector(1)->GetName();
542 }
543 }
544 if (traj) {
545 int nuncal = 0;
546 traj->IterateFrom();
548 while ((dn = traj->GetNextNode())) nuncal += (!dn->GetDetector()->IsCalibrated());
549 if (nuncal == traj->GetN()) std::cout << " ... just like ALL DETECTORS";
550 else {
551 std::cout << " ... just like ";
552 traj->IterateFrom();
554 while ((dn = traj->GetNextNode())) {
555 if (!dn->GetDetector()->IsCalibrated()) {
556 std::cout << dn->GetName() << " ";
557 }
558 }
559 }
560 }
561 std::cout << std::endl;
562 }
563 ++i;
564 }
565 // change title of graph => title of pad
566 mg->SetTitle(Form("FAZIA Z thresh. [MeV/u] vs. Z %s Group %d [%.2f#leq#theta#leq%.2f]", idtype.Data(), group_num, theta_min, theta_max));
567 mg->Draw("ap");
568 double x1, x2;
569 if (idtype == "CSI") {
570 return;// no legend - doesn't fit
571 //x1 = .39; x2 = .89;
572 }
573 else {
574 x1 = .11;
575 x2 = .61;
576 }
577 TLegend* leg;
578 if (i > 12) {
579 leg = gPad->BuildLegend(x1, .89, x2, .69);
580 leg->SetNColumns(3);
581 }
582 else if (i > 6) {
583 leg = gPad->BuildLegend(x1, .89, x2, .69);
584 leg->SetNColumns(2);
585 }
586 else {
587 leg = gPad->BuildLegend(x1, .89, x2, .69);
588 }
589 leg->SetBorderSize(0);
590 leg->SetFillColorAlpha(kWhite, 1.00);
591}
592
593
594
596
597void KVDataQualityAuditReporting_INDRAFAZIA::FAZIA_group_A_threshold_vs_Z(int group_num, std::vector<KVDetector*>& dets, const TString& idtype)
598{
599 TList tels;
600 double theta_min{360}, theta_max{0};
601 fill_telescopes_of_group(tels, dets, idtype, theta_min, theta_max);
602
603 int color_step = TColor::GetPalette().GetSize() / (dets.size() + 1);
604 int i = 1;
605 TIter next(&tels);
606 KVIDTelescope* idt;
607 TMultiGraph* mg = ::new TMultiGraph;
608 while ((idt = (KVIDTelescope*)next())) {
609 auto gr = fReport[idt->GetName()].get_isotope_thresholds_by_Z_mev_per_nuc(TColor::GetPalette()[color_step * i]);
610 gr->SetMarkerStyle(markers[i - 1]);
611 gr->SetLineWidth(0);
612 mg->Add(gr);
613 ++i;
614 }
615 // change title of graph => title of pad
616 mg->SetTitle(Form("FAZIA A thresh. [MeV/u] vs. Z %s Group %d [%.2f#leq#theta#leq%.2f]", idtype.Data(), group_num, theta_min, theta_max));
617 mg->Draw("ap");
618 double x1, x2;
619 if (idtype == "CSI") {
620 return;// no legend - doesn't fit
621 //x1 = .39; x2 = .89;
622 }
623 else {
624 x1 = .11;
625 x2 = .61;
626 }
627 TLegend* leg;
628 if (i > 12) {
629 leg = gPad->BuildLegend(x1, .89, x2, .69);
630 leg->SetNColumns(3);
631 }
632 else if (i > 6) {
633 leg = gPad->BuildLegend(x1, .89, x2, .69);
634 leg->SetNColumns(2);
635 }
636 else {
637 leg = gPad->BuildLegend(x1, .89, x2, .69);
638 }
639 leg->SetBorderSize(0);
640 leg->SetFillColorAlpha(kWhite, 1.00);
641}
642
643
644
646
648{
649 auto N = dynamic_cast<TGraph*>(graf->GetListOfGraphs()->First())->GetN();
650 for (int i = 0; i < N; ++i) {
651 auto bin = graf->GetXaxis()->FindBin(i);
652 graf->GetXaxis()->SetBinLabel(bin, tels->At(i)->GetName());
653 }
654 graf->GetXaxis()->LabelsOption("u");// automatic rotation of labels to fit
655}
656
657
658
662
664{
665//=========Macro generated from canvas: c1/c1
666//========= (Tue Jul 27 11:21:28 2021) by ROOT version 6.24/02
667
668 myCanvas->cd();
669 // make sure all pads are transparent
671 TObject* obj;
672 while ((obj = it())) {
673 if (obj->InheritsFrom("TPad")) {
674 dynamic_cast<TPad*>(obj)->SetFillStyle(4000);
675 }
676 }
677 TLatex* tex = ::new TLatex(0.02336825, 0.86604, "Max. Z");
678 tex->SetTextSize(0.028);
679 tex->SetTextAngle(90);
680 tex->SetLineWidth(2);
681 tex->Draw();
682 TMarker* marker = ::new TMarker(0.01611604, 0.8519389, 4);
683
684 Int_t ci; // for color index setting
685 TColor* color; // for color definition with alpha
686 ci = TColor::GetColor("#333399");
687 marker->SetMarkerColor(ci);
688 marker->SetMarkerStyle(4);
689 marker->SetMarkerSize(1.7);
690 marker->Draw();
691 marker = ::new TMarker(0.01772764, 0.4453584, 30);
692
693 ci = TColor::GetColor("#ffcc33");
694 marker->SetMarkerColor(ci);
695 marker->SetMarkerStyle(30);
696 marker->SetMarkerSize(1.7);
697 marker->Draw();
698 tex = ::new TLatex(0.02497985, 0.4629847, "Max. Z with identified A");
699 tex->SetTextSize(0.028);
700 tex->SetTextAngle(90);
701 tex->SetLineWidth(2);
702 tex->Draw();
703 tex = ::new TLatex(0.02659146, 0.2632197, "Mean Z");
704 tex->SetTextSize(0.028);
705 tex->SetTextAngle(90);
706 tex->SetLineWidth(2);
707 tex->Draw();
708 tex = ::new TLatex(0.02820306, 0.1045828, "Min. Z");
709 tex->SetTextSize(0.028);
710 tex->SetTextAngle(90);
711 tex->SetLineWidth(2);
712 tex->Draw();
713 marker = ::new TMarker(0.01853344, 0.2479436, 20);
714
715 ci = TColor::GetColor("#333399");
716 marker->SetMarkerColor(ci);
717 marker->SetMarkerStyle(20);
718 marker->SetMarkerSize(1.7);
719 marker->Draw();
720 marker = ::new TMarker(0.02095085, 0.08578143, 25);
721
722 ci = TColor::GetColor("#333399");
723 marker->SetMarkerColor(ci);
724 marker->SetMarkerStyle(25);
725 marker->SetMarkerSize(1.7);
726 marker->Draw();
727}
728
729
730
734
736{
737//=========Macro generated from canvas: c1/c1
738//========= (Tue Jul 27 12:21:27 2021) by ROOT version 6.24/02
739 myCanvas->cd();
740 // make sure all pads are transparent
742 TObject* obj;
743 while ((obj = it())) {
744 if (obj->InheritsFrom("TPad")) {
745 dynamic_cast<TPad*>(obj)->SetFillStyle(4000);
746 }
747 }
748 TLatex* tex = new TLatex(0.9813084, 0.9470954, "Max. Z");
749 tex->SetTextSize(0.028);
750 tex->SetTextAngle(270);
751 tex->SetLineWidth(2);
752 tex->Draw();
753 TMarker* marker = new TMarker(0.9853972, 0.9688797, 4);
754
755 Int_t ci; // for color index setting
756 TColor* color; // for color definition with alpha
757 ci = TColor::GetColor("#333399");
758 marker->SetMarkerColor(ci);
759 marker->SetMarkerStyle(4);
760 marker->SetMarkerSize(1.7);
761 marker->Draw();
762 marker = new TMarker(0.984229, 0.8309129, 30);
763
764 ci = TColor::GetColor("#ffcc33");
765 marker->SetMarkerColor(ci);
766 marker->SetMarkerStyle(30);
767 marker->SetMarkerSize(1.7);
768 marker->Draw();
769 tex = new TLatex(0.9807243, 0.8143154, "Max. Z with identified A");
770 tex->SetTextSize(0.028);
771 tex->SetTextAngle(270);
772 tex->SetLineWidth(2);
773 tex->Draw();
774 tex = new TLatex(0.9813084, 0.4419087, "Mean Z");
775 tex->SetTextSize(0.028);
776 tex->SetTextAngle(270);
777 tex->SetLineWidth(2);
778 tex->Draw();
779 tex = new TLatex(0.978972, 0.2479253, "Min. Z");
780 tex->SetTextSize(0.028);
781 tex->SetTextAngle(270);
782 tex->SetLineWidth(2);
783 tex->Draw();
784 marker = new TMarker(0.9853972, 0.4564315, 20);
785
786 ci = TColor::GetColor("#333399");
787 marker->SetMarkerColor(ci);
788 marker->SetMarkerStyle(20);
789 marker->SetMarkerSize(1.7);
790 marker->Draw();
791 marker = new TMarker(0.9830607, 0.2645228, 25);
792
793 ci = TColor::GetColor("#333399");
794 marker->SetMarkerColor(ci);
795 marker->SetMarkerStyle(25);
796 marker->SetMarkerSize(1.7);
797 marker->Draw();
798
799}
800
801
int Int_t
#define d(i)
double Double_t
kOrange
kWhite
#define N
winID w
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t SetFillStyle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t style
char name[80]
char * Form(const char *fmt,...)
#define gPad
Bool_t IsLabelled(const Char_t *l) const
Definition KVBase.h:207
TGraph * get_mean_Z_for_telescopes(TSeqCollection *idtels, TelescopeIndexFunction F, Marker_t marker_style=20) const
TGraph * get_max_Z_for_telescopes(TSeqCollection *idtels, TelescopeIndexFunction F, Marker_t marker_style=20) const
TGraph * get_min_Z_for_telescopes(TSeqCollection *idtels, TelescopeIndexFunction F, Marker_t marker_style=20) const
TGraph * get_max_Z_with_isotopes_for_telescopes(TSeqCollection *idtels, TelescopeIndexFunction F, Marker_t marker_style=20) const
Prepare PDF report on data quality audits for INDRA-FAZIA experiments.
void relabel_FAZIA_telescope_axis(TMultiGraph *graf, const TList *tels) const
void FAZIA_group_Z_threshold_vs_Z(int group_num, std::vector< KVDetector * > &dets, const TString &idtype)
void FAZIA_group_A_threshold_vs_Z(int group_num, std::vector< KVDetector * > &dets, const TString &idtype)
std::map< double, std::vector< KVDetector * > > fazia_map
void fill_telescopes_of_group(TList &tels, std::vector< KVDetector * > &dets, const TString &idtype, double &theta_min, double &theta_max)
void FAZIA_group_mean_A_vs_Z(int group_num, std::vector< KVDetector * > &, const TString &idtype)
void FAZIA_group_reporting_Z(int group_num, std::vector< KVDetector * > &, const TString &idtype)
void make_fazia_map(double theta_bin)
sort fazia telescopes into bins of theta
void INDRA_ring_Z_threshold_vs_Z(int ring, const TString &idtype, int &pad, int nx, int ny)
void INDRA_ring_mean_A_vs_Z(int ring, const TString &idtype, int &pad, int nx, int ny)
void make_canvas(canvas_t style=canvas_t::kLandscape)
Make an A4-size canvas.
Bool_t HasTelescope(const TString &tel_name) const
Manage all datasets contained in a given data repository.
virtual Bool_t Init(KVDataRepository *=0)
Base class for detector geometry description.
Definition KVDetector.h:160
KVGeoDetectorNode * GetNode()
Definition KVDetector.h:326
Double_t GetTheta() const
Definition KVDetector.h:744
Bool_t IsCalibrated() const
Definition KVDetector.h:390
Base class for FAZIA detectors.
Path taken by particles through multidetector geometry.
void IterateFrom(const KVGeoDetectorNode *node0=nullptr) const
KVGeoDetectorNode * GetNextNode() const
Information on relative positions of detectors & particle trajectories.
const Char_t * GetName() const
Name of node is same as name of associated detector.
KVSeqCollection * GetForwardTrajectories() const
KVDetector * GetDetector() const
const KVSeqCollection * GetDetectors() const
Base class for all detectors or associations of detectors in array which can identify charged particl...
KVDetector * GetDetector(UInt_t n) const
UInt_t GetSize() const
Base class for detectors of INDRA array.
static KVMultiDetArray * MakeMultiDetector(const Char_t *dataset_name, Int_t run=-1, TString classname="KVMultiDetArray")
KVIDTelescope * GetIDTelescope(const Char_t *name) const
Return pointer to DeltaE-E ID Telescope with "name".
virtual TObject * First() const
Int_t GetSize() const
virtual void SetFillStyle(Style_t fstyle)
virtual void SetLineWidth(Width_t lwidth)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual void SetMarkerSize(Size_t msize=1)
virtual void SetTextAngle(Float_t tangle=0)
virtual void SetTextSize(Float_t tsize=1)
virtual Int_t FindBin(const char *label)
virtual void LabelsOption(Option_t *option="h")
virtual void SetBinLabel(Int_t bin, const char *label)
void Clear(Option_t *option="") override
TVirtualPad * cd(Int_t subpadnumber=0) override
virtual Int_t GetEntries() const
static const TArrayI & GetPalette()
static Int_t GetColor(const char *hexcolor)
virtual Double_t GetMean(Int_t axis=1) const
void Add(TObject *obj) override
TObject * Remove(const TObjLinkPtr_t &lnk)
TObject * First() const override
TObject * At(Int_t idx) const override
void Draw(Option_t *option="") override
TList * GetListOfGraphs() const
TAxis * GetXaxis()
const char * GetName() const override
virtual const char * GetName() const
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Draw(Option_t *option="")
virtual void Info(const char *method, const char *msgfmt,...) const
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
TList * GetListOfPrimitives() const override
void Print(const char *filename, Option_t *option) override
const char * Data() const
TGraphErrors * gr
leg
TH1 * h
Int_t Nint(T x)
TArc a
ClassImp(TPyArg)