CbmRoot
CbmAnaJpsiReport.cxx
Go to the documentation of this file.
1 
2 #include "CbmAnaJpsiReport.h"
3 #include "CbmAnaJpsiCuts.h"
4 #include "CbmAnaJpsiHist.h"
5 #include "CbmDrawHist.h"
6 #include "CbmHistManager.h"
7 #include "CbmReportElement.h"
8 #include "CbmUtils.h"
9 #include "TCanvas.h"
10 #include "TDirectory.h"
11 #include "TF1.h"
12 #include "TH1.h"
13 #include "TLatex.h"
14 #include "TLine.h"
15 #include "TMarker.h"
16 #include "TPad.h"
17 #include "TStyle.h"
19 #include <boost/assign/list_of.hpp>
20 #include <iostream>
21 #include <map>
22 
23 using boost::assign::list_of;
25 using Cbm::Split;
26 using std::cout;
27 using std::endl;
28 using std::map;
29 using std::string;
30 using std::vector;
31 
33  SetReportName("jpsi_qa");
34 }
35 
37 
39  //Out().precision(3);
40  Out() << R()->DocumentBegin();
41  Out() << R()->Title(0, GetTitle());
42 
43  PrintCanvases();
44 
45  Out() << R()->DocumentEnd();
46 }
47 
50 
51  int nofEvents = H1("fh_event_number")->GetEntries();
52  cout << "Number of events = " << nofEvents << endl;
53  HM()->ScaleByPattern(".*", 1. / nofEvents);
54 
55  //Rebin minv histograms
56  Int_t nRebins = 20;
57  //Double_t nRebinScale = 1/((Double_t) nRebins);
58  HM()->RebinByPattern("fh_signal_minv.+",
59  nRebins); //Rebin scales with 1/(binWith)
60  HM()->RebinByPattern("fh_bg_minv.+", nRebins);
61  HM()->RebinByPattern("fh_pi0_minv.+", nRebins);
62  HM()->RebinByPattern("fh_gamma_minv.+", nRebins);
63  HM()->RebinByPattern("fh_bg_truematch_minv.+", nRebins);
64  HM()->RebinByPattern("fh_bg_truematch_el_minv.+", nRebins);
65  HM()->RebinByPattern("fh_bg_truematch_notel_minv.+", nRebins);
66  HM()->RebinByPattern("fh_bg_mismatch_minv.+", nRebins);
67  HM()->RebinByPattern("fh_bg_participants_minv.+", nRebins);
68 
69  HM()->ScaleByPattern("fh_signal_minv.+", nRebins);
70  HM()->ScaleByPattern("fh_bg_minv.+", nRebins);
71  HM()->ScaleByPattern("fh_pi0_minv.+", nRebins);
72  HM()->ScaleByPattern("fh_gamma_minv.+", nRebins);
73  HM()->ScaleByPattern("fh_bg_truematch_minv.+", nRebins);
74  HM()->ScaleByPattern("fh_bg_truematch_el_minv.+", nRebins);
75  HM()->ScaleByPattern("fh_bg_truematch_notel_minv.+", nRebins);
76  HM()->ScaleByPattern("fh_bg_mismatch_minv.+", nRebins);
77  HM()->ScaleByPattern("fh_bg_participants_minv.+", nRebins);
78 
79  Draw2DCut("fh_rich_pmt_xy");
81 
83 
85  DrawAnalysisStepsH1("fh_bg_minv", false, 5e-5, 2);
86  DrawAnalysisStepsH1("fh_pi0_minv", false);
87  DrawAnalysisStepsH1("fh_gamma_minv", false);
88 
89  DrawAnalysisStepsH2("fh_signal_minv_pt", false);
90  DrawAnalysisStepsH1("fh_signal_mom", false);
91  DrawAnalysisStepsH2("fh_signal_pty", true);
92 
93  {
94  TCanvas* c = CreateCanvas(
95  "jpsi_fh_vertex_el_gamma", "jpsi_fh_vertex_el_gamma", 1000, 1000);
96  c->Divide(2, 2);
97  c->cd(1);
98  DrawH2(H2("fh_vertex_el_gamma_xz"));
99  c->cd(2);
100  DrawH2(H2("fh_vertex_el_gamma_yz"));
101  c->cd(3);
102  DrawH2(H2("fh_vertex_el_gamma_xy"));
103  c->cd(4);
104  DrawH2(H2("fh_vertex_el_gamma_rz"));
105  }
106 
107  { // Number of BG and signal tracks after each cut
108  TCanvas* c =
109  CreateCanvas("jpsi_fh_nof_tracks", "jpsi_fh_nof_tracks", 1000, 500);
110  c->Divide(2, 1);
111  c->cd(1);
112  gPad->SetLogy();
113  DrawH1(H1("fh_nof_bg_tracks"));
114  //H1("fh_nof_bg_tracks")->SetMinimum(0.0);
115  SetAnalysisStepLabels(H1("fh_nof_bg_tracks"));
116  c->cd(2);
117  DrawH1(H1("fh_nof_el_tracks"));
118  H1("fh_nof_el_tracks")->SetMinimum(0.0);
119  SetAnalysisStepLabels(H1("fh_nof_el_tracks"));
120  }
121 
122  { //number of mismatches
123  TCanvas* c = CreateCanvas(
124  "jpsi_fh_nof_mismatches", "jpsi_fh_nof_mismatches", 1000, 1000);
125  c->Divide(2, 2);
126  c->cd(1);
127  DrawH1(H1("fh_nof_mismatches"));
128  DrawTextOnPad("All mismatches", 0.15, 0.9, 0.85, 0.99);
129  SetAnalysisStepLabels(H1("fh_nof_mismatches"));
130  c->cd(2);
131  DrawH1(H1("fh_nof_mismatches_rich"));
132  DrawTextOnPad("Mismatches in RICH", 0.15, 0.9, 0.85, 0.99);
133  SetAnalysisStepLabels(H1("fh_nof_mismatches_rich"));
134  c->cd(3);
135  DrawH1(H1("fh_nof_mismatches_trd"));
136  DrawTextOnPad("mismatches in TRD", 0.15, 0.9, 0.85, 0.99);
137  SetAnalysisStepLabels(H1("fh_nof_mismatches_trd"));
138  c->cd(4);
139  DrawH1(H1("fh_nof_mismatches_tof"));
140  DrawTextOnPad("mismatches in TOF", 0.15, 0.9, 0.85, 0.99);
141  SetAnalysisStepLabels(H1("fh_nof_mismatches_tof"));
142  }
143 
144  DrawBgSource2D("fh_source_tracks",
145  list_of("#gamma")("#pi^{0}")("#pi^{#pm}")("p")("K")(
146  "e^{#pm}_{sec}")("oth."),
147  "Tracks per event");
148 
153  DrawMomMcVsRec();
154  DrawPairSource();
155 
156  {
157  TCanvas* c = CreateCanvas("jpsi_fh_PdgCode_of Others_BG",
158  "jpsi_fh_PdgCode_of Others_BG",
159  1000,
160  1000);
161  c->Divide(2, 2);
162  for (int i = 0; i < CbmAnaJpsiHist::fNofAnaSteps - 2; i++) {
163  c->cd(i + 1);
164  DrawH1(H1("fh_PdgCode_of Others_BG_" + CbmAnaJpsiHist::fAnaSteps[i + 2]));
166  CbmAnaJpsiHist::fAnaStepsLatex[i + 2], 0.6, 0.92, 0.7, 0.99);
167  }
168  }
169 }
170 
171 void CbmAnaJpsiReport::DrawAnalysisStepsH2(const string& hName,
172  bool DoDrawEfficiency) {
173  TCanvas* c = CreateCanvas(
174  ("jpsi_" + hName).c_str(), ("jpsi_" + hName).c_str(), 1200, 800);
175  c->Divide(3, 2);
176  for (int i = 0; i < CbmAnaJpsiHist::fNofAnaSteps; i++) {
177  c->cd(i + 1);
178  string h = hName + "_" + CbmAnaJpsiHist::fAnaSteps[i];
179 
180  DrawH2(H2(h));
181  DrawTextOnPad(CbmAnaJpsiHist::fAnaStepsLatex[i], 0.6, 0.89, 0.7, 0.99);
182 
183  if (DoDrawEfficiency)
185  }
186 }
187 
188 void CbmAnaJpsiReport::DrawAnalysisStepsH1(const string& hName,
189  bool doScale,
190  double min,
191  double max) {
192  CreateCanvas(("jpsi_" + hName).c_str(), ("jpsi_" + hName).c_str(), 600, 600);
193  vector<TH1*> h;
194  vector<string> hLegend;
195  for (int i = 0; i < CbmAnaJpsiHist::fNofAnaSteps; i++) {
196  string fullName = hName + "_" + CbmAnaJpsiHist::fAnaSteps[i];
197  h.push_back(H1(fullName));
198  h[i]->SetLineWidth(2);
199  h[i]->SetLineColor(CbmAnaJpsiHist::fAnaStepsColor[i]);
200  if (doScale) h[i]->Scale(1. / h[i]->Integral());
201  hLegend.push_back(CbmAnaJpsiHist::fAnaStepsLatex[i]);
202  if (min != max) {
203  h[i]->SetMinimum(min);
204  h[i]->SetMaximum(max);
205  }
206  }
207  DrawH1(h, hLegend, kLinear, kLog, true, 0.90, 0.7, 0.99, 0.99);
208 }
209 
210 void CbmAnaJpsiReport::DrawSourceTypesH1(const string& hName, bool doScale) {
211  vector<TH1*> h;
212  vector<string> hLegend;
213  for (int i = 0; i < CbmAnaJpsiHist::fNofSourceTypes; i++) {
214  string fullName = hName + "_" + CbmAnaJpsiHist::fSourceTypes[i];
215  h.push_back(H1(fullName));
216  h[i]->SetLineWidth(2);
217  h[i]->SetLineColor(CbmAnaJpsiHist::fSourceTypesColor[i]);
218  if (doScale) {
219  Double_t integral = h[i]->Integral();
220  if (integral != 0.0) { h[i]->Scale(1. / h[i]->Integral()); }
221  }
222  hLegend.push_back(CbmAnaJpsiHist::fSourceTypesLatex[i]);
223  }
224  DrawH1(h, hLegend, kLinear, kLog, true, 0.90, 0.7, 0.99, 0.99);
225 }
226 
227 void CbmAnaJpsiReport::DrawCutH1(const string& hName,
228  double cutValue,
229  bool doScale) {
230  CreateCanvas(("jpsi_" + hName).c_str(), ("jpsi_" + hName).c_str(), 600, 600);
231  DrawSourceTypesH1(hName, doScale);
232  if (cutValue != -999999.) {
233  TLine* cutLine = new TLine(cutValue, 0.0, cutValue, 1.);
234  cutLine->SetLineWidth(2);
235  cutLine->Draw();
236  }
237 }
238 
239 void CbmAnaJpsiReport::Draw2DCut(const string& hist) {
240  TCanvas* c =
241  CreateCanvas(("jpsi_" + hist).c_str(), ("jpsi_" + hist).c_str(), 900, 900);
242  c->Divide(2, 2);
243  for (int i = 0; i < CbmAnaJpsiHist::fNofSourceTypes; i++) {
244  c->cd(i + 1);
245  DrawH2(H2(hist + "_" + CbmAnaJpsiHist::fSourceTypes[i]));
246  DrawTextOnPad(CbmAnaJpsiHist::fSourceTypesLatex[i], 0.6, 0.89, 0.7, 0.99);
247  }
248 }
249 
251  CbmAnaJpsiCuts cuts;
252  cuts.SetDefaultCuts();
253  DrawCutH1("fh_track_chi2prim", cuts.fChiPrimCut, false);
254  DrawCutH1("fh_track_mom", -999999., false);
255  DrawCutH1("fh_track_chi2sts", -999999., false);
256  DrawCutH1("fh_track_rapidity", -999999., false);
257  DrawCutH1("fh_track_pt", cuts.fPtCut, false);
258  DrawCutH1("fh_track_rich_ann",
259  CbmLitGlobalElectronId::GetInstance().GetRichAnnCut(),
260  false);
261  DrawCutH1("fh_track_trd_ann",
262  CbmLitGlobalElectronId::GetInstance().GetTrdAnnCut(),
263  false);
264  Draw2DCut("fh_track_tof_m2");
265 }
266 
268  double min = 1e-9;
269  double max = 3e-8;
270  const string hName = "fh_signal_minv";
271 
272  CreateCanvas(("jpsi_" + hName).c_str(), ("jpsi_" + hName).c_str(), 600, 600);
273  vector<TH1*> h;
274  vector<string> hLegend;
275  for (int i = 0; i < CbmAnaJpsiHist::fNofAnaSteps - 2; i++) {
276  string fullName = hName + "_" + CbmAnaJpsiHist::fAnaSteps[i + 2];
277  h.push_back((TH1*) H1(fullName)->Clone());
278  cout << i << " Integral " << h[i]->Integral() << endl;
279  cout << i << " Entries " << h[i]->GetEntries() << endl;
280  h[i]->SetAxisRange(2., 4., "X");
281  h[i]->SetLineWidth(2);
282  h[i]->SetLineColor(CbmAnaJpsiHist::fAnaStepsColor[i + 2]);
283  hLegend.push_back(CbmAnaJpsiHist::fAnaStepsLatex[i + 2]);
284  if (min != max) {
285  h[i]->SetMinimum(min);
286  h[i]->SetMaximum(max);
287  }
288  }
289  DrawH1(h, hLegend, kLinear, kLog, true, 0.90, 0.7, 0.99, 0.99);
290 }
291 
293  double trueMatch =
294  H1("fh_bg_truematch_minv_" + CbmAnaJpsiHist::fAnaSteps[step])->GetEntries();
295  double trueMatchEl =
296  H1("fh_bg_truematch_el_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
297  ->GetEntries();
298  double trueMatchNotEl =
299  H1("fh_bg_truematch_notel_minv_" + CbmAnaJpsiHist::fAnaSteps[step])
300  ->GetEntries();
301  double misMatch =
302  H1("fh_bg_mismatch_minv_" + CbmAnaJpsiHist::fAnaSteps[step])->GetEntries();
303  double nofBg =
304  H1("fh_bg_minv_" + CbmAnaJpsiHist::fAnaSteps[step])->GetEntries();
305 
306  DrawH1(list_of(H1("fh_bg_truematch_minv_" + CbmAnaJpsiHist::fAnaSteps[step]))(
307  H1("fh_bg_truematch_el_minv_" + CbmAnaJpsiHist::fAnaSteps[step]))(
308  H1("fh_bg_truematch_notel_minv_" + CbmAnaJpsiHist::fAnaSteps[step]))(
309  H1("fh_bg_mismatch_minv_" + CbmAnaJpsiHist::fAnaSteps[step])),
310  list_of("true match ("
311  + Cbm::NumberToString(100. * trueMatch / nofBg, 1) + "%)")(
312  "true match (e^{#pm}) ("
313  + Cbm::NumberToString(100. * trueMatchEl / nofBg, 1) + "%)")(
314  "true match (not e^{#pm}) ("
315  + Cbm::NumberToString(100. * trueMatchNotEl / nofBg, 1) + "%)")(
316  "mismatch (" + Cbm::NumberToString(100. * misMatch / nofBg) + "%)"),
317  kLinear,
318  kLog,
319  true,
320  0.63,
321  0.8,
322  0.99,
323  0.99);
324 
325  DrawTextOnPad(CbmAnaJpsiHist::fAnaStepsLatex[step], 0.15, 0.9, 0.35, 0.99);
326 }
327 
329  Int_t hi = 1;
330  TCanvas* c = CreateCanvas(
331  "jpsi_fh_minv_mismatches", "jpsi_fh_minv_mismatches", 1000, 1000);
332  c->Divide(2, 2);
333  for (int step = kJpsiReco; step < CbmAnaJpsiHist::fNofAnaSteps; step++) {
334  c->cd(hi++);
335  DrawMinvMismatches(step);
336  }
337 
338  CreateCanvas(
339  "jpsi_fh_minv_mismatches_ptcut", "jpsi_fh_minv_mismatches_ptcut", 600, 600);
341 }
342 
343 
344 void CbmAnaJpsiReport::DrawEfficiency(const string& histName,
345  const string& McHistName) {
346  Double_t nofMCEntries = H2(McHistName)->GetEntries();
347  if (nofMCEntries != 0) {
348  DrawTextOnPad(Cbm::NumberToString((Double_t) H2(histName)->GetEntries()
349  / nofMCEntries * 100.)
350  + "%",
351  0.2,
352  0.9,
353  0.35,
354  0.99);
355  }
356 }
357 
359  TH2D* Efficiency =
360  Cbm::DivideH2(H2("fh_signal_pty_" + CbmAnaJpsiHist::fAnaSteps[step]),
361  H2("fh_signal_pty_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc]));
362  DrawH2(Efficiency);
363  DrawTextOnPad(CbmAnaJpsiHist::fAnaStepsLatex[step], 0.6, 0.89, 0.7, 0.99);
364  DrawEfficiency("fh_signal_pty_" + CbmAnaJpsiHist::fAnaSteps[step],
365  "fh_signal_pty_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc]);
366 }
367 
369 
370  TCanvas* c =
371  CreateCanvas("jpsi_fh_pty_efficiency", "jpsi_fh_pty_efficiency", 1200, 800);
372  c->Divide(3, 2);
373  for (int i = 1; i < CbmAnaJpsiHist::fNofAnaSteps; i++) {
374  c->cd(i);
376  }
377 }
378 
380  h->GetXaxis()->SetLabelSize(0.06);
381  int x = 1;
382  for (Int_t step = 0; step < CbmAnaJpsiHist::fNofAnaSteps; step++) {
383  h->GetXaxis()->SetBinLabel(x, CbmAnaJpsiHist::fAnaStepsLatex[step].c_str());
384  x++;
385  }
386 }
387 
389  TH1D* signal =
390  (TH1D*) H1("fh_signal_minv_" + CbmAnaJpsiHist::fAnaSteps[step]);
391  TH1D* bg = (TH1D*) H1("fh_bg_minv_" + CbmAnaJpsiHist::fAnaSteps[step]);
392 
393  //Create Histogram for the Gaus-Fit
394  TH1D* signalFit = (TH1D*) signal->Clone();
395  signalFit->Fit("gaus");
396 
397  //Calculate sigma and Mean
398  Double_t sigmaSignal = signalFit->GetFunction("gaus")->GetParameter("Sigma");
399  Double_t meanSignal = signalFit->GetFunction("gaus")->GetParameter("Mean");
400 
401  //Get the number of the Bins of Min and Max
402  int signalMin = signal->FindBin(meanSignal - 2. * sigmaSignal);
403  int signalMax = signal->FindBin(meanSignal + 2. * sigmaSignal);
404 
405  double NOfSignalEntries = 0.;
406  double NOfBgEntries = 0.;
407 
408  //sum up all the bins
409  for (int i = signalMin; i <= signalMax; i++) {
410  NOfSignalEntries += signal->GetBinContent(i);
411  NOfBgEntries += bg->GetBinContent(i);
412  }
413 
414  //Calculate Signal/Background
415  if (NOfBgEntries <= 0.) {
416  return 0.;
417  } else {
418  double sOverBg = NOfSignalEntries / NOfBgEntries;
419  return sOverBg;
420  }
421 }
422 
424  CreateCanvas("jpsi_fh_SignalOverBg_allAnaSteps",
425  "jpsi_fh_SignalOverBg_allAnaSteps",
426  600,
427  600);
428  HM()->Create1<TH1D>("fh_SignalOverBg_allAnaSteps",
429  "fh_SignalOverBg_allAnaSteps;AnaSteps;S/Bg",
430  6,
431  0,
432  6);
433 
434  for (int i = 0; i < CbmAnaJpsiHist::fNofAnaSteps; i++) {
435  double nstep = i + 0.5;
436  double SOverBg = SignalOverBg(i);
437  HM()->H1("fh_SignalOverBg_allAnaSteps")->Fill(nstep, SOverBg);
438  gPad->SetLogy();
439  }
440 
441  SetAnalysisStepLabels(H1("fh_SignalOverBg_allAnaSteps"));
442  DrawH1(H1("fh_SignalOverBg_allAnaSteps"));
443 }
444 
446  TH1D* signal =
447  (TH1D*) H1("fh_signal_minv_" + CbmAnaJpsiHist::fAnaSteps[step]);
448  TH1D* background =
449  (TH1D*) H1("fh_bg_minv_" + CbmAnaJpsiHist::fAnaSteps[step]);
450 
451  //Create new histograms for further steps
452  TH1D* s = (TH1D*) signal->Clone();
453  TH1D* bg = (TH1D*) background->Clone();
454  TH1D* sbg = (TH1D*) background->Clone();
455 
456  //s->Scale(0.0596);
457 
458  sbg->Add(s);
459  sbg->SetMinimum(1e-12);
460 
461  DrawH1(
462  list_of(sbg)(bg)(s), list_of("")("")(""), kLinear, kLog, false, 0, 0, 0, 0);
463  //DrawH1(list_of(sbg)(bg)(s),list_of("Signal And Bg")("Background")("Signal"),kLinear, kLog, true, 0.9, 0.7, 0.99, 0.9);
464  s->SetFillColor(kRed);
465  s->SetLineColor(kBlack);
466  s->SetLineWidth(1);
467  s->SetLineStyle(CbmDrawingOptions::MarkerStyle(1));
468  bg->SetFillColor(kYellow - 10);
469  bg->SetLineColor(kBlack);
470  bg->SetLineWidth(2);
471  bg->SetLineStyle(CbmDrawingOptions::MarkerStyle(1));
472  sbg->SetFillColor(kBlue);
473  sbg->SetLineColor(kBlack);
474  sbg->SetLineWidth(1);
475  sbg->SetLineStyle(CbmDrawingOptions::MarkerStyle(1));
476  s->SetMarkerStyle(1);
477  bg->SetMarkerStyle(1);
478  sbg->SetMarkerStyle(1);
479 
480 
481  DrawTextOnPad(CbmAnaJpsiHist::fAnaStepsLatex[step], 0.65, 0.9, 0.85, 1.);
482 }
483 
485  TCanvas* c1 = CreateCanvas(
486  "jpsi_fh_Minv_Signal_and_Bg", "jpsi_fh_Minv_Signal_and_Bg", 1200, 800);
487 
488  c1->Divide(3, 2);
489 
490  for (int i = 0; i < CbmAnaJpsiHist::fNofAnaSteps; i++) {
491  c1->cd(i + 1);
492  DrawMinvSAndBg(i);
493  }
494 
495  CreateCanvas("jpsi_fh_Minv_Signal_and_Bg_ptCut",
496  "jpsi_fh_Minv_Signal_and_Bg_ptCut",
497  600,
498  600);
500 }
501 
503  TH1D* Mc = (TH1D*) H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc])
504  ->Clone();
505  TH1D* McEff = Cbm::DivideH1(
506  (TH1D*) H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiMc])
507  ->Clone(),
508  (TH1D*) Mc->Clone());
509  McEff->SetMinimum(0.);
510  McEff->SetMaximum(115.);
511  TH1D* AccEff = Cbm::DivideH1(
512  (TH1D*) H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiAcc])
513  ->Clone(),
514  (TH1D*) Mc->Clone());
515  TH1D* RecEff = Cbm::DivideH1(
516  (TH1D*) H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiReco])
517  ->Clone(),
518  (TH1D*) Mc->Clone());
519  TH1D* Chi2PrimEff = Cbm::DivideH1(
520  (TH1D*) H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiChi2Prim])
521  ->Clone(),
522  (TH1D*) Mc->Clone());
523  TH1D* ElIdEff = Cbm::DivideH1(
524  (TH1D*) H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiElId])
525  ->Clone(),
526  (TH1D*) Mc->Clone());
527  TH1D* PtEff = Cbm::DivideH1(
528  (TH1D*) H1("fh_track_el_mom_" + CbmAnaJpsiHist::fAnaSteps[kJpsiPtCut])
529  ->Clone(),
530  (TH1D*) Mc->Clone());
531 
532  CreateCanvas("jpsi_fh_Momentum_Efficiency_AllSteps",
533  "jpsi_fh_Momentum_Efficiency_AllSteps",
534  800,
535  800);
536 
537  DrawH1(list_of(McEff)(AccEff)(RecEff)(Chi2PrimEff)(ElIdEff)(PtEff),
544  kLinear,
545  kLinear,
546  true,
547  0.9,
548  0.6,
549  0.99,
550  0.99,
551  "HIST");
552 
553 
554  DrawAnalysisStepsH1("fh_track_el_mom", false);
555  gPad->SetLogy(false);
556 }
557 
559  CreateCanvas(
560  "jpsi_fh_Momentum_Mc_Reco", "jpsi_fh_Momentum_Mc_Reco", 800, 800);
561  DrawH2(H2("fh_track_el_mom_mc_rec"));
562 }
563 
565  H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_gg")
566  ->SetMaximum(1e-2);
567  H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_gg")
568  ->SetMinimum(1e-6);
569  DrawH1(
570  list_of(
571  H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_gg"))(
572  (TH1*) H1("fh_bg_minv_" + CbmAnaJpsiHist::fAnaSteps[step])->Clone())(
573  H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_gp"))(
574  H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_go"))
575  //(H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_pg"))
576  (H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_pp"))(
577  H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_po"))
578  //(H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_og"))
579  //(H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_op"))
580  (H1("fh_bg_participants_minv_" + CbmAnaJpsiHist::fAnaSteps[step] + "_oo")),
581  list_of("#gamma + #gamma")("whole BG")("#gamma + #pi^{0}")(
582  "#gamma + others")
583  /*("#pi^{0} + #gamma")*/ ("#pi^{0} + #pi^{0}")("#pi^{0} + others")
584  /*("others + #gamma")("others + #pi^{0}")*/ ("others + others"),
585  kLinear,
586  kLog,
587  true,
588  0.85,
589  0.6,
590  0.99,
591  0.99);
592 }
593 
595  TCanvas* c =
596  CreateCanvas("jpsi_fh_bg_pair_source", "jpsi_fh_bg_pair_source", 1200, 800);
597  c->Divide(2, 2);
598  for (int i = 0; i < CbmAnaJpsiHist::fNofAnaSteps - 2; i++) {
599  c->cd(i + 1);
601  DrawTextOnPad(CbmAnaJpsiHist::fAnaStepsLatex[i + 2], 0.6, 0.89, 0.7, 0.99);
602  }
603 }
604 
605 void CbmAnaJpsiReport::DrawBgSource2D(const string& histName,
606  const vector<string>& yLabels,
607  const string& zTitle) {
608  gStyle->SetPaintTextFormat("4.2f");
609  CreateCanvas(string("jpsi_" + histName + "_abs").c_str(),
610  string("jpsi_" + histName + "_abs").c_str(),
611  900,
612  600);
613  TH2D* habs = (TH2D*) H2(histName)->Clone();
614  habs->SetStats(false);
615  habs->GetZaxis()->SetTitle(zTitle.c_str());
616  habs->GetXaxis()->SetRange(kJpsiReco + 1, CbmAnaJpsiHist::fNofAnaSteps);
617  habs->SetMarkerSize(1.8);
618  DrawH2(habs, kLinear, kLinear, kLog, "text COLZ");
619 
620  CreateCanvas(string("jpsi_" + histName + "_percent").c_str(),
621  string("jpsi_" + histName + "_percent").c_str(),
622  900,
623  600);
624  TH2D* hperc = (TH2D*) H2(histName)->Clone();
625  hperc->SetStats(false);
626  Int_t nBinsX = hperc->GetNbinsX();
627  Int_t nBinsY = hperc->GetNbinsY();
628  for (Int_t x = 1; x <= nBinsX; x++) {
629  // calculate total number of BG tracks (pairs) for a current step
630  double nbg = 0.;
631  for (Int_t y = 1; y <= nBinsY; y++) {
632  nbg += habs->GetBinContent(x, y);
633  }
634  Double_t sc = 100. / (nbg);
635  for (Int_t y = 1; y <= nBinsY; y++) {
636  Double_t val = sc * hperc->GetBinContent(x, y);
637  hperc->SetBinContent(x, y, val);
638  }
639  }
640  hperc->GetZaxis()->SetTitle("[%]");
641  hperc->GetXaxis()->SetLabelSize(0.06);
642  hperc->GetYaxis()->SetLabelSize(0.06);
643  hperc->SetMarkerColor(kBlack);
644  hperc->SetMarkerSize(1.8);
645  hperc->GetXaxis()->SetRange(kJpsiReco + 1, CbmAnaJpsiHist::fNofAnaSteps);
646  DrawH2(hperc, kLinear, kLinear, kLinear, "text COLZ");
647 
648  for (UInt_t y = 1; y <= yLabels.size(); y++) {
649  hperc->GetYaxis()->SetBinLabel(y, yLabels[y - 1].c_str());
650  habs->GetYaxis()->SetBinLabel(y, yLabels[y - 1].c_str());
651  }
652 
653  SetAnalysisStepLabels(hperc);
654  SetAnalysisStepLabels(habs);
655 }
656 
CbmReport::CreateCanvas
TCanvas * CreateCanvas(const char *name, const char *title, Int_t ww, Int_t wh)
Create canvas and put it to vector of TCanvases. Canvases created with this function will be automati...
Definition: CbmReport.cxx:82
kJpsiReco
@ kJpsiReco
Definition: CbmAnaJpsiHist.h:23
CbmAnaJpsiCuts::SetDefaultCuts
void SetDefaultCuts()
Definition: CbmAnaJpsiCuts.h:17
CbmAnaJpsiHist::fAnaStepsLatex
static const std::vector< std::string > fAnaStepsLatex
Definition: CbmAnaJpsiHist.h:38
kJpsiPtCut
@ kJpsiPtCut
Definition: CbmAnaJpsiHist.h:26
CbmAnaJpsiReport::DrawCutH1
void DrawCutH1(const std::string &hName, double cutValue, bool doScale=false)
Definition: CbmAnaJpsiReport.cxx:227
CbmHistManager::ScaleByPattern
void ScaleByPattern(const std::string &pattern, Double_t scale)
Scale histograms which name matches specified pattern.
Definition: core/base/CbmHistManager.cxx:221
CbmSimulationReport::H2
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
Definition: CbmSimulationReport.h:80
CbmAnaJpsiReport::DrawMinvMismatches
void DrawMinvMismatches(int step)
Definition: CbmAnaJpsiReport.cxx:292
CbmReportElement::DocumentBegin
virtual std::string DocumentBegin() const =0
Return string with open tags for document.
CbmAnaJpsiHist::fAnaStepsColor
static const std::vector< int > fAnaStepsColor
Definition: CbmAnaJpsiHist.h:39
CbmAnaJpsiReport::DrawPtYEfficiencyAll
void DrawPtYEfficiencyAll()
Definition: CbmAnaJpsiReport.cxx:368
CbmAnaJpsiReport::DrawMinvSAndBgAllSteps
void DrawMinvSAndBgAllSteps()
Definition: CbmAnaJpsiReport.cxx:484
kJpsiElId
@ kJpsiElId
Definition: CbmAnaJpsiHist.h:25
CbmReportElement::DocumentEnd
virtual std::string DocumentEnd() const =0
Return string with close tags of the document.
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmAnaJpsiReport::DrawSourceTypesH1
void DrawSourceTypesH1(const std::string &hName, bool doScale=false)
Definition: CbmAnaJpsiReport.cxx:210
CbmAnaJpsiReport::DrawPairSource
void DrawPairSource()
Definition: CbmAnaJpsiReport.cxx:594
Cbm::DivideH2
TH2D * DivideH2(TH2 *h1, TH2 *h2, const string &histName, double scale, const string &titleZaxis)
Definition: CbmUtils.cxx:92
kJpsiAcc
@ kJpsiAcc
Definition: CbmAnaJpsiHist.h:22
CbmHistManager::RebinByPattern
void RebinByPattern(const std::string &pattern, Int_t ngroup)
Rebin histograms which name matches specified pattern.
Definition: core/base/CbmHistManager.cxx:250
CbmAnaJpsiHist::fSourceTypesColor
static const std::vector< int > fSourceTypesColor
Definition: CbmAnaJpsiHist.h:34
kJpsiChi2Prim
@ kJpsiChi2Prim
Definition: CbmAnaJpsiHist.h:24
CbmAnaJpsiCuts::fPtCut
Double_t fPtCut
Definition: CbmAnaJpsiCuts.h:39
CbmAnaJpsiReport::DrawMomEffAllSteps
void DrawMomEffAllSteps()
Definition: CbmAnaJpsiReport.cxx:502
CbmReport::R
const CbmReportElement * R() const
Accessor to CbmReportElement object. User has to write the report using available tags from CbmReport...
Definition: CbmReport.h:51
CbmAnaJpsiReport::SetAnalysisStepLabels
void SetAnalysisStepLabels(TH1 *h)
Definition: CbmAnaJpsiReport.cxx:379
CbmDrawHist.h
Helper functions for drawing 1D and 2D histograms and graphs.
CbmReportElement.h
Abstract class for basic report elements (headers, tables, images etc.).
CbmHistManager.h
Histogram manager.
CbmAnaJpsiReport::DrawMinvSAndBg
void DrawMinvSAndBg(int step)
Definition: CbmAnaJpsiReport.cxx:445
CbmAnaJpsiReport::DrawMomMcVsRec
void DrawMomMcVsRec()
Definition: CbmAnaJpsiReport.cxx:558
CbmAnaJpsiHist::fAnaSteps
static const std::vector< std::string > fAnaSteps
Definition: CbmAnaJpsiHist.h:37
CbmAnaJpsiReport::Draw
virtual void Draw()
Inherited from CbmSimulationReport.
Definition: CbmAnaJpsiReport.cxx:48
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmReport::SetReportName
void SetReportName(const std::string &name)
Definition: CbmReport.h:59
Cbm::DivideH1
TH1D * DivideH1(TH1 *h1, TH1 *h2, const string &histName, double scale, const string &titleYaxis)
Definition: CbmUtils.cxx:70
CbmAnaJpsiReport::DrawBgSource2D
void DrawBgSource2D(const std::string &histName, const std::vector< std::string > &yLabels, const std::string &zTitle)
Definition: CbmAnaJpsiReport.cxx:605
kJpsiMc
@ kJpsiMc
Definition: CbmAnaJpsiHist.h:21
DrawTextOnPad
void DrawTextOnPad(const string &text, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: CbmDrawHist.cxx:253
DrawH1
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
Definition: CbmDrawHist.cxx:49
CbmAnaJpsiCuts.h
CbmReport::PrintCanvases
void PrintCanvases() const
Print images created from canvases in the report.
Definition: CbmReport.cxx:109
CbmAnaJpsiHist.h
CbmAnaJpsiReport::SignalOverBgAllSteps
void SignalOverBgAllSteps()
Definition: CbmAnaJpsiReport.cxx:423
CbmAnaJpsiReport::Create
virtual void Create()
Inherited from CbmSimulationReport.
Definition: CbmAnaJpsiReport.cxx:38
CbmDrawingOptions::MarkerStyle
static Int_t MarkerStyle(Int_t markerIndex)
Definition: CbmDrawHist.h:58
CbmAnaJpsiReport::DrawPtYEfficiency
void DrawPtYEfficiency(int step)
Definition: CbmAnaJpsiReport.cxx:358
h
Data class with information on a STS local track.
CbmAnaJpsiReport::DrawEfficiency
void DrawEfficiency(const std::string &h, const std::string &hMC)
Definition: CbmAnaJpsiReport.cxx:344
CbmAnaJpsiHist::fSourceTypes
static const std::vector< std::string > fSourceTypes
Definition: CbmAnaJpsiHist.h:32
CbmAnaJpsiHist::fSourceTypesLatex
static const std::vector< std::string > fSourceTypesLatex
Definition: CbmAnaJpsiHist.h:33
kLinear
@ kLinear
Definition: CbmDrawHist.h:79
CbmAnaJpsiReport::SignalOverBg
double SignalOverBg(int step)
Definition: CbmAnaJpsiReport.cxx:388
CbmAnaJpsiReport::DrawAnalysisStepsH1
void DrawAnalysisStepsH1(const std::string &hName, bool doScale, double min=-1., double max=-1.)
Definition: CbmAnaJpsiReport.cxx:188
CbmHistManager::Create1
void Create1(const std::string &name, const std::string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
Definition: CbmHistManager.h:81
CbmAnaJpsiReport::Draw2DCut
void Draw2DCut(const std::string &hist)
Definition: CbmAnaJpsiReport.cxx:239
CbmSimulationReport::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmSimulationReport.h:73
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmAnaJpsiReport::DrawCutDistributions
void DrawCutDistributions()
Definition: CbmAnaJpsiReport.cxx:250
CbmAnaJpsiReport::DrawSignalMinv
void DrawSignalMinv()
Definition: CbmAnaJpsiReport.cxx:267
CbmAnaJpsiReport
Definition: CbmAnaJpsiReport.h:13
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
CbmUtils.h
CbmAnaJpsiHist::fNofSourceTypes
static const int fNofSourceTypes
Definition: CbmAnaJpsiHist.h:31
CbmAnaJpsiReport::~CbmAnaJpsiReport
virtual ~CbmAnaJpsiReport()
Destructor.
Definition: CbmAnaJpsiReport.cxx:36
CbmAnaJpsiReport::DrawMinvMismatchesAll
void DrawMinvMismatchesAll()
Definition: CbmAnaJpsiReport.cxx:328
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmAnaJpsiReport.h
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmSimulationReport::HM
CbmHistManager * HM() const
Return pointer to Histogram manager.
Definition: CbmSimulationReport.h:92
CbmAnaJpsiReport::DrawAnalysisStepsH2
void DrawAnalysisStepsH2(const std::string &hName, bool DoDrawEfficiency)
Definition: CbmAnaJpsiReport.cxx:171
CbmAnaJpsiCuts::fChiPrimCut
Double_t fChiPrimCut
Definition: CbmAnaJpsiCuts.h:38
CbmSimulationReport
Base class for simulation reports.
Definition: CbmSimulationReport.h:28
CbmReport::Out
std::ostream & Out() const
All text output goes to this stream.
Definition: CbmReport.h:56
DrawH2
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
Definition: CbmDrawHist.cxx:84
CbmAnaJpsiReport::DrawPairSourceAnaSteps
void DrawPairSourceAnaSteps(int step)
Definition: CbmAnaJpsiReport.cxx:564
SetDefaultDrawStyle
void SetDefaultDrawStyle()
Definition: CbmDrawHist.cxx:33
CbmLitGlobalElectronId.h
CbmAnaJpsiHist::fNofAnaSteps
static const int fNofAnaSteps
Definition: CbmAnaJpsiHist.h:36
CbmAnaJpsiReport::CbmAnaJpsiReport
CbmAnaJpsiReport()
Constructor.
Definition: CbmAnaJpsiReport.cxx:32
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmReportElement::Title
virtual std::string Title(int size, const std::string &title) const =0
Return string with title.
Cbm::NumberToString
std::string NumberToString(const T &value, int precision=1)
Definition: CbmUtils.h:23
CbmLitGlobalElectronId::GetInstance
static CbmLitGlobalElectronId & GetInstance()
Definition: CbmLitGlobalElectronId.h:32
Cbm::Split
vector< string > Split(const string &name, char delimiter)
Definition: CbmUtils.cxx:54
kLog
@ kLog
Definition: CbmDrawHist.h:78
CbmAnaJpsiCuts
Definition: CbmAnaJpsiCuts.h:10