CbmRoot
CbmAnaDielectronTaskDraw.cxx
Go to the documentation of this file.
1 
8 
9 
10 #include "CbmDrawHist.h"
11 #include "CbmHistManager.h"
12 #include "utils/CbmUtils.h"
13 
14 #include <iomanip>
15 #include <iostream>
16 #include <sstream>
17 #include <string>
18 
20 
21 #include "TCanvas.h"
22 #include "TClass.h"
23 #include "TEllipse.h"
24 #include "TF1.h"
25 #include "TFile.h"
26 #include "TH1.h"
27 #include "TH1D.h"
28 #include "TH2D.h"
29 #include "TKey.h"
30 #include "TLine.h"
31 #include "TMath.h"
32 #include "TPad.h"
33 #include "TStyle.h"
34 #include "TSystem.h"
35 #include "TText.h"
36 #include <TLegend.h>
37 
39 
40 using namespace std;
41 using namespace Cbm;
43  : TObject()
44  , fNofEvents(0)
45  , fUseMvd(kFALSE)
46  , fDrawSignificance(kFALSE)
47  , fCuts()
48  , fHM(NULL)
49  , fOutputDir("") {}
50 
51 void CbmAnaDielectronTaskDraw::DrawHistFromFile(const string& fileName,
52  const string& outputDir,
53  Bool_t useMvd,
54  Bool_t drawSig) {
56  fOutputDir = outputDir;
57  fUseMvd = useMvd;
58  fDrawSignificance = drawSig;
59 
61 
62  fHM = new CbmHistManager();
63  TFile* file = new TFile(fileName.c_str());
64  fHM->ReadFromFile(file);
65 
66  fNofEvents = (Int_t) H1("fh_event_number")->GetEntries();
67  cout << "File name = " << fileName << endl;
68  cout << "Number of events = " << fNofEvents << endl;
69 
70  fHM->ScaleByPattern(".*", 1. / fNofEvents);
71  SOverBgAll();
72  RebinMinvHist();
73  if (!fUseMvd) RemoveMvdCutBins();
79  DrawMotherPdg();
89  DrawMinvPtAll();
91  DrawMvdCutQa();
94  DrawPmtXY();
95 
97 }
98 
100  int nRebin = 10;
101  for (int i = 0; i < CbmLmvmHist::fNofAnaSteps; i++) {
102  H1("fh_signal_minv_" + CbmLmvmHist::fAnaSteps[i])->Rebin(nRebin);
103  H1("fh_bg_minv_" + CbmLmvmHist::fAnaSteps[i])->Rebin(nRebin);
104  H1("fh_pi0_minv_" + CbmLmvmHist::fAnaSteps[i])->Rebin(nRebin);
105  H1("fh_eta_minv_" + CbmLmvmHist::fAnaSteps[i])->Rebin(nRebin);
106  H1("fh_bg_truematch_minv_" + CbmLmvmHist::fAnaSteps[i])->Rebin(2 * nRebin);
107  H1("fh_bg_mismatch_minv_" + CbmLmvmHist::fAnaSteps[i])->Rebin(2 * nRebin);
108  H1("fh_bg_truematch_el_minv_" + CbmLmvmHist::fAnaSteps[i])
109  ->Rebin(2 * nRebin);
110  H1("fh_bg_truematch_notel_minv_" + CbmLmvmHist::fAnaSteps[i])
111  ->Rebin(2 * nRebin);
112 
113  for (int iP = 0; iP < CbmLmvmHist::fNofBgPairSources; iP++) {
114  stringstream ss;
115  ss << "fh_source_bg_minv_" << iP << "_" << CbmLmvmHist::fAnaSteps[i];
116  H1(ss.str())->Rebin(8 * nRebin);
117  }
118  }
119 }
120 
121 TH1D* CbmAnaDielectronTaskDraw::H1(const string& name) {
122  return (TH1D*) fHM->H1(name);
123 }
124 /*
125 TH2D* CbmAnaDielectronTaskDraw::H2(
126  const string& name)
127 {
128  return (TH2D*) fHM->H1(name);
129 }
130 */
131 TH2D* CbmAnaDielectronTaskDraw::H2(const string& name) {
132  return (TH2D*) fHM->H2(name);
133 }
134 
136  TH1* h2,
137  Double_t xPos,
138  Double_t yPos) {
139  string effTxt = "";
140  if (h2->GetEntries() != 0) {
141  effTxt = Cbm::NumberToString<Double_t>(
142  ((Double_t) h1->GetEntries() / h2->GetEntries() * 100.), 1);
143  }
144  TText* t = new TText(xPos, yPos, effTxt.c_str());
145  t->SetTextSize(0.1);
146  t->Draw();
147 }
148 
149 
151  TH1D* bg,
152  const string& name,
153  const string& option) {
154  Int_t nBins = s->GetNbinsX();
155  Double_t xmin = s->GetXaxis()->GetXmin();
156  Double_t xmax = s->GetXaxis()->GetXmax();
157  TH1D* hsig = new TH1D(name.c_str(), name.c_str(), nBins, xmin, xmax);
158  hsig->GetXaxis()->SetTitle(s->GetXaxis()->GetTitle());
159 
160  Double_t sumSignal = 0., sumBg = 0., significance = 0.;
161  // "right" - one wants to reject right part of the histogram.
162  // value > cut -> reject
163  if (option == "right") {
164  for (Int_t i = 1; i <= nBins; i++) {
165  sumSignal = s->Integral(1, i, "width");
166  sumBg = bg->Integral(1, i, "width");
167  Double_t prov = TMath::Sqrt(sumSignal + sumBg);
168  if (prov != 0.)
169  significance = sumSignal / prov;
170  else
171  significance = 0.;
172  hsig->SetBinContent(i, significance);
173  }
174  // "left" - one wants to reject left part of the histogram.
175  // value < cut -> reject
176  } else if (option == "left") {
177  for (Int_t i = nBins; i >= 1; i--) {
178  sumSignal = s->Integral(i, nBins, "width");
179  sumBg = bg->Integral(i, nBins, "width");
180  Double_t prov = TMath::Sqrt(sumSignal + sumBg);
181  if (prov != 0.)
182  significance = sumSignal / prov;
183  else
184  significance = 0.;
185  hsig->SetBinContent(i, significance);
186  }
187  }
188  return hsig;
189 }
190 
192  TH2D* bg,
193  const string& name,
194  const string& title) {
195 
196  Double_t xmin = 1.0;
197  Double_t xmax = 5.0;
198  Double_t ymin = 1.0;
199  Double_t ymax = 5.0;
200  Double_t delta = 0.1;
201  Int_t nStepsX = (Int_t)((xmax - xmin) / delta);
202  Int_t nStepsY = (Int_t)((ymax - ymin) / delta);
203  Int_t nBinsX = signal->GetNbinsX();
204  Int_t nBinsY = signal->GetNbinsY();
205 
206  TH2D* hsig = new TH2D(
207  name.c_str(), title.c_str(), nStepsX, xmin, xmax, nStepsY, ymin, ymax);
208 
209  Double_t sumSignal = 0;
210  Double_t sumBg = 0;
211 
212  Int_t binX = 1;
213  for (Double_t xcut = xmin; xcut <= xmax; xcut += delta, binX++) {
214  Int_t binY = 1;
215  cout << "x " << xcut << endl;
216  for (Double_t ycut = ymin; ycut <= ymax; ycut += delta, binY++) {
217  sumSignal = 0;
218  sumBg = 0;
219  for (Int_t ix = 1; ix <= nBinsX; ix++) {
220  for (Int_t iy = 1; iy <= nBinsY; iy++) {
221  Double_t xcenter = signal->GetXaxis()->GetBinCenter(ix);
222  Double_t ycenter = signal->GetYaxis()->GetBinCenter(iy);
223  Double_t val = -1 * (ycut / xcut) * xcenter + ycut;
224 
225  if (!(xcenter < xcut && ycenter < val)) {
226  sumSignal += signal->GetBinContent(ix, iy);
227  sumBg += bg->GetBinContent(ix, iy);
228  }
229  }
230  }
231  Double_t prov = TMath::Sqrt(sumSignal + sumBg);
232  Double_t significance = 0.;
233  if (prov != 0) significance = sumSignal / prov;
234  hsig->SetBinContent(binX, binY, significance);
235  }
236  }
237  return hsig;
238 }
239 
241  TH1D* s = H1("fh_signal_minv_" + CbmLmvmHist::fAnaSteps[step]);
242  TH1D* bg = H1("fh_bg_minv_" + CbmLmvmHist::fAnaSteps[step]);
243  H2("fh_signal_pty_" + CbmLmvmHist::fAnaSteps[step]);
244  H2("fh_signal_pty_" + CbmLmvmHist::fAnaSteps[0]);
245 
246  if (s->GetEntries() < 1) return;
247 
248  TH1D* sClone = (TH1D*) s->Clone();
249  sClone->Fit("gaus", "Q");
250 
251  Double_t mean = sClone->GetFunction("gaus")->GetParameter("Mean");
252  Double_t sigma = sClone->GetFunction("gaus")->GetParameter("Sigma");
253 
254  Int_t minInd = s->FindBin(mean - 2. * sigma);
255  Int_t maxInd = s->FindBin(mean + 2. * sigma);
256 
257  Double_t sumSignal = 0.;
258  Double_t sumBg = 0.;
259  for (Int_t i = minInd + 1; i <= maxInd - 1; i++) {
260  sumSignal += s->GetBinContent(i);
261  sumBg += bg->GetBinContent(i);
262  }
263 }
264 
266  fHM->CreateCanvas("lmvm_signal_fitting", "lmvm_signal_fitting", 600, 600);
267  SOverBg(kReco);
269  SOverBg(kElId);
271  if (fUseMvd) SOverBg(kMvd1Cut);
272  if (fUseMvd) SOverBg(kMvd2Cut);
273  SOverBg(kStCut);
274  SOverBg(kTtCut);
275  SOverBg(kPtCut);
276 }
277 
278 void CbmAnaDielectronTaskDraw::DrawPtYDistribution(int step, bool drawAnaStep) {
279  TH2D* h = H2("fh_signal_pty_" + CbmLmvmHist::fAnaSteps[step]);
280  TH2D* hmc = H2("fh_signal_pty_" + CbmLmvmHist::fAnaSteps[0]);
281 
282  DrawH2(h, kLinear, kLinear, kLinear, "COLZ");
283  if (drawAnaStep) DrawEfficiencyOnHist(h, hmc, 0.2, 1.8);
284  if (drawAnaStep)
285  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.50, 0.78, 0.70, 0.9);
286 }
287 
289  Int_t hi = 1;
290  TCanvas* c = fHM->CreateCanvas("lmvm_pty", "lmvm_pty", 750, 1000);
291  c->Divide(3, 4);
292  for (int step = 0; step < CbmLmvmHist::fNofAnaSteps; step++) {
293  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
294  c->cd(hi++);
295  DrawPtYDistribution(step);
296  }
297 
299  "lmvm_pty_" + CbmLmvmHist::fAnaSteps[kAcc],
300  800,
301  800);
302  DrawPtYDistribution(kAcc, true);
303 
305  "lmvm_pty_" + CbmLmvmHist::fAnaSteps[kPtCut],
306  800,
307  800);
309 }
310 
311 
313  Int_t hi = 1;
314  TCanvas* c = fHM->CreateCanvas(
315  "lmvm_signal_rapidity", "lmvm_signal_rapidity", 750, 1000);
316  c->Divide(3, 4);
317  for (int step = 0; step < CbmLmvmHist::fNofAnaSteps; step++) {
318  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
319  c->cd(hi++);
320  TH1D* proj =
321  H2("fh_signal_pty_" + CbmLmvmHist::fAnaSteps[step])->ProjectionX();
322  DrawH1(proj);
323  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.70, 0.78, 0.90, 0.9);
324  }
325 }
326 
327 
328 void CbmAnaDielectronTaskDraw::DrawPtYEfficiency(int step, bool drawAnaStep) {
329  TH2D* h = H2("fh_signal_pty_" + CbmLmvmHist::fAnaSteps[step]);
330  // efficiency is normalized to the previous step (step - 1)
331  TH2D* hmc = H2("fh_signal_pty_" + CbmLmvmHist::fAnaSteps[kMc]);
332 
333  TH2D* eff = Cbm::DivideH2(h, hmc);
334  eff->GetZaxis()->SetTitle("Efficiency [%]");
335  DrawH2(eff);
336  eff->SetMaximum(10.);
337  if (drawAnaStep) DrawEfficiencyOnHist(h, hmc, 0.2, 1.8);
338  if (drawAnaStep)
339  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.50, 0.78, 0.70, 0.9);
340 }
341 
343  Int_t hi = 1;
344  TCanvas* c =
345  fHM->CreateCanvas("lmvm_pty_efficiency", "lmvm_pty_efficiency", 1000, 1000);
346  c->Divide(3, 3);
347  for (int step = kAcc; step < CbmLmvmHist::fNofAnaSteps; step++) {
348  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
349  c->cd(hi++);
350  DrawPtYEfficiency(step);
351  }
352 
353  fHM->CreateCanvas(
354  "lmvm_pty_efficiency_ptcut", "lmvm_pty_efficiency_ptcut", 600, 600);
355  DrawPtYEfficiency(kPtCut, true);
356 }
357 
359  fHM->CreateCanvas("lmvm_signal_momentum_distribution",
360  "lmvm_signal_momentum_distribution",
361  600,
362  600);
363  Draw1DHistoForEachAnalysisStep("fh_signal_mom", true);
364 }
365 
367  //EFFICIENCY vs. MOMENTUM
368  /* TCanvas *c5 = CreateCanvas("signal_momentum_efficiency","signal_momentum_efficiency", 600, 600);
369  Draw1DHistoForEachAnalysisStep(
370  NULL,
371  NULL, //DivideHisto1D(H1("fh_acc_signal_mom"), H1("fh_mc_signal_mom")),
372  DivideHisto1D(H1("fh_reco_signal_mom"), H1("fh_mc_signal_mom")),
373  DivideHisto1D(H1("fh_chi_prim_signal_mom"), H1("fh_mc_signal_mom")),
374  DivideHisto1D(H1("fh_el_id_signal_mom"), H1("fh_mc_signal_mom")),
375  DivideHisto1D(H1("fh_gammacut_signal_mom"), H1("fh_mc_signal_mom")),
376  DivideHisto1D(H1("fh_dstscut_signal_mom"), H1("fh_mc_signal_mom")),
377  DivideHisto1D(H1("fh_dsts2cut_signal_mom"), H1("fh_mc_signal_mom")),
378  DivideHisto1D(H1("fh_stcut_signal_mom"), H1("fh_mc_signal_mom")),
379  DivideHisto1D(H1("fh_ttcut_signal_mom"), H1("fh_mc_signal_mom")),
380  DivideHisto1D(H1("fh_ptcut_signal_mom"), H1("fh_mc_signal_mom")),
381  DivideHisto1D(H1("fh_anglecut_signal_mom"), H1("fh_mc_signal_mom")),
382  false
383  );*/
384 }
385 
387  fHM->CreateCanvas("lmvm_mother_pdg", "lmvm_mother_pdg", 500, 500);
388  DrawH1({H1("fh_mc_mother_pdg"), H1("fh_acc_mother_pdg")},
389  {"MC", "acc"},
390  kLinear,
391  kLog,
392  true,
393  0.7,
394  0.7,
395  0.99,
396  0.99);
397 }
398 
400  fHM->CreateCanvas("mc_signal_mom_angle", "mc_signal_mom_angle", 500, 500);
401  DrawH2(H2("fh_mc_signal_mom_angle"));
402 }
403 
405  TCanvas* c = fHM->CreateCanvas("lmvm_pmt_xy", "lmvm_pmt_xy", 500, 1800);
406  c->Divide(1, 3);
407  c->cd(1);
408  DrawH2(H2("fh_signal_pmtXY"));
409  gPad->SetLogz(true);
410  DrawTextOnPad(CbmLmvmHist::fSourceTypesLatex[kSignal], 0.50, 0.78, 0.70, 0.9);
411  c->cd(2);
412  DrawH2(H2("fh_pi0_pmtXY"));
413  gPad->SetLogz(true);
414  DrawTextOnPad(CbmLmvmHist::fSourceTypesLatex[kPi0], 0.50, 0.78, 0.70, 0.9);
415  c->cd(3);
416  DrawH2(H2("fh_gamma_pmtXY"));
417  gPad->SetLogz(true);
418  DrawTextOnPad(CbmLmvmHist::fSourceTypesLatex[kGamma], 0.50, 0.78, 0.70, 0.9);
419 }
420 
422  bool doScale) {
423  vector<TH1*> h;
424  vector<string> hLegend;
425  for (int i = 0; i < CbmLmvmHist::fNofSourceTypes; i++) {
426  string fullName = hName + "_" + CbmLmvmHist::fSourceTypes[i];
427  h.push_back(H1(fullName));
428  h[i]->SetLineWidth(2);
429  h[i]->SetLineColor(CbmLmvmHist::fSourceTypesColor[i]);
430  if (doScale) h[i]->Scale(1. / h[i]->Integral());
431  hLegend.push_back(CbmLmvmHist::fSourceTypesLatex[i]);
432  }
433  DrawH1(h, hLegend, kLinear, kLog, true, 0.90, 0.7, 0.99, 0.99);
434 }
435 
436 void CbmAnaDielectronTaskDraw::Draw1DCut(const string& hName,
437  const string& sigOption,
438  double cutValue) {
439  Int_t w = 600;
440  Int_t h = 600;
441  if (fDrawSignificance) w = 1200;
442  TCanvas* c = fHM->CreateCanvas(
443  ("lmvm_" + hName).c_str(), ("lmvm_" + hName).c_str(), w, h);
444  if (fDrawSignificance) {
445  c->Divide(2, 1);
446  c->cd(1);
447  }
448  Draw1DSourceTypes(hName);
449  if (cutValue != -999999.) {
450  TLine* cutLine = new TLine(cutValue, 0.0, cutValue, 1.0);
451  cutLine->SetLineWidth(2);
452  cutLine->Draw();
453  }
454  if (fDrawSignificance) {
455  c->cd(2);
456  string sName = hName + "_" + CbmLmvmHist::fSourceTypes[kSignal];
457  string bgName = hName + "_" + CbmLmvmHist::fSourceTypes[kBg];
458  TH1D* sign = CreateSignificanceH1D(
459  H1(sName), H1(bgName), hName + "_significance", sigOption);
460  DrawH1(sign);
461  }
462 }
463 
465  Draw1DCut("fh_richann",
466  "left",
467  CbmLitGlobalElectronId::GetInstance().GetRichAnnCut());
468  Draw1DCut(
469  "fh_trdann", "left", CbmLitGlobalElectronId::GetInstance().GetTrdAnnCut());
470  Draw2DCut("fh_tofm2");
471 
472  Draw1DCut("fh_chi2prim", "right", fCuts.fChiPrimCut);
473  Draw1DCut("fh_pt", "left", fCuts.fPtCut);
474  Draw1DCut("fh_mom", "left");
475  Draw1DCut("fh_chi2sts", "right");
476 
477  Draw2DCut("fh_stcut", fCuts.fStCutPP, fCuts.fStCutAngle);
478  Draw2DCut("fh_ttcut", fCuts.fTtCutPP, fCuts.fTtCutAngle);
479  Draw2DCut("fh_rtcut", fCuts.fRtCutPP, fCuts.fRtCutAngle);
480 
481  Draw2DCut("fh_stcut_pion", fCuts.fStCutPP, fCuts.fStCutAngle);
482  Draw2DCut("fh_ttcut_pion", fCuts.fTtCutPP, fCuts.fTtCutAngle);
483  Draw2DCut("fh_rtcut_pion", fCuts.fRtCutPP, fCuts.fRtCutAngle);
484  Draw2DCut("fh_stcut_truepair", fCuts.fStCutPP, fCuts.fStCutAngle);
485  Draw2DCut("fh_ttcut_truepair", fCuts.fTtCutPP, fCuts.fTtCutAngle);
486  Draw2DCut("fh_rtcut_truepair", fCuts.fRtCutPP, fCuts.fRtCutAngle);
487 
488  /* TH2D* st = H2("fh_stcut_signal");
489  double sumT = 0.;
490  double sumAll = 0;
491  for (int x = 1; x <= st->GetNbinsX(); x++){
492  for (int y = 1; y <= st->GetNbinsY(); y++){
493  double c = st->GetBinContent(x, y);
494  double xc = (st->GetXaxis()->GetBinLowEdge(x) + st->GetXaxis()->GetBinUpEdge(x))/2.0;
495  double yc = (st->GetYaxis()->GetBinLowEdge(y) + st->GetXaxis()->GetBinUpEdge(y))/2.0;
496 
497  Double_t val = -1.*(fStCutAngle/fStCutPP)*xc + fStCutAngle;
498  if ( (xc < fStCutPP && val > yc) ) {
499  // Double_t val = -1.*(fTtCutAngle/fTtCutPP)*xc + fTtCutAngle;
500  // if ( (xc < fTtCutPP && val > yc) ) {
501  sumT += c;
502  }
503  sumAll += c;
504  }
505  }
506  cout << endl << endl << endl << "sumT/sumAll = " << 100*sumT/sumAll << endl;
507 */
508 
509  if (fUseMvd) {
510  Draw2DCut("fh_mvd1cut", fCuts.fMvd1CutD, fCuts.fMvd1CutP);
511  Draw2DCut("fh_mvd2cut", fCuts.fMvd2CutD, fCuts.fMvd2CutP);
512  }
513 }
514 
516  bool inPercent,
517  bool drawAnaStep) {
518  TH2D* h =
519  (TH2D*) H2("fh_source_pairs_epem_" + CbmLmvmHist::fAnaSteps[step])->Clone();
520  gStyle->SetPaintTextFormat("4.1f");
521  string labels[3] = {"#gamma", "#pi^{0}", "oth"};
522  for (Int_t i = 1; i <= 3; i++) {
523  h->GetYaxis()->SetBinLabel(i, labels[i - 1].c_str());
524  h->GetXaxis()->SetBinLabel(i, labels[i - 1].c_str());
525  }
526  //h->SetMarkerColor(0);
527  h->SetMarkerSize(3);
528  if (inPercent) {
529  h->Scale(100. / h->Integral());
530  h->GetZaxis()->SetTitle("[%]");
531  } else {
532  h->Scale(1000.);
533  h->GetZaxis()->SetTitle("Number of pairs/event x10^{3}");
534  }
535  DrawH2(h, kLinear, kLinear, kLinear, "text COLZ");
536  h->GetXaxis()->SetLabelSize(0.1);
537  h->GetYaxis()->SetLabelSize(0.1);
538  if (drawAnaStep)
539  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.50, 0.90, 0.70, 0.99);
540 }
541 
543  Int_t hi = 1;
544  TCanvas* c1 = fHM->CreateCanvas("lmvm_bg_sources_pairs_epem_abs",
545  "lmvm_bg_sources_pairs_epem_abs",
546  900,
547  900);
548  c1->Divide(3, 3);
549  for (int step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
550  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
551  c1->cd(hi++);
552  DrawSourcesBgPairsEpEm(step, false);
553  }
554 
555  hi = 1;
556  TCanvas* c2 = fHM->CreateCanvas("lmvm_bg_sources_pairs_epem_percent",
557  "lmvm_bg_sources_pairs_epem_percent",
558  900,
559  900);
560  c2->Divide(3, 3);
561  for (int step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
562  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
563  c2->cd(hi++);
564  DrawSourcesBgPairsEpEm(step, true);
565  }
566 
567  //Draw pair source histogram for the las step (ptcut)
568  fHM->CreateCanvas(
569  "lmvm_bg_sources_pairs_epem_abs_" + CbmLmvmHist::fAnaSteps[kPtCut],
570  "lmvm_bg_sources_pairs_epem_abs_" + CbmLmvmHist::fAnaSteps[kPtCut],
571  600,
572  600);
573  DrawSourcesBgPairsEpEm(kPtCut, false, false);
574 
575  fHM->CreateCanvas(
576  "lmvm_bg_sources_pairs_epem_percent_" + CbmLmvmHist::fAnaSteps[kPtCut],
577  "lmvm_bg_sources_pairs_epem_percent_" + CbmLmvmHist::fAnaSteps[kPtCut],
578  600,
579  600);
580  DrawSourcesBgPairsEpEm(kPtCut, true, false);
581 
582  // Draw 2D histogram for sources of BG pairs
583  DrawBgSource2D("lmvm_source_pairs_2d",
584  "fh_source_pairs",
586  1000.,
587  "Pairs per event x10^{3}");
588 }
589 
590 void CbmAnaDielectronTaskDraw::Draw2DCutTriangle(double xCross, double yCross) {
591  if (xCross == -999999. || yCross == -999999.) return;
592  TLine* line1 = new TLine(0., 0., xCross, 0.);
593  line1->SetLineWidth(2.);
594  line1->Draw();
595  TLine* line2 = new TLine(0., 0., 0., yCross);
596  line2->SetLineWidth(2.);
597  line2->Draw();
598  TLine* line3 = new TLine(xCross, 0., 0., yCross);
599  line3->SetLineWidth(2.);
600  line3->Draw();
601 }
602 
603 
604 void CbmAnaDielectronTaskDraw::Draw2DCut(const string& hist,
605  double cutCrossX,
606  double cutCrossY) {
607  TCanvas* c = fHM->CreateCanvas(
608  ("lmvm_" + hist).c_str(), ("lmvm_" + hist).c_str(), 600, 900);
609  c->Divide(2, 3);
610  vector<TH1*> projX, projY;
611  for (int i = 0; i < CbmLmvmHist::fNofSourceTypes; i++) {
612  c->cd(i + 1);
613  DrawH2(H2(hist + "_" + CbmLmvmHist::fSourceTypes[i]));
614  double nofPerEvent =
615  H2(hist + "_" + CbmLmvmHist::fSourceTypes[i])->GetEntries()
616  / (double) fNofEvents;
617  cout << hist << "_" << CbmLmvmHist::fSourceTypes[i] << " = " << nofPerEvent
618  << endl;
620  (Cbm::NumberToString(nofPerEvent, 2) + "/ev."), 0.1, 0.9, 0.5, 0.99);
621  DrawTextOnPad(CbmLmvmHist::fSourceTypesLatex[i], 0.6, 0.89, 0.7, 0.99);
622  Draw2DCutTriangle(cutCrossX, cutCrossY);
623  projX.push_back(
624  H2(hist + "_" + CbmLmvmHist::fSourceTypes[i])->ProjectionX());
625  projY.push_back(
626  H2(hist + "_" + CbmLmvmHist::fSourceTypes[i])->ProjectionY());
627  }
628 
629  //Draw X projection
630  c->cd(5);
631  DrawH1(projX,
633  kLinear,
634  kLog,
635  true,
636  0.8,
637  0.8,
638  0.99,
639  0.99);
640 
641  //Draw Y projection
642  c->cd(6);
643  DrawH1(projY,
645  kLinear,
646  kLog,
647  true,
648  0.8,
649  0.8,
650  0.99,
651  0.99);
652 
653  fHM->CreateCanvas(("lmvm_" + hist + "_signal").c_str(),
654  ("lmvm_" + hist + "_signal").c_str(),
655  800,
656  800);
657  DrawH2(H2(hist + "_" + CbmLmvmHist::fSourceTypes[kSignal]));
658  Draw2DCutTriangle(cutCrossX, cutCrossY);
659  fHM->CreateCanvas(("lmvm_" + hist + "_gamma").c_str(),
660  ("lmvm_" + hist + "_gamma").c_str(),
661  800,
662  800);
663  DrawH2(H2(hist + "_" + CbmLmvmHist::fSourceTypes[kGamma]));
664  Draw2DCutTriangle(cutCrossX, cutCrossY);
665  //c->cd(9);
666  //TH2D* fh_significance = CalculateSignificance2D(fh_stcut_signal, fh_stcut_bg, "stcut_2dsignificance", "significance");
667  //fh_significance->Draw("COLZ");
668 }
669 
671  TH2D* xz = H2("fh_vertex_el_gamma_xz_mc");
672  TH2D* yz = H2("fh_vertex_el_gamma_yz_mc");
673  TH2D* xy = H2("fh_vertex_el_gamma_xy_mc");
674  TCanvas* c = fHM->CreateCanvas(
675  "lmvm_vertex_el_gamma_mc", "lmvm_vertex_el_gamma_mc", 1200, 400);
676  c->Divide(3, 1);
677  c->cd(1);
678  DrawH2(xz);
679  xz->SetMinimum(1e-3);
680  gPad->SetLogz(true);
681  c->cd(2);
682  DrawH2(yz);
683  yz->SetMinimum(1e-3);
684  gPad->SetLogz(true);
685  c->cd(3);
686  DrawH2(xy);
687  xy->SetMinimum(1e-3);
688  gPad->SetLogz(true);
689 
690  // number of e+- from gamma vs Z.
691  fHM->CreateCanvas(
692  "lmvm_vertex_el_gamma_z_mc", "lmvm_vertex_el_gamma_z_mc", 600, 600);
693  TH1D* zProj = (TH1D*) xz->ProjectionX("fh_vertex_el_gamma_pz_mc")->Clone();
694  zProj->GetYaxis()->SetTitle("Counter per event");
695  zProj->GetXaxis()->SetRangeUser(-2., 17.);
696  DrawH1(zProj);
697 
698  fHM->CreateCanvas(
699  "lmvm_vertex_el_gamma_z_ptcut", "lmvm_vertex_el_gamma_z_ptcut", 600, 600);
700  TH1D* zProjPtCut = (TH1D*) (H2("fh_vertex_el_gamma_xz_ptcut")
701  ->ProjectionX("fh_vertex_el_gamma_ptcut_pz")
702  ->Clone());
703  zProjPtCut->GetYaxis()->SetTitle("Counter per event");
704  zProjPtCut->GetXaxis()->SetRangeUser(-2., 17.);
705  DrawH1(zProjPtCut);
706 
707  TH2D* xzZoom = (TH2D*) xz->Clone();
708  TH2D* yzZoom = (TH2D*) yz->Clone();
709  TH2D* xyZoom = (TH2D*) xy->Clone();
710  TCanvas* cZoom = fHM->CreateCanvas("lmvm_vertex_el_gamma_mc_target_zoom",
711  "lmvm_vertex_el_gamma_mc_target_zoom",
712  1200,
713  400);
714  cZoom->Divide(3, 1);
715  cZoom->cd(1);
716  xzZoom->GetXaxis()->SetRangeUser(-1., 11.);
717  xzZoom->GetYaxis()->SetRangeUser(-10., 10.);
718  DrawH2(xzZoom);
719  xzZoom->SetMinimum(1e-3);
720  gPad->SetLogz(true);
721  cZoom->cd(2);
722  yzZoom->GetXaxis()->SetRangeUser(-1., 11.);
723  yzZoom->GetYaxis()->SetRangeUser(-10., 10.);
724  DrawH2(yzZoom);
725  yzZoom->SetMinimum(1e-3);
726  gPad->SetLogz(true);
727  cZoom->cd(3);
728  xyZoom->GetXaxis()->SetRangeUser(-20., 20.);
729  xyZoom->GetYaxis()->SetRangeUser(-20., 20.);
730  DrawH2(xyZoom);
731  xyZoom->SetMinimum(1e-3);
732  gPad->SetLogz(true);
733 
734  fHM->CreateCanvas(
735  "lmvm_vertex_el_gamma_rz_mc", "lmvm_vertex_el_gamma_rz_mc", 600, 600);
736  DrawH2(H2("fh_vertex_el_gamma_rz_mc"));
737  H2("fh_vertex_el_gamma_rz_mc")->SetMinimum(1e-3);
738  gPad->SetLogz(true);
739 }
740 
742  const string& hist,
743  Bool_t logy) {
744  string drOpt = ""; // First histogram will be drawn without options.
745  Double_t min = 9999999999.;
746  TH1D* firstHisto = NULL;
747  TLegend* leg = new TLegend(0.80, 0.32, 0.99, 0.99);
748  for (int step = 0; step < CbmLmvmHist::fNofAnaSteps; step++) {
749  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
750  string fullName = hist + "_" + CbmLmvmHist::fAnaSteps[step];
751  TH1D* h = H1(fullName);
752  if (h == NULL || h->GetEntries() <= 0) continue;
753  leg->AddEntry(h, CbmLmvmHist::fAnaStepsLatex[step].c_str(), "l");
754  int color = CbmLmvmHist::fAnaStepsColor[step];
755  DrawH1(h, kLinear, kLinear, drOpt, color);
756  if (firstHisto == NULL) firstHisto = h;
757  drOpt =
758  "same"; // If the histogram is drawn, next histograms must be drawn with "same" option.
759  if (min > h->GetMinimum()) { min = h->GetMinimum(); }
760  }
761  if (min <= 0.0) min = 1e-9;
762  if (firstHisto != NULL) firstHisto->SetMinimum(min);
763 
764  leg->SetFillColor(kWhite);
765  leg->Draw();
766 
767  gPad->SetGridx(true);
768  gPad->SetGridy(true);
769  gPad->SetLogy(logy);
770 }
771 
773  TCanvas* c1 = fHM->CreateCanvas("lmvm_minv_for_each_analysis_step_s_bg",
774  "lmvm_minv_for_each_analysis_step_s_bg",
775  1200,
776  600);
777  c1->Divide(2, 1);
778  c1->cd(1);
779  Draw1DHistoForEachAnalysisStep("fh_signal_minv", true);
780  c1->cd(2);
781  Draw1DHistoForEachAnalysisStep("fh_bg_minv", true);
782 
783  TCanvas* c2 = fHM->CreateCanvas("lmvm_minv_for_each_analysis_step_pi0_eta",
784  "lmvm_minv_for_each_analysis_step_pi0_eta",
785  1200,
786  600);
787  c2->Divide(2, 1);
788  c2->cd(1);
789  Draw1DHistoForEachAnalysisStep("fh_pi0_minv", true);
790  c2->cd(2);
791  Draw1DHistoForEachAnalysisStep("fh_eta_minv", true);
792 
793  fHM->CreateCanvas("lmvm_minv_for_each_analysis_step_gamma",
794  "lmvm_minv_for_each_analysis_step_gamma",
795  600,
796  600);
797  // H1("fh_gamma_minv_mc")->GetXaxis()->SetRangeUser(0., 0.05);
798  Draw1DHistoForEachAnalysisStep("fh_gamma_minv", true);
799 }
800 
802  TH1* s1 = H1("fh_signal_minv_" + CbmLmvmHist::fAnaSteps[step]);
803  TH1* bg1 = H1("fh_bg_minv_" + CbmLmvmHist::fAnaSteps[step]);
804 
805  TH1D* s = (TH1D*) s1->Clone();
806  TH1D* bg = (TH1D*) bg1->Clone();
807  TH1D* sbg = (TH1D*) bg->Clone();
808  sbg->Add(s);
809  sbg->SetMinimum(1e-8);
810 
811  DrawH1(
812  {sbg, bg, s}, {"", "", ""}, kLinear, kLog, false, 0, 0, 0, 0, "Hist L");
813  s->SetFillColor(kRed);
814  s->SetLineColor(kBlack);
815  s->SetLineWidth(1);
816  s->SetLineStyle(CbmDrawingOptions::MarkerStyle(1));
817  bg->SetFillColor(kYellow - 10);
818  bg->SetLineColor(kBlack);
819  bg->SetLineWidth(2);
820  bg->SetLineStyle(CbmDrawingOptions::MarkerStyle(1));
821  sbg->SetFillColor(kBlue);
822  sbg->SetLineColor(kBlack);
823  sbg->SetLineWidth(1);
824  sbg->SetLineStyle(CbmDrawingOptions::MarkerStyle(1));
825  s->SetMarkerStyle(1);
826  bg->SetMarkerStyle(1);
827  sbg->SetMarkerStyle(1);
828 
829  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.65, 0.78, 0.85, 0.9);
830 }
831 
833  Int_t hi = 1;
834  TCanvas* c = fHM->CreateCanvas(
835  "lmvm_minv_both_s_and_bg", "lmvm_minv_both_s_and_bg", 900, 900);
836  c->Divide(3, 3);
837  for (int step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
838  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
839  c->cd(hi++);
840  DrawMinvSandBg(step);
841  }
842 
843  fHM->CreateCanvas(
844  "lmvm_minv_both_s_and_bg_ptcut", "lmvm_minv_both_s_and_bg_ptcut", 900, 900);
846 }
847 
848 void CbmAnaDielectronTaskDraw::DrawMinvSource(int step, bool drawAnaStep) {
849  double nofBg = H1("fh_bg_minv_" + CbmLmvmHist::fAnaSteps[step])->GetEntries();
850 
851  vector<TH1*> hists;
852  for (int i = 0; i < CbmLmvmHist::fNofBgPairSources; i++) {
853  stringstream ss;
854  ss << "fh_source_bg_minv_" << i << "_" << CbmLmvmHist::fAnaSteps[step];
855  H1(ss.str())->GetXaxis()->SetRangeUser(0, 2.);
856  hists.push_back(H1(ss.str()));
857  }
858 
859  DrawH1(hists,
861  kLinear,
862  kLinear,
863  false,
864  0.85,
865  0.15,
866  0.99,
867  0.80);
868 
869  TLegend* legend = new TLegend(0.78, 0.15, 0.99, 0.90);
870  for (int i = 0; i < CbmLmvmHist::fNofBgPairSources; i++) {
871  hists[i]->SetMinimum(1e-8);
872  legend->AddEntry(
873  hists[i],
875  + Cbm::NumberToString(100. * hists[i]->GetEntries() / nofBg, 1) + "%)")
876  .c_str(),
877  "f");
878  }
879  legend->SetFillColor(kWhite);
880  legend->Draw();
881  if (drawAnaStep)
882  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.65, 0.78, 0.85, 0.9);
883 }
884 
886  {
887  Int_t hi = 1;
888  TCanvas* c =
889  fHM->CreateCanvas("lmvm_minv_source", "lmvm_minv_source", 900, 900);
890  c->Divide(3, 3);
891  for (int step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
892  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
893  c->cd(hi++);
894  DrawMinvSource(step);
895  }
896 
897  // Draw histogram for the last step (ptcut) on one histogram
898  fHM->CreateCanvas("lmvm_minv_source_" + CbmLmvmHist::fAnaSteps[kPtCut],
899  "lmvm_minv_source_" + CbmLmvmHist::fAnaSteps[kPtCut],
900  600,
901  600);
902  DrawMinvSource(kPtCut, false);
903 
904  fHM->CreateCanvas("lmvm_minv_source_" + CbmLmvmHist::fAnaSteps[kElId],
905  "lmvm_minv_source_" + CbmLmvmHist::fAnaSteps[kElId],
906  600,
907  600);
908  DrawMinvSource(kElId, false);
909  }
910 
911  // Draw mismatches and true matches minv
912  {
913  Int_t hi = 1;
914  TCanvas* c = fHM->CreateCanvas(
915  "lmvm_minv_mismatches", "lmvm_minv_mismatches", 900, 900);
916  c->Divide(3, 3);
917  for (int step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
918  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
919  c->cd(hi++);
920  DrawH1({H1("fh_bg_truematch_minv_" + CbmLmvmHist::fAnaSteps[step]),
921  H1("fh_bg_truematch_el_minv_" + CbmLmvmHist::fAnaSteps[step]),
922  H1("fh_bg_truematch_notel_minv_" + CbmLmvmHist::fAnaSteps[step]),
923  H1("fh_bg_mismatch_minv_" + CbmLmvmHist::fAnaSteps[step])},
924  {"true match",
925  "true match (e^{#pm})",
926  "true match (not e^{#pm})",
927  "mismatch"},
928  kLinear,
929  kLinear,
930  true,
931  0.5,
932  0.7,
933  0.99,
934  0.99);
935  }
936 
937  // Draw minv after PtCut
938  double trueMatch =
939  H1("fh_bg_truematch_minv_" + CbmLmvmHist::fAnaSteps[kPtCut])
940  ->GetEntries();
941  double trueMatchEl =
942  H1("fh_bg_truematch_el_minv_" + CbmLmvmHist::fAnaSteps[kPtCut])
943  ->GetEntries();
944  double trueMatchNotEl =
945  H1("fh_bg_truematch_notel_minv_" + CbmLmvmHist::fAnaSteps[kPtCut])
946  ->GetEntries();
947  double misMatch =
948  H1("fh_bg_mismatch_minv_" + CbmLmvmHist::fAnaSteps[kPtCut])->GetEntries();
949  double nofBg =
950  H1("fh_bg_minv_" + CbmLmvmHist::fAnaSteps[kPtCut])->GetEntries();
951 
952  fHM->CreateCanvas("lmvm_minv_mismatches_" + CbmLmvmHist::fAnaSteps[kPtCut],
953  "lmvm_minv_mismatches_" + CbmLmvmHist::fAnaSteps[kPtCut],
954  700,
955  700);
956  DrawH1(
957  {H1("fh_bg_truematch_minv_" + CbmLmvmHist::fAnaSteps[kPtCut]),
958  H1("fh_bg_truematch_el_minv_" + CbmLmvmHist::fAnaSteps[kPtCut]),
959  H1("fh_bg_truematch_notel_minv_" + CbmLmvmHist::fAnaSteps[kPtCut]),
960  H1("fh_bg_mismatch_minv_" + CbmLmvmHist::fAnaSteps[kPtCut])},
961  {"true match (" + Cbm::NumberToString(100. * trueMatch / nofBg, 1) + "%)",
962  "true match (e^{#pm}) ("
963  + Cbm::NumberToString(100. * trueMatchEl / nofBg, 1) + "%)",
964  "true match (not e^{#pm}) ("
965  + Cbm::NumberToString(100. * trueMatchNotEl / nofBg, 1) + "%)",
966  "mismatch (" + Cbm::NumberToString(100. * misMatch / nofBg) + "%)"},
967  kLinear,
968  kLinear,
969  true,
970  0.4,
971  0.7,
972  0.99,
973  0.99);
974  }
975 }
976 
978  double binWEl = H1("fh_pi_mom_mc")->GetBinWidth(1);
979 
980  fHM->CreateCanvas("lmvm_pi_mom", "lmvm_pi_mom", 800, 800);
981  H1("fh_pi_mom_mc")->Scale(1 / binWEl);
982  H1("fh_pi_mom_acc")->Scale(1 / binWEl);
983  H1("fh_pi_mom_rec")->Scale(1 / binWEl);
984  H1("fh_pi_mom_rec_only_sts")->Scale(1 / binWEl);
985  H1("fh_pi_mom_rec_sts_rich_trd")->Scale(1 / binWEl);
986  H1("fh_pi_mom_rec_sts_rich_trd_tof")->Scale(1 / binWEl);
987  H1("fh_pi_mom_mc")->SetMinimum(2);
988 
989  DrawH1(
990  {H1("fh_pi_mom_mc"),
991  H1("fh_pi_mom_acc"),
992  H1("fh_pi_mom_rec"),
993  H1("fh_pi_mom_rec_only_sts"),
994  H1("fh_pi_mom_rec_sts_rich_trd"),
995  H1("fh_pi_mom_rec_sts_rich_trd_tof")},
996  {"MC ("
997  + Cbm::NumberToString(H1("fh_pi_mom_mc")->GetEntries() / fNofEvents, 2)
998  + " per event)",
999  "Acc ("
1000  + Cbm::NumberToString(H1("fh_pi_mom_acc")->GetEntries() / fNofEvents, 2)
1001  + " per event)",
1002  "Rec ("
1003  + Cbm::NumberToString(H1("fh_pi_mom_rec")->GetEntries() / fNofEvents, 2)
1004  + " per event)",
1005  "Rec only STS ("
1007  H1("fh_pi_mom_rec_only_sts")->GetEntries() / fNofEvents, 2)
1008  + " per event)",
1009  "Rec STS-RICH-TRD ("
1011  H1("fh_pi_mom_rec_sts_rich_trd")->GetEntries() / fNofEvents, 2)
1012  + " per event)",
1013  "Rec STS-RICH-TRD-TOF ("
1015  H1("fh_pi_mom_rec_sts_rich_trd_tof")->GetEntries() / fNofEvents, 2)
1016  + " per event)"},
1017  kLinear,
1018  kLog,
1019  true,
1020  0.1,
1021  0.7,
1022  0.99,
1023  0.99);
1024 
1025  //primary pions vertex < 0.1 cm
1026  double binWElPrim = H1("fh_piprim_mom_mc")->GetBinWidth(1);
1027  fHM->CreateCanvas("lmvm_piprim_mom", "lmvm_piprim_mom", 800, 800);
1028  H1("fh_piprim_mom_mc")->Scale(1 / binWElPrim);
1029  H1("fh_piprim_mom_acc")->Scale(1 / binWElPrim);
1030  H1("fh_piprim_mom_rec")->Scale(1 / binWElPrim);
1031  H1("fh_piprim_mom_rec_only_sts")->Scale(1 / binWElPrim);
1032  H1("fh_piprim_mom_rec_sts_rich_trd")->Scale(1 / binWElPrim);
1033  H1("fh_piprim_mom_rec_sts_rich_trd_tof")->Scale(1 / binWElPrim);
1034  H1("fh_piprim_mom_mc")->SetMinimum(2);
1035  DrawH1(
1036  {H1("fh_piprim_mom_mc"),
1037  H1("fh_piprim_mom_acc"),
1038  H1("fh_piprim_mom_rec"),
1039  H1("fh_piprim_mom_rec_only_sts"),
1040  H1("fh_piprim_mom_rec_sts_rich_trd"),
1041  H1("fh_piprim_mom_rec_sts_rich_trd_tof")},
1042  {"MC ("
1043  + Cbm::NumberToString(H1("fh_piprim_mom_mc")->GetEntries() / fNofEvents,
1044  2)
1045  + " per event)",
1046  "Acc ("
1047  + Cbm::NumberToString(H1("fh_piprim_mom_acc")->GetEntries() / fNofEvents,
1048  2)
1049  + " per event)",
1050  "Rec ("
1051  + Cbm::NumberToString(H1("fh_piprim_mom_rec")->GetEntries() / fNofEvents,
1052  2)
1053  + " per event)",
1054  "Rec only STS ("
1056  H1("fh_piprim_mom_rec_only_sts")->GetEntries() / fNofEvents, 2)
1057  + " per event)",
1058  "Rec STS-RICH-TRD ("
1060  H1("fh_piprim_mom_rec_sts_rich_trd")->GetEntries() / fNofEvents, 2)
1061  + " per event)",
1062  "Rec STS-RICH-TRD-TOF ("
1064  H1("fh_piprim_mom_rec_sts_rich_trd_tof")->GetEntries() / fNofEvents, 2)
1065  + " per event)"},
1066  kLinear,
1067  kLog,
1068  true,
1069  0.1,
1070  0.7,
1071  0.99,
1072  0.99);
1073 
1074  fHM->CreateCanvas("lmvm_pi_mom_notacc", "lmvm_pi_mom_notacc", 800, 800);
1075  TH1D* h1 = ((TH1D*) H1("fh_pi_mom_mc")->Clone());
1076  h1->Add(H1("fh_pi_mom_acc"), -1.);
1077  DrawH1(h1);
1078  fHM->CreateCanvas(
1079  "lmvm_piprim_mom_notacc", "lmvm_piprim_mom_notacc", 800, 800);
1080  TH1D* h2 = ((TH1D*) H1("fh_piprim_mom_mc")->Clone());
1081  h2->Add(H1("fh_piprim_mom_acc"), -1.);
1082  DrawH1(h2);
1083  DrawH1(h2);
1084 
1085  cout << "Number of primary pions minus at rapidity 2 = "
1086  << H1("fh_piprim_minus_rapidity_mc")
1087  ->GetBinContent(H1("fh_piprim_minus_rapidity_mc")->FindFixBin(2))
1088  << endl;
1089  cout << "Number of primary pions minus at rapidity (1, 3) = "
1090  << H1("fh_piprim_minus_rapidity_mc")
1091  ->Integral(H1("fh_piprim_minus_rapidity_mc")->FindFixBin(1),
1092  H1("fh_piprim_minus_rapidity_mc")->FindFixBin(3))
1093  << endl;
1094 
1095  cout << "Number of primary pions plus at rapidity 2 = "
1096  << H1("fh_piprim_plus_rapidity_mc")
1097  ->GetBinContent(H1("fh_piprim_plus_rapidity_mc")->FindFixBin(2))
1098  << endl;
1099  cout << "Number of primary pions plus at rapidity (1, 3) = "
1100  << H1("fh_piprim_plus_rapidity_mc")
1101  ->Integral(H1("fh_piprim_plus_rapidity_mc")->FindFixBin(1),
1102  H1("fh_piprim_plus_rapidity_mc")->FindFixBin(3))
1103  << endl;
1104 
1105 
1106  double binWRapidity = H1("fh_piprim_minus_rapidity_mc")->GetBinWidth(1);
1107  H1("fh_pi_rapidity_mc")->Scale(1 / binWRapidity);
1108  H1("fh_piprim_minus_rapidity_mc")->Scale(1 / binWRapidity);
1109  H1("fh_piprim_plus_rapidity_mc")->Scale(1 / binWRapidity);
1110  H1("fh_pi0prim_rapidity_mc")->Scale(1 / binWRapidity);
1111  H1("fh_etaprim_rapidity_mc")->Scale(1 / binWRapidity);
1112 
1113  fHM->CreateCanvas(
1114  "lmvm_piprim_plus_rapidity", "lmvm_piprim_plus_rapidity", 800, 800);
1115  DrawH1(H1("fh_piprim_plus_rapidity_mc"));
1116  fHM->CreateCanvas(
1117  "lmvm_piprim_minus_rapidity", "lmvm_piprim_minus_rapidity", 800, 800);
1118  DrawH1(H1("fh_piprim_minus_rapidity_mc"));
1119  fHM->CreateCanvas("lmvm_pi0prim_rapidity", "lmvm_pi0prim_rapidity", 800, 800);
1120  DrawH1(H1("fh_pi0prim_rapidity_mc"));
1121  fHM->CreateCanvas("lmvm_etaprim_rapidity", "lmvm_etaprim_rapidity", 800, 800);
1122  DrawH1(H1("fh_etaprim_rapidity_mc"));
1123 }
1124 
1126  for (int step = kMvd2Cut + 1 + 1; step < CbmLmvmHist::fNofAnaSteps + 1;
1127  step++) {
1128  H1("fh_nof_bg_tracks")
1129  ->SetBinContent(step - 2, H1("fh_nof_bg_tracks")->GetBinContent(step));
1130  H1("fh_nof_el_tracks")
1131  ->SetBinContent(step - 2, H1("fh_nof_el_tracks")->GetBinContent(step));
1132 
1133  H1("fh_nof_mismatches")
1134  ->SetBinContent(step - 2, H1("fh_nof_mismatches")->GetBinContent(step));
1135  H1("fh_nof_ghosts")
1136  ->SetBinContent(step - 2, H1("fh_nof_ghosts")->GetBinContent(step));
1137 
1138  int ny = H2("fh_source_tracks")->GetYaxis()->GetNbins();
1139  for (int y = 1; y <= ny; y++) {
1140  H2("fh_source_tracks")
1141  ->SetBinContent(
1142  step - 2, y, H2("fh_source_tracks")->GetBinContent(step, y));
1143  }
1144 
1145  ny = H2("fh_source_pairs")->GetYaxis()->GetNbins();
1146  for (int y = 1; y <= ny; y++) {
1147  H2("fh_source_pairs")
1148  ->SetBinContent(
1149  step - 2, y, H2("fh_source_pairs")->GetBinContent(step, y));
1150  }
1151  }
1152 }
1153 
1154 void CbmAnaDielectronTaskDraw::DrawBgSource2D(const string& canvasName,
1155  const string& histName,
1156  const vector<string>& yLabels,
1157  double scale,
1158  const string& zTitle) {
1159  int rangeMax = CbmLmvmHist::fNofAnaSteps;
1160  if (!fUseMvd) { rangeMax = CbmLmvmHist::fNofAnaSteps - 2; }
1161 
1162  fHM->CreateCanvas(string(canvasName + "_abs").c_str(),
1163  string(canvasName + "_abs").c_str(),
1164  900,
1165  600);
1166  TH2D* habs = (TH2D*) H2(histName)->Clone();
1167  habs->SetStats(false);
1168  habs->Scale(scale);
1169  habs->GetZaxis()->SetTitle(zTitle.c_str());
1170  habs->GetXaxis()->SetRange(kReco + 1, rangeMax);
1171  habs->SetMarkerSize(1.4);
1172  DrawH2(habs, kLinear, kLinear, kLog, "text COLZ");
1173 
1174  fHM->CreateCanvas(string(canvasName + "_percent").c_str(),
1175  string(canvasName + "_percent").c_str(),
1176  900,
1177  600);
1178  TH2D* hperc = (TH2D*) H2(histName)->Clone();
1179  hperc->SetStats(false);
1180  Int_t nBinsX = hperc->GetNbinsX();
1181  Int_t nBinsY = hperc->GetNbinsY();
1182  for (Int_t x = 1; x <= nBinsX; x++) {
1183  // calculate total number of BG tracks (pairs) for a current step
1184  double nbg = 0.;
1185  for (Int_t y = 1; y <= nBinsY; y++) {
1186  nbg += habs->GetBinContent(x, y);
1187  }
1188  Double_t sc = 100. / (nbg / scale);
1189  for (Int_t y = 1; y <= nBinsY; y++) {
1190  Double_t val = sc * hperc->GetBinContent(x, y);
1191  hperc->SetBinContent(x, y, val);
1192  }
1193  }
1194  hperc->GetZaxis()->SetTitle("[%]");
1195  hperc->GetXaxis()->SetLabelSize(0.06);
1196  hperc->GetYaxis()->SetLabelSize(0.06);
1197  hperc->SetMarkerColor(kBlack);
1198  hperc->SetMarkerSize(1.8);
1199  hperc->GetXaxis()->SetRange(kReco + 1, rangeMax);
1200  DrawH2(hperc, kLinear, kLinear, kLinear, "text COLZ");
1201 
1202  for (UInt_t y = 1; y <= yLabels.size(); y++) {
1203  hperc->GetYaxis()->SetBinLabel(y, yLabels[y - 1].c_str());
1204  habs->GetYaxis()->SetBinLabel(y, yLabels[y - 1].c_str());
1205  }
1206 
1207  SetAnalysisStepLabels(hperc);
1208  SetAnalysisStepLabels(habs);
1209 }
1210 
1212  gStyle->SetPaintTextFormat("4.1f");
1213 
1214  int rangeMax = CbmLmvmHist::fNofAnaSteps;
1215  if (!fUseMvd) { rangeMax = CbmLmvmHist::fNofAnaSteps - 2; }
1216 
1217  fHM->CreateCanvas("lmvm_nof_bg_tracks", "lmvm_nof_bg_tracks", 600, 600);
1218  TH1D* hbg = (TH1D*) H1("fh_nof_bg_tracks")->Clone();
1219  hbg->Scale(10);
1220  hbg->GetYaxis()->SetTitle("Tracks/event x10");
1221  hbg->GetXaxis()->SetRange(kReco + 1, rangeMax);
1222  DrawH1(hbg, kLinear, kLog, "hist text0");
1223  hbg->SetMarkerSize(2.);
1224 
1225  fHM->CreateCanvas("lmvm_nof_el_tracks", "lmvm_nof_el_tracks", 600, 600);
1226  TH1D* hel = H1("fh_nof_el_tracks");
1227  hel->GetXaxis()->SetRange(kReco + 1, rangeMax);
1228  DrawH1(hel, kLinear, kLog);
1229 
1230  fHM->CreateCanvas("lmvm_purity", "lmvm_purity", 600, 600);
1231  TH1D* purity = new TH1D("purity",
1232  "purity;Analysis steps;Purity",
1234  0.,
1236  purity->Divide(H1("fh_nof_bg_tracks"), H1("fh_nof_el_tracks"));
1237  purity->GetXaxis()->SetRange(kReco + 1, rangeMax);
1238  DrawH1(purity, kLinear, kLog, "hist text30");
1239  purity->SetMarkerSize(1.9);
1240 
1241  SetAnalysisStepLabels(hbg);
1242  SetAnalysisStepLabels(hel);
1243  SetAnalysisStepLabels(purity);
1244 
1246  "lmvm_source_tracks_2d",
1247  "fh_source_tracks",
1248  {"#gamma", "#pi^{0}", "#pi^{#pm}", "p", "K", "e^{#pm}_{sec}", "oth."},
1249  100.,
1250  "Tracks per event x10^{2}");
1251 
1252 
1253  fHM->CreateCanvas(
1254  "fh_nof_topology_pairs_gamma", "fh_nof_topology_pairs_gamma", 600, 600);
1255  TH1D* htopologyGamma = (TH1D*) H1("fh_nof_topology_pairs_gamma")->Clone();
1256  htopologyGamma->Scale(1. / htopologyGamma->Integral());
1257  DrawH1(htopologyGamma, kLinear, kLinear);
1258  htopologyGamma->SetMarkerSize(1.);
1259 
1260  fHM->CreateCanvas(
1261  "fh_nof_topology_pairs_pi0", "fh_nof_topology_pairs_pi0", 600, 600);
1262  TH1D* htopologyPi0 = (TH1D*) H1("fh_nof_topology_pairs_pi0")->Clone();
1263  htopologyPi0->Scale(1. / htopologyPi0->Integral());
1264  DrawH1(htopologyPi0, kLinear, kLinear);
1265  htopologyPi0->SetMarkerSize(1.);
1266 }
1267 
1269  gStyle->SetPaintTextFormat("4.1f");
1270 
1271  int rangeMax = CbmLmvmHist::fNofAnaSteps;
1272  if (!fUseMvd) { rangeMax = CbmLmvmHist::fNofAnaSteps - 2; }
1273 
1274  TCanvas* c1 =
1275  fHM->CreateCanvas("lmvm_nof_mismatches", "lmvm_nof_mismatches", 600, 600);
1276  c1->Divide(2, 2);
1277  c1->cd(1);
1278  TH1D* hmismatches = (TH1D*) H1("fh_nof_mismatches")->Clone();
1279  hmismatches->Scale(10);
1280  hmismatches->GetYaxis()->SetTitle("Mismatch tracks/event x10");
1281  hmismatches->GetXaxis()->SetRange(kReco + 1, rangeMax);
1282  DrawH1(hmismatches, kLinear, kLog, "hist text0");
1283 
1284  hmismatches->SetMarkerSize(2.);
1285  SetAnalysisStepLabels(hmismatches);
1286  c1->cd(2);
1287  TH1D* hmismatches_rich = (TH1D*) H1("fh_nof_mismatches_rich")->Clone();
1288  hmismatches_rich->Scale(10);
1289  hmismatches_rich->GetYaxis()->SetTitle("Mismatch tracks (RICH)/event x10");
1290  hmismatches_rich->GetXaxis()->SetRange(kReco + 1, rangeMax);
1291  DrawH1(hmismatches_rich, kLinear, kLog, "hist text0");
1292  hmismatches_rich->SetMarkerSize(2.);
1293  SetAnalysisStepLabels(hmismatches_rich);
1294  c1->cd(3);
1295  TH1D* hmismatches_trd = (TH1D*) H1("fh_nof_mismatches_trd")->Clone();
1296  hmismatches_trd->Scale(10);
1297  hmismatches_trd->GetYaxis()->SetTitle("Mismatch tracks (TRD)/event x10");
1298  hmismatches_trd->GetXaxis()->SetRange(kReco + 1, rangeMax);
1299  DrawH1(hmismatches_trd, kLinear, kLog, "hist text0");
1300  hmismatches_trd->SetMarkerSize(2.);
1301  SetAnalysisStepLabels(hmismatches_trd);
1302  c1->cd(4);
1303  TH1D* hmismatches_tof = (TH1D*) H1("fh_nof_mismatches")->Clone();
1304  hmismatches_tof->Scale(10);
1305  hmismatches_tof->GetYaxis()->SetTitle("Mismatch tracks (TOF)/event x10");
1306  hmismatches_tof->GetXaxis()->SetRange(kReco + 1, rangeMax);
1307  DrawH1(hmismatches_tof, kLinear, kLog, "hist text0");
1308  hmismatches_tof->SetMarkerSize(2.);
1309  SetAnalysisStepLabels(hmismatches_tof);
1310 
1311  fHM->CreateCanvas("lmvm_nof_ghosts", "lmvm_nof_ghosts", 600, 600);
1312  TH1D* hghosts = H1("fh_nof_ghosts");
1313  hghosts->GetXaxis()->SetRange(kReco + 1, rangeMax);
1314  DrawH1(hghosts, kLinear, kLog);
1315  SetAnalysisStepLabels(hghosts);
1316 }
1317 
1319  h->GetXaxis()->SetLabelSize(0.06);
1320  int x = 1;
1321  for (Int_t step = 0; step < CbmLmvmHist::fNofAnaSteps; step++) {
1322  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) { continue; }
1323  h->GetXaxis()->SetBinLabel(x, CbmLmvmHist::fAnaStepsLatex[step].c_str());
1324  x++;
1325  }
1326 }
1327 
1329  Int_t hi = 1;
1330  TCanvas* c = fHM->CreateCanvas(
1331  "lmvm_fh_signal_minv_pt", "lmvm_fh_signal_minv_pt", 750, 1000);
1332  c->Divide(3, 4);
1333  for (int step = 0; step < CbmLmvmHist::fNofAnaSteps; step++) {
1334  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
1335  c->cd(hi++);
1336 
1337  TH2D* h = H2("fh_signal_minv_pt_" + CbmLmvmHist::fAnaSteps[step]);
1338  DrawH2(h, kLinear, kLinear, kLinear, "COLZ");
1339  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.50, 0.78, 0.70, 0.9);
1340  }
1341 }
1342 
1344  fHM->CreateCanvas(
1345  "lmvm_source_mom_mc_signal", "lmvm_source_mom_mc_signal", 600, 600);
1346  DrawH1(H1("fh_source_mom_mc_signal"));
1347 
1348  int hi = 1;
1349  TCanvas* c1 =
1350  fHM->CreateCanvas("lmvm_source_mom", "lmvm_source_mom", 900, 900);
1351  c1->Divide(3, 3);
1352  for (Int_t step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
1353  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
1354  c1->cd(hi++);
1355  Draw1DSourceTypes("fh_source_mom_" + CbmLmvmHist::fAnaSteps[step], false);
1356  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.50, 0.90, 0.70, 0.99);
1357  }
1358  fHM->CreateCanvas("lmvm_source_mom_ttcut", "lmvm_source_mom_ttcut", 600, 600);
1359  Draw1DSourceTypes("fh_source_mom_" + CbmLmvmHist::fAnaSteps[kTtCut], false);
1360 
1361  hi = 1;
1362  TCanvas* c3 = fHM->CreateCanvas("lmvm_source_pt", "lmvm_source_pt", 900, 900);
1363  c3->Divide(3, 3);
1364  for (Int_t step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
1365  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
1366  c3->cd(hi++);
1367  Draw1DSourceTypes("fh_source_pt_" + CbmLmvmHist::fAnaSteps[step], false);
1368  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.50, 0.90, 0.70, 0.99);
1369  }
1370  fHM->CreateCanvas("lmvm_source_pt_ttcut", "lmvm_source_pt_ttcut", 600, 600);
1371  Draw1DSourceTypes("fh_source_pt_" + CbmLmvmHist::fAnaSteps[kTtCut], false);
1372 
1373  hi = 1;
1374  TCanvas* c2 =
1375  fHM->CreateCanvas("lmvm_opening_angle", "lmvm_opening_angle", 900, 900);
1376  c2->Divide(3, 3);
1377  for (Int_t step = kReco; step < CbmLmvmHist::fNofAnaSteps; step++) {
1378  //cout << "fh_opening_angle_" << step << endl;
1379  if (!fUseMvd && (step == kMvd1Cut || step == kMvd2Cut)) continue;
1380  c2->cd(hi++);
1381  Draw1DSourceTypes("fh_opening_angle_" + CbmLmvmHist::fAnaSteps[step]);
1382  DrawTextOnPad(CbmLmvmHist::fAnaStepsLatex[step], 0.50, 0.90, 0.70, 0.99);
1383  }
1384  fHM->CreateCanvas(
1385  "lmvm_opening_angle_ttcut", "lmvm_opening_angle_ttcut", 600, 600);
1386  Draw1DSourceTypes("fh_opening_angle_" + CbmLmvmHist::fAnaSteps[kTtCut],
1387  false);
1388 }
1389 
1391  if (fUseMvd) {
1392  fHM->CreateCanvas("lmvm_mvd1cut_qa", "lmvm_mvd1cut_qa", 600, 600);
1393  Draw1DSourceTypes("fh_mvd1cut_qa");
1394  TH1D* h1 = H1("fh_mvd1cut_qa_" + CbmLmvmHist::fSourceTypes[0]);
1395  h1->GetXaxis()->SetLabelSize(0.06);
1396  h1->GetXaxis()->SetBinLabel(1, "Correct");
1397  h1->GetXaxis()->SetBinLabel(2, "Wrong");
1398  gPad->SetLogy(false);
1399 
1400  fHM->CreateCanvas("lmvm_mvd2cut_qa", "lmvm_mvd2cut_qa", 600, 600);
1401  Draw1DSourceTypes("fh_mvd2cut_qa");
1402  TH1D* h2 = H1("fh_mvd2cut_qa_" + CbmLmvmHist::fSourceTypes[0]);
1403  h2->GetXaxis()->SetLabelSize(0.07);
1404  h2->GetXaxis()->SetBinLabel(1, "Correct");
1405  h2->GetXaxis()->SetBinLabel(2, "Wrong");
1406  gPad->SetLogy(false);
1407  }
1408 }
1409 
1411  if (!fUseMvd) return;
1412  TCanvas* c1 =
1413  fHM->CreateCanvas("lmvm_nofhits_mvd_sts", "lmvm_nofhits_mvd_sts", 900, 450);
1414  c1->Divide(2, 1);
1415  c1->cd(1);
1416  Draw1DSourceTypes("fh_nofMvdHits");
1417  c1->cd(2);
1418  Draw1DSourceTypes("fh_nofStsHits");
1419 
1420  Draw2DCut("fh_mvd1xy");
1421  fHM->CreateCanvas("lmvm_mvd1r", "lmvm_mvd1r", 600, 600);
1422  Draw1DSourceTypes("fh_mvd1r");
1423 
1424 
1425  Draw2DCut("fh_mvd2xy");
1426  fHM->CreateCanvas("lmvm_mvd2r", "lmvm_mvd2r", 600, 600);
1427  Draw1DSourceTypes("fh_mvd2r");
1428 }
1429 
1430 
1432  fHM->SaveCanvasToImage(fOutputDir, "png;eps");
1433 }
CbmAnaDielectronTaskDraw::fCuts
CbmLmvmCuts fCuts
Definition: CbmAnaDielectronTaskDraw.h:53
kMc
@ kMc
Definition: CbmLmvmHist.h:16
CbmAnaDielectronTaskDraw::fDrawSignificance
Bool_t fDrawSignificance
Definition: CbmAnaDielectronTaskDraw.h:51
CbmAnaDielectronTaskDraw::DrawPtYDistribution
void DrawPtYDistribution(int step, bool drawAnaStep=true)
Definition: CbmAnaDielectronTaskDraw.cxx:278
CbmAnaDielectronTaskDraw::DrawMismatchesAndGhosts
void DrawMismatchesAndGhosts()
Definition: CbmAnaDielectronTaskDraw.cxx:1268
h
Generates beam ions for transport simulation.
Definition: CbmBeamGenerator.h:17
CbmAnaDielectronTaskDraw::DrawMinvSourceAll
void DrawMinvSourceAll()
Definition: CbmAnaDielectronTaskDraw.cxx:885
CbmAnaDielectronTaskDraw::DrawMinvSandBgAll
void DrawMinvSandBgAll()
Definition: CbmAnaDielectronTaskDraw.cxx:832
kElId
@ kElId
Definition: CbmLmvmHist.h:20
CbmLmvmHist::fBgPairSourceLatex
static const std::vector< std::string > fBgPairSourceLatex
Definition: CbmLmvmHist.h:57
kTtCut
@ kTtCut
Definition: CbmLmvmHist.h:26
CbmAnaDielectronTaskDraw::DrawSourcesBgPairsEpEm
void DrawSourcesBgPairsEpEm(int step, bool inPercent, bool drawAnaStep=true)
Definition: CbmAnaDielectronTaskDraw.cxx:515
CbmAnaDielectronTaskDraw::DrawRapidityDistributionAll
void DrawRapidityDistributionAll()
Definition: CbmAnaDielectronTaskDraw.cxx:312
CbmHistManager::ScaleByPattern
void ScaleByPattern(const std::string &pattern, Double_t scale)
Scale histograms which name matches specified pattern.
Definition: core/base/CbmHistManager.cxx:221
CbmAnaDielectronTaskDraw::DrawPtYEfficiencyAll
void DrawPtYEfficiencyAll()
Definition: CbmAnaDielectronTaskDraw.cxx:342
CbmAnaDielectronTaskDraw::SOverBg
void SOverBg(CbmLmvmAnalysisSteps step)
Fit signal histogram using Fit("gaus"). Calculate S/BG ratio in 2 sigma region. Print summary table o...
Definition: CbmAnaDielectronTaskDraw.cxx:240
CbmAnaDielectronTaskDraw::Draw1DHistoForEachAnalysisStep
void Draw1DHistoForEachAnalysisStep(const std::string &hist, Bool_t logy=false)
Definition: CbmAnaDielectronTaskDraw.cxx:741
CbmAnaDielectronTaskDraw::RemoveMvdCutBins
void RemoveMvdCutBins()
Definition: CbmAnaDielectronTaskDraw.cxx:1125
CbmHistManager::ReadFromFile
void ReadFromFile(TFile *file)
Read histograms from file.
Definition: core/base/CbmHistManager.cxx:110
CbmLmvmHist::fNofAnaSteps
static const int fNofAnaSteps
Definition: CbmLmvmHist.h:49
CbmAnaDielectronTaskDraw::DrawMvdCutQa
void DrawMvdCutQa()
Definition: CbmAnaDielectronTaskDraw.cxx:1390
kPtCut
@ kPtCut
Definition: CbmLmvmHist.h:27
CbmAnaDielectronTaskDraw::CreateSignificanceH2D
TH2D * CreateSignificanceH2D(TH2D *signal, TH2D *bg, const std::string &name, const std::string &title)
Definition: CbmAnaDielectronTaskDraw.cxx:191
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmAnaDielectronTaskDraw::DrawBgSource2D
void DrawBgSource2D(const std::string &canvasName, const std::string &histName, const std::vector< std::string > &yLabels, double scale, const std::string &zTitle)
Definition: CbmAnaDielectronTaskDraw.cxx:1154
kBg
@ kBg
Definition: CbmLmvmHist.h:10
Cbm::DivideH2
TH2D * DivideH2(TH2 *h1, TH2 *h2, const string &histName, double scale, const string &titleZaxis)
Definition: CbmUtils.cxx:92
CbmHistManager::H2
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
Definition: CbmHistManager.h:190
CbmAnaDielectronTaskDraw::fNofEvents
Int_t fNofEvents
Definition: CbmAnaDielectronTaskDraw.h:47
CbmAnaDielectronTaskDraw::SOverBgAll
void SOverBgAll()
Definition: CbmAnaDielectronTaskDraw.cxx:265
CbmAnaDielectronTaskDraw::DrawElPiMomHis
void DrawElPiMomHis()
Definition: CbmAnaDielectronTaskDraw.cxx:977
CbmLmvmHist::fAnaStepsColor
static const std::vector< int > fAnaStepsColor
Definition: CbmLmvmHist.h:52
CbmAnaDielectronTaskDraw::DrawBgSourceTracks
void DrawBgSourceTracks()
Definition: CbmAnaDielectronTaskDraw.cxx:1211
CbmLmvmCuts::fTtCutAngle
Double_t fTtCutAngle
Definition: CbmLmvmCuts.h:116
CbmDrawHist.h
Helper functions for drawing 1D and 2D histograms and graphs.
CbmAnaDielectronTaskDraw::SaveCanvasToImage
void SaveCanvasToImage()
Save all created canvases to images.
Definition: CbmAnaDielectronTaskDraw.cxx:1431
CbmHistManager.h
Histogram manager.
CbmLmvmCuts::fChiPrimCut
Double_t fChiPrimCut
Definition: CbmLmvmCuts.h:110
CbmLmvmCuts::SetDefaultCuts
void SetDefaultCuts()
Definition: CbmLmvmCuts.h:39
CbmLmvmHist::fNofBgPairSources
static const int fNofBgPairSources
Definition: CbmLmvmHist.h:56
CbmLmvmCuts::fMvd2CutP
Double_t fMvd2CutP
Definition: CbmLmvmCuts.h:122
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmAnaDielectronTaskDraw::fUseMvd
Bool_t fUseMvd
Definition: CbmAnaDielectronTaskDraw.h:49
CbmLmvmHist::fAnaSteps
static const std::vector< std::string > fAnaSteps
Definition: CbmLmvmHist.h:50
CbmLmvmCuts::fRtCutAngle
Double_t fRtCutAngle
Definition: CbmLmvmCuts.h:118
CbmAnaDielectronTaskDraw::Draw1DCut
void Draw1DCut(const std::string &hName, const std::string &sigOption, double cutValue=-999999.)
Definition: CbmAnaDielectronTaskDraw.cxx:436
DrawTextOnPad
void DrawTextOnPad(const string &text, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: CbmDrawHist.cxx:253
CbmAnaDielectronTaskDraw::DrawMinvSandBg
void DrawMinvSandBg(int step)
Definition: CbmAnaDielectronTaskDraw.cxx:801
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
CbmLmvmCuts::fMvd1CutP
Double_t fMvd1CutP
Definition: CbmLmvmCuts.h:120
CbmAnaDielectronTaskDraw::SetAnalysisStepLabels
void SetAnalysisStepLabels(TH1 *h)
Set labels of X axis usinf analysis steps names.
Definition: CbmAnaDielectronTaskDraw.cxx:1318
CbmLmvmHist::fAnaStepsLatex
static const std::vector< std::string > fAnaStepsLatex
Definition: CbmLmvmHist.h:51
CbmAnaDielectronTaskDraw::H1
TH1D * H1(const std::string &name)
Return TH1D* pointer to the specified histogram.
Definition: CbmAnaDielectronTaskDraw.cxx:121
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmDrawingOptions::MarkerStyle
static Int_t MarkerStyle(Int_t markerIndex)
Definition: CbmDrawHist.h:58
CbmAnaDielectronTaskDraw::DrawEfficiencyOnHist
void DrawEfficiencyOnHist(TH1 *h1, TH1 *h2, Double_t xPos, Double_t yPos)
Draw an integrated efficiency on a histogram (100.*h1->GetEntries()/h2->GetEntries())....
Definition: CbmAnaDielectronTaskDraw.cxx:135
CbmLmvmCuts::fMvd2CutD
Double_t fMvd2CutD
Definition: CbmLmvmCuts.h:123
CbmAnaDielectronTaskDraw.h
kLinear
@ kLinear
Definition: CbmDrawHist.h:79
CbmAnaDielectronTaskDraw::DrawPPAngleMCSignal
void DrawPPAngleMCSignal()
Definition: CbmAnaDielectronTaskDraw.cxx:399
CbmAnaDielectronTaskDraw::DrawMvdAndStsHist
void DrawMvdAndStsHist()
Definition: CbmAnaDielectronTaskDraw.cxx:1410
CbmAnaDielectronTaskDraw::DrawMotherPdg
void DrawMotherPdg()
Definition: CbmAnaDielectronTaskDraw.cxx:386
CbmAnaDielectronTaskDraw::Draw2DCut
void Draw2DCut(const std::string &hist, double cutCrossX=-999999., double cutCrossY=-999999.)
Definition: CbmAnaDielectronTaskDraw.cxx:604
CbmLmvmHist::fSourceTypes
static const std::vector< std::string > fSourceTypes
Definition: CbmLmvmHist.h:45
CbmAnaDielectronTaskDraw::H2
TH2D * H2(const std::string &name)
Return TH2D* pointer to the specified histogram.
Definition: CbmAnaDielectronTaskDraw.cxx:131
CbmAnaDielectronTaskDraw::Draw1DSourceTypes
void Draw1DSourceTypes(const std::string &hName, bool doScale=true)
Definition: CbmAnaDielectronTaskDraw.cxx:421
CbmLmvmCuts::fMvd1CutD
Double_t fMvd1CutD
Definition: CbmLmvmCuts.h:121
CbmHistManager::H1
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
Definition: CbmHistManager.h:170
kGamma
@ kGamma
Definition: CbmLmvmHist.h:10
CbmLmvmCuts::fPtCut
Double_t fPtCut
Definition: CbmLmvmCuts.h:111
CbmUtils.h
CbmAnaDielectronTaskDraw::DrawMinvForEachAnalysisStep
void DrawMinvForEachAnalysisStep()
Definition: CbmAnaDielectronTaskDraw.cxx:772
CbmHistManager::CreateCanvas
TCanvas * CreateCanvas(const std::string &name, const std::string &title, Int_t width, Int_t height)
Create and draw TCanvas and store pointer to it.
Definition: core/base/CbmHistManager.cxx:267
kReco
@ kReco
Definition: CbmLmvmHist.h:18
CbmAnaDielectronTaskDraw::DrawSourcesBgPairsAll
void DrawSourcesBgPairsAll()
Definition: CbmAnaDielectronTaskDraw.cxx:542
CbmLmvmCuts::fRtCutPP
Double_t fRtCutPP
Definition: CbmLmvmCuts.h:119
CbmHistManager::SaveCanvasToImage
void SaveCanvasToImage(const std::string &outputDir, const std::string &options="png,eps")
Save all stored canvases to images.
Definition: core/base/CbmHistManager.cxx:276
kMvd1Cut
@ kMvd1Cut
Definition: CbmLmvmHist.h:22
CbmAnaDielectronTaskDraw::DrawMomentumEfficiencyAll
void DrawMomentumEfficiencyAll()
Definition: CbmAnaDielectronTaskDraw.cxx:366
CbmAnaDielectronTaskDraw::DrawBgSourcesVsMomentum
void DrawBgSourcesVsMomentum()
Definition: CbmAnaDielectronTaskDraw.cxx:1343
kMvd2Cut
@ kMvd2Cut
Definition: CbmLmvmHist.h:23
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmLmvmHist::fSourceTypesLatex
static const std::vector< std::string > fSourceTypesLatex
Definition: CbmLmvmHist.h:46
CbmAnaDielectronTaskDraw::DrawMinvPtAll
void DrawMinvPtAll()
Definition: CbmAnaDielectronTaskDraw.cxx:1328
CbmAnaDielectronTaskDraw::DrawMinvSource
void DrawMinvSource(int step, bool drawAnaStep=true)
Definition: CbmAnaDielectronTaskDraw.cxx:848
CbmAnaDielectronTaskDraw::fOutputDir
std::string fOutputDir
Definition: CbmAnaDielectronTaskDraw.h:56
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmAnaDielectronTaskDraw
Definition: CbmAnaDielectronTaskDraw.h:26
CbmLmvmHist::fNofSourceTypes
static const int fNofSourceTypes
Definition: CbmLmvmHist.h:44
CbmLmvmCuts::fStCutAngle
Double_t fStCutAngle
Definition: CbmLmvmCuts.h:114
CbmAnaDielectronTaskDraw::fHM
CbmHistManager * fHM
Definition: CbmAnaDielectronTaskDraw.h:55
kChi2Prim
@ kChi2Prim
Definition: CbmLmvmHist.h:19
ClassImp
ClassImp(CbmAnaDielectronTaskDraw)
CbmAnaDielectronTaskDraw::DrawCutDistributions
void DrawCutDistributions()
Definition: CbmAnaDielectronTaskDraw.cxx:464
DrawH2
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
Definition: CbmDrawHist.cxx:84
CbmLmvmCuts::fStCutPP
Double_t fStCutPP
Definition: CbmLmvmCuts.h:115
SetDefaultDrawStyle
void SetDefaultDrawStyle()
Definition: CbmDrawHist.cxx:33
CbmLitGlobalElectronId.h
CbmAnaDielectronTaskDraw::DrawHistFromFile
void DrawHistFromFile(const std::string &fileName, const std::string &outputDir="", Bool_t useMvd=true, Bool_t drawSig=true)
Implement functionality of drawing histograms in the macro from the specified file,...
Definition: CbmAnaDielectronTaskDraw.cxx:51
CbmAnaDielectronTaskDraw::Draw2DCutTriangle
void Draw2DCutTriangle(double xCross, double yCross)
Definition: CbmAnaDielectronTaskDraw.cxx:590
CbmAnaDielectronTaskDraw::DrawGammaVertex
void DrawGammaVertex()
Definition: CbmAnaDielectronTaskDraw.cxx:670
CbmAnaDielectronTaskDraw::DrawMomentumDistributionAll
void DrawMomentumDistributionAll()
Definition: CbmAnaDielectronTaskDraw.cxx:358
Cbm::NumberToString
std::string NumberToString(const T &value, int precision=1)
Definition: CbmUtils.h:23
kStCut
@ kStCut
Definition: CbmLmvmHist.h:24
kSignal
@ kSignal
Definition: CbmLmvmHist.h:10
kAcc
@ kAcc
Definition: CbmLmvmHist.h:17
CbmLitGlobalElectronId::GetInstance
static CbmLitGlobalElectronId & GetInstance()
Definition: CbmLitGlobalElectronId.h:32
CbmAnaDielectronTaskDraw::CreateSignificanceH1D
TH1D * CreateSignificanceH1D(TH1D *s, TH1D *bg, const std::string &name, const std::string &option)
Definition: CbmAnaDielectronTaskDraw.cxx:150
kLog
@ kLog
Definition: CbmDrawHist.h:78
CbmAnaDielectronTaskDraw::DrawPtYDistributionAll
void DrawPtYDistributionAll()
Definition: CbmAnaDielectronTaskDraw.cxx:288
CbmAnaDielectronTaskDraw::DrawPmtXY
void DrawPmtXY()
Definition: CbmAnaDielectronTaskDraw.cxx:404
CbmAnaDielectronTaskDraw::RebinMinvHist
void RebinMinvHist()
Rebin minv histograms for better drawing. Should be called after calculation of S/BG ratios.
Definition: CbmAnaDielectronTaskDraw.cxx:99
CbmLmvmHist::fSourceTypesColor
static const std::vector< int > fSourceTypesColor
Definition: CbmLmvmHist.h:47
CbmLmvmAnalysisSteps
CbmLmvmAnalysisSteps
Definition: CbmLmvmHist.h:15
CbmAnaDielectronTaskDraw::DrawPtYEfficiency
void DrawPtYEfficiency(int step, bool drawAnaStep=true)
Draw efficiency in dependence on Pt and Rapidity. Efficiency is normalized to the previous step.
Definition: CbmAnaDielectronTaskDraw.cxx:328
CbmLmvmCuts::fTtCutPP
Double_t fTtCutPP
Definition: CbmLmvmCuts.h:117
CbmAnaDielectronTaskDraw::CbmAnaDielectronTaskDraw
CbmAnaDielectronTaskDraw()
Definition: CbmAnaDielectronTaskDraw.cxx:42
kGammaCut
@ kGammaCut
Definition: CbmLmvmHist.h:21
kPi0
@ kPi0
Definition: CbmLmvmHist.h:10
Cbm
Definition: CbmGeometryUtils.cxx:31