KaliVeda
Toolkit for HIC analysis
KVDataQualityAuditReporting_INDRAFAZIA.h
1 #ifndef E789_DATA_QUALITY_AUDIT_REPORTING_H
2 #define E789_DATA_QUALITY_AUDIT_REPORTING_H
3 
4 #include "KVBase.h"
5 #include <KVDataQualityAuditReportMaker.h>
6 #include <TCanvas.h>
7 
39 
41  enum class canvas_t {
42  kLandscape,
43  kPortrait
44  };
45 
47 
49 
50  std::map<double, std::vector<KVDetector*>> fazia_map;
51  void make_fazia_map(double theta_bin);
52 
53  std::vector<int> markers {20, 24, 21, 25, 34, 28, 47, 46, 45, 44, 29, 30, 43, 42, 22, 26, 23, 32};
54 
55  std::pair<int, int> get_layout(size_t ntels)
56  {
57  assert(ntels <= 16);
58  if (ntels <= 8) return {4, 2};
59  else if (ntels <= 12) return {4, 3};
60  return {4, 4};
61  }
62  void fill_telescopes_of_group(TList& tels, std::vector<KVDetector*>& dets, const TString& idtype, double& theta_min, double& theta_max);
63  void draw_sidebar_legend();
65 
67 public:
68  KVDataQualityAuditReporting_INDRAFAZIA(const TString& audit_name, const TString& ds_name)
69  : fReport{audit_name}, fAudit{fReport.GetAudit()}, dataset_name{ds_name}
70  {
73  if (dataset_name == "E789") {
74  indra_csi_idtype = "CSI_R_L";
75  fazia_si_csi_idtype = "SI2_CSI";
76  }
77  dataset_name.Prepend("INDRAFAZIA.");
78  }
79 
80  void do_report();
81  void INDRA_ring_reporting_Z(int ring, const TString& idtype);
82  void INDRA_ring_mean_A_vs_Z(int ring, const TString& idtype, int& pad, int nx, int ny);
83  void INDRA_ring_Z_threshold_vs_Z(int ring, const TString& idtype, int& pad, int nx, int ny);
84  void FAZIA_group_reporting_Z(int group_num, std::vector<KVDetector*>&, const TString& idtype);
85  void FAZIA_group_mean_A_vs_Z(int group_num, std::vector<KVDetector*>&, const TString& idtype);
86  void FAZIA_group_Z_threshold_vs_Z(int group_num, std::vector<KVDetector*>& dets, const TString& idtype);
87  void FAZIA_group_A_threshold_vs_Z(int group_num, std::vector<KVDetector*>& dets, const TString& idtype);
88  template<typename TelescopeFunction>
89  void FAZIA_group_reporting_detail(const TString& pdf_file, const TString& title, int group_num, std::vector<KVDetector*>& dets, const TString& idtype, TelescopeFunction TF, Bool_t logY = kFALSE)
90  {
93 
94  myCanvas->Clear();
95  auto lay = get_layout(dets.size());
96  myCanvas->Divide(lay.first, lay.second);
97  int max_pad = lay.first * lay.second;
98 
99  TList tels;
100  double theta_min{360}, theta_max{0};
101  fill_telescopes_of_group(tels, dets, idtype, theta_min, theta_max);
102 
103  TIter next(&tels);
104  KVIDTelescope* tel;
105  int pad = 1;
106  while ((tel = (KVIDTelescope*)next())) {
107  myCanvas->cd(pad);
108  gPad->SetLogy(logY);
109  TF(fReport[tel->GetName()]);
110  ++pad;
111  if (pad > max_pad) {
112  myCanvas->Print(pdf_file, Form("Title:FAZIA %s Group %d : %s", idtype.Data(), group_num, title.Data()));
113  myCanvas->Clear();
114  myCanvas->Divide(lay.first, lay.second);
115  pad = 1;
116  }
117  }
118  if (pad != 1) myCanvas->Print(pdf_file, Form("Title:FAZIA %s Group %d : %s", idtype.Data(), group_num, title.Data()));
119  }
120 
121  void relabel_FAZIA_telescope_axis(TMultiGraph* graf, const TList* tels) const;
122 
124 };
125 
126 #endif // E789_DATA_QUALITY_AUDIT_REPORTING_H
bool Bool_t
#define ClassDef(name, id)
char * Form(const char *fmt,...)
#define gPad
Base class for KaliVeda framework.
Definition: KVBase.h:142
Produce graphs and histograms from KVDataQualityAudit.
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_reporting_detail(const TString &pdf_file, const TString &title, int group_num, std::vector< KVDetector * > &dets, const TString &idtype, TelescopeFunction TF, Bool_t logY=kFALSE)
KVDataQualityAuditReporting_INDRAFAZIA(const TString &audit_name, const TString &ds_name)
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.
Audit of experimental data identification and calibrations.
Base class for all detectors or associations of detectors in array which can identify charged particl...
Definition: KVIDTelescope.h:84
void Clear(Option_t *option="") override
TVirtualPad * cd(Int_t subpadnumber=0) override
const char * GetName() const override
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
void Print(const char *filename, Option_t *option) override
const char * Data() const
TString & Prepend(char c, Ssiz_t rep=1)