Go to the documentation of this file.
10 #include "TDirectory.h"
19 #include <boost/assign/list_of.hpp>
23 using boost::assign::list_of;
51 int nofEvents =
H1(
"fh_event_number")->GetEntries();
52 cout <<
"Number of events = " << nofEvents << endl;
95 "jpsi_fh_vertex_el_gamma",
"jpsi_fh_vertex_el_gamma", 1000, 1000);
100 DrawH2(
H2(
"fh_vertex_el_gamma_yz"));
102 DrawH2(
H2(
"fh_vertex_el_gamma_xy"));
104 DrawH2(
H2(
"fh_vertex_el_gamma_rz"));
109 CreateCanvas(
"jpsi_fh_nof_tracks",
"jpsi_fh_nof_tracks", 1000, 500);
118 H1(
"fh_nof_el_tracks")->SetMinimum(0.0);
124 "jpsi_fh_nof_mismatches",
"jpsi_fh_nof_mismatches", 1000, 1000);
131 DrawH1(
H1(
"fh_nof_mismatches_rich"));
135 DrawH1(
H1(
"fh_nof_mismatches_trd"));
139 DrawH1(
H1(
"fh_nof_mismatches_tof"));
145 list_of(
"#gamma")(
"#pi^{0}")(
"#pi^{#pm}")(
"p")(
"K")(
146 "e^{#pm}_{sec}")(
"oth."),
157 TCanvas* c =
CreateCanvas(
"jpsi_fh_PdgCode_of Others_BG",
158 "jpsi_fh_PdgCode_of Others_BG",
172 bool DoDrawEfficiency) {
174 (
"jpsi_" + hName).c_str(), (
"jpsi_" + hName).c_str(), 1200, 800);
183 if (DoDrawEfficiency)
192 CreateCanvas((
"jpsi_" + hName).c_str(), (
"jpsi_" + hName).c_str(), 600, 600);
194 vector<string> hLegend;
197 h.push_back(
H1(fullName));
198 h[
i]->SetLineWidth(2);
200 if (doScale)
h[
i]->Scale(1. /
h[
i]->Integral());
203 h[
i]->SetMinimum(
min);
204 h[
i]->SetMaximum(
max);
212 vector<string> hLegend;
215 h.push_back(
H1(fullName));
216 h[
i]->SetLineWidth(2);
219 Double_t integral =
h[
i]->Integral();
220 if (integral != 0.0) {
h[
i]->Scale(1. /
h[
i]->Integral()); }
230 CreateCanvas((
"jpsi_" + hName).c_str(), (
"jpsi_" + hName).c_str(), 600, 600);
232 if (cutValue != -999999.) {
233 TLine* cutLine =
new TLine(cutValue, 0.0, cutValue, 1.);
234 cutLine->SetLineWidth(2);
241 CreateCanvas((
"jpsi_" + hist).c_str(), (
"jpsi_" + hist).c_str(), 900, 900);
254 DrawCutH1(
"fh_track_mom", -999999.,
false);
255 DrawCutH1(
"fh_track_chi2sts", -999999.,
false);
256 DrawCutH1(
"fh_track_rapidity", -999999.,
false);
270 const string hName =
"fh_signal_minv";
272 CreateCanvas((
"jpsi_" + hName).c_str(), (
"jpsi_" + hName).c_str(), 600, 600);
274 vector<string> hLegend;
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);
285 h[
i]->SetMinimum(
min);
286 h[
i]->SetMaximum(
max);
298 double trueMatchNotEl =
310 list_of(
"true match ("
312 "true match (e^{#pm}) ("
314 "true match (not e^{#pm}) ("
331 "jpsi_fh_minv_mismatches",
"jpsi_fh_minv_mismatches", 1000, 1000);
339 "jpsi_fh_minv_mismatches_ptcut",
"jpsi_fh_minv_mismatches_ptcut", 600, 600);
345 const string& McHistName) {
346 Double_t nofMCEntries =
H2(McHistName)->GetEntries();
347 if (nofMCEntries != 0) {
349 / nofMCEntries * 100.)
371 CreateCanvas(
"jpsi_fh_pty_efficiency",
"jpsi_fh_pty_efficiency", 1200, 800);
380 h->GetXaxis()->SetLabelSize(0.06);
394 TH1D* signalFit = (TH1D*) signal->Clone();
395 signalFit->Fit(
"gaus");
398 Double_t sigmaSignal = signalFit->GetFunction(
"gaus")->GetParameter(
"Sigma");
399 Double_t meanSignal = signalFit->GetFunction(
"gaus")->GetParameter(
"Mean");
402 int signalMin = signal->FindBin(meanSignal - 2. * sigmaSignal);
403 int signalMax = signal->FindBin(meanSignal + 2. * sigmaSignal);
405 double NOfSignalEntries = 0.;
406 double NOfBgEntries = 0.;
409 for (
int i = signalMin;
i <= signalMax;
i++) {
410 NOfSignalEntries += signal->GetBinContent(
i);
411 NOfBgEntries += bg->GetBinContent(
i);
415 if (NOfBgEntries <= 0.) {
418 double sOverBg = NOfSignalEntries / NOfBgEntries;
425 "jpsi_fh_SignalOverBg_allAnaSteps",
428 HM()->
Create1<TH1D>(
"fh_SignalOverBg_allAnaSteps",
429 "fh_SignalOverBg_allAnaSteps;AnaSteps;S/Bg",
435 double nstep =
i + 0.5;
437 HM()->
H1(
"fh_SignalOverBg_allAnaSteps")->Fill(nstep, SOverBg);
442 DrawH1(
H1(
"fh_SignalOverBg_allAnaSteps"));
452 TH1D* s = (TH1D*) signal->Clone();
453 TH1D* bg = (TH1D*) background->Clone();
454 TH1D* sbg = (TH1D*) background->Clone();
459 sbg->SetMinimum(1e-12);
462 list_of(sbg)(bg)(s), list_of(
"")(
"")(
""),
kLinear,
kLog,
false, 0, 0, 0, 0);
464 s->SetFillColor(kRed);
465 s->SetLineColor(kBlack);
468 bg->SetFillColor(kYellow - 10);
469 bg->SetLineColor(kBlack);
472 sbg->SetFillColor(kBlue);
473 sbg->SetLineColor(kBlack);
474 sbg->SetLineWidth(1);
476 s->SetMarkerStyle(1);
477 bg->SetMarkerStyle(1);
478 sbg->SetMarkerStyle(1);
486 "jpsi_fh_Minv_Signal_and_Bg",
"jpsi_fh_Minv_Signal_and_Bg", 1200, 800);
496 "jpsi_fh_Minv_Signal_and_Bg_ptCut",
508 (TH1D*) Mc->Clone());
509 McEff->SetMinimum(0.);
510 McEff->SetMaximum(115.);
514 (TH1D*) Mc->Clone());
518 (TH1D*) Mc->Clone());
522 (TH1D*) Mc->Clone());
526 (TH1D*) Mc->Clone());
530 (TH1D*) Mc->Clone());
533 "jpsi_fh_Momentum_Efficiency_AllSteps",
537 DrawH1(list_of(McEff)(AccEff)(RecEff)(Chi2PrimEff)(ElIdEff)(PtEff),
555 gPad->SetLogy(
false);
560 "jpsi_fh_Momentum_Mc_Reco",
"jpsi_fh_Momentum_Mc_Reco", 800, 800);
561 DrawH2(
H2(
"fh_track_el_mom_mc_rec"));
581 list_of(
"#gamma + #gamma")(
"whole BG")(
"#gamma + #pi^{0}")(
583 (
"#pi^{0} + #pi^{0}")(
"#pi^{0} + others")
596 CreateCanvas(
"jpsi_fh_bg_pair_source",
"jpsi_fh_bg_pair_source", 1200, 800);
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(),
613 TH2D* habs = (TH2D*)
H2(histName)->Clone();
614 habs->SetStats(
false);
615 habs->GetZaxis()->SetTitle(zTitle.c_str());
617 habs->SetMarkerSize(1.8);
620 CreateCanvas(
string(
"jpsi_" + histName +
"_percent").c_str(),
621 string(
"jpsi_" + histName +
"_percent").c_str(),
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++) {
631 for (Int_t
y = 1;
y <= nBinsY;
y++) {
632 nbg += habs->GetBinContent(
x,
y);
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);
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);
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());
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...
static const std::vector< std::string > fAnaStepsLatex
void DrawCutH1(const std::string &hName, double cutValue, bool doScale=false)
void ScaleByPattern(const std::string &pattern, Double_t scale)
Scale histograms which name matches specified pattern.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void DrawMinvMismatches(int step)
virtual std::string DocumentBegin() const =0
Return string with open tags for document.
static const std::vector< int > fAnaStepsColor
void DrawPtYEfficiencyAll()
void DrawMinvSAndBgAllSteps()
virtual std::string DocumentEnd() const =0
Return string with close tags of the document.
void DrawSourceTypesH1(const std::string &hName, bool doScale=false)
TH2D * DivideH2(TH2 *h1, TH2 *h2, const string &histName, double scale, const string &titleZaxis)
void RebinByPattern(const std::string &pattern, Int_t ngroup)
Rebin histograms which name matches specified pattern.
static const std::vector< int > fSourceTypesColor
void DrawMomEffAllSteps()
const CbmReportElement * R() const
Accessor to CbmReportElement object. User has to write the report using available tags from CbmReport...
void SetAnalysisStepLabels(TH1 *h)
Helper functions for drawing 1D and 2D histograms and graphs.
Abstract class for basic report elements (headers, tables, images etc.).
void DrawMinvSAndBg(int step)
static const std::vector< std::string > fAnaSteps
virtual void Draw()
Inherited from CbmSimulationReport.
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
void SetReportName(const std::string &name)
TH1D * DivideH1(TH1 *h1, TH1 *h2, const string &histName, double scale, const string &titleYaxis)
void DrawBgSource2D(const std::string &histName, const std::vector< std::string > &yLabels, const std::string &zTitle)
void DrawTextOnPad(const string &text, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
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 PrintCanvases() const
Print images created from canvases in the report.
void SignalOverBgAllSteps()
virtual void Create()
Inherited from CbmSimulationReport.
static Int_t MarkerStyle(Int_t markerIndex)
void DrawPtYEfficiency(int step)
Data class with information on a STS local track.
void DrawEfficiency(const std::string &h, const std::string &hMC)
static const std::vector< std::string > fSourceTypes
static const std::vector< std::string > fSourceTypesLatex
double SignalOverBg(int step)
void DrawAnalysisStepsH1(const std::string &hName, bool doScale, double min=-1., double max=-1.)
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...
void Draw2DCut(const std::string &hist)
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
void DrawCutDistributions()
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
static const int fNofSourceTypes
virtual ~CbmAnaJpsiReport()
Destructor.
void DrawMinvMismatchesAll()
CbmHistManager * HM() const
Return pointer to Histogram manager.
void DrawAnalysisStepsH2(const std::string &hName, bool DoDrawEfficiency)
Base class for simulation reports.
std::ostream & Out() const
All text output goes to this stream.
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
void DrawPairSourceAnaSteps(int step)
void SetDefaultDrawStyle()
static const int fNofAnaSteps
CbmAnaJpsiReport()
Constructor.
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
virtual std::string Title(int size, const std::string &title) const =0
Return string with title.
std::string NumberToString(const T &value, int precision=1)
static CbmLitGlobalElectronId & GetInstance()
vector< string > Split(const string &name, char delimiter)