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