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