55 Int_t nofStudies =
HM().size();
57 CreateCanvas(
"fit_study_qa_momentum_projection",
"fit_study_qa_momentum_projection", 600, 600);
58 vector<TH1*> histos1(nofStudies);
59 for (Int_t iStudy = 0; iStudy < nofStudies; iStudy++) {
60 histos1[iStudy] =
HM()[iStudy]
61 ->H2(
"htf_MomRes_Mom")
62 ->ProjectionY(
string(
"htf_MomRes_Mom_ProjectionY_" + NumberToString<Int_t>(iStudy)).c_str());
63 histos1[iStudy]->SetStats(
true);
64 histos1[iStudy]->Fit(
"gaus");
65 histos1[iStudy]->SetMaximum(histos1[iStudy]->GetMaximum() * 1.25);
68 for (Int_t iStudy = 0; iStudy < nofStudies; iStudy++) {
69 histos1[iStudy]->GetFunction(
"gaus")->SetLineColor(histos1[iStudy]->GetLineColor());
74 CreateCanvas(
"fit_study_qa_momentum_momres_mom_sigma",
"fit_study_qa_momentum_momres_mom_sigma", 600, 600);
75 vector<TH1*> histos2(nofStudies);
76 for (Int_t iStudy = 0; iStudy < nofStudies; iStudy++) {
77 HM()[iStudy]->H2(
"htf_MomRes_Mom")->FitSlicesY();
78 histos2[iStudy] = gDirectory->Get<TH1>(
"htf_MomRes_Mom_2");
79 histos2[iStudy]->SetName(
string(
"htf_MomRes_Mom_2_" + NumberToString<Int_t>(iStudy)).c_str());
80 histos2[iStudy]->GetXaxis()->SetTitle(
"P [GeV/c]");
81 histos2[iStudy]->GetYaxis()->SetTitle(
"dP/P, #sigma [%]");
82 histos2[iStudy]->SetMinimum(0.);
83 histos2[iStudy]->SetMaximum(3.);
89 CreateCanvas(
"fit_study_qa_momentum_momres_mom_rms",
"fit_study_qa_momentum_momres_mom_rms", 600, 600);
90 vector<TH1*> histos3(nofStudies);
91 for (Int_t iStudy = 0; iStudy < nofStudies; iStudy++) {
92 TH2* hMomres =
HM()[iStudy]->H2(
"htf_MomRes_Mom");
93 Int_t nBins = hMomres->GetNbinsX();
95 hMomres->ProjectionX(
string(
"htf_MomRes_Mom_ProjectionX_" + NumberToString<Int_t>(iStudy)).c_str());
96 for (Int_t i = 1; i < nBins; i++) {
97 TH1* projY = hMomres->ProjectionY(
"_py", i, i);
98 Double_t rms = projY->GetRMS();
99 histos3[iStudy]->SetBinContent(i, rms);
100 histos3[iStudy]->SetBinError(i, histos2[iStudy]->GetBinError(i));
102 histos3[iStudy]->GetXaxis()->SetTitle(
"P [GeV/c]");
103 histos3[iStudy]->GetYaxis()->SetTitle(
"dP/P, RMS [%]");
104 histos3[iStudy]->SetMinimum(0.);
105 histos3[iStudy]->SetMaximum(3.);
108 gPad->SetGridx(
true);
109 gPad->SetGridy(
true);
111 CreateCanvas(
"fit_study_qa_chi_primary",
"fit_study_qa_chi_primary", 600, 600);
112 vector<TH1*> histos4(nofStudies);
113 for (Int_t iStudy = 0; iStudy < nofStudies; iStudy++) {
114 histos4[iStudy] =
HM()[iStudy]->H1(
"htf_ChiPrimary");
115 histos4[iStudy]->Scale(1. / histos4[iStudy]->Integral());
118 gPad->SetGridx(
true);
119 gPad->SetGridy(
true);
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)
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...