12 #include "TDirectory.h"
15 #include <boost/assign/list_of.hpp>
17 using boost::assign::list_of;
44 Int_t nofStudies =
HM().size();
46 TCanvas* canvas2 =
CreateCanvas(
"fit_study_qa_momentum_projection",
47 "fit_study_qa_momentum_projection",
50 vector<TH1*> histos1(nofStudies);
51 for (UInt_t iStudy = 0; iStudy < nofStudies; iStudy++) {
52 histos1[iStudy] =
HM()[iStudy]
53 ->H2(
"htf_MomRes_Mom")
54 ->ProjectionY(
string(
"htf_MomRes_Mom_ProjectionY_"
55 + NumberToString<Int_t>(iStudy))
57 histos1[iStudy]->SetStats(
true);
58 histos1[iStudy]->Fit(
"gaus");
59 histos1[iStudy]->SetMaximum(histos1[iStudy]->GetMaximum() * 1.25);
62 for (UInt_t iStudy = 0; iStudy < nofStudies; iStudy++) {
63 histos1[iStudy]->GetFunction(
"gaus")->SetLineColor(
64 histos1[iStudy]->GetLineColor());
69 TCanvas* canvas3 =
CreateCanvas(
"fit_study_qa_momentum_momres_mom_sigma",
70 "fit_study_qa_momentum_momres_mom_sigma",
73 vector<TH1*> histos2(nofStudies);
74 for (UInt_t iStudy = 0; iStudy < nofStudies; iStudy++) {
75 HM()[iStudy]->H2(
"htf_MomRes_Mom")->FitSlicesY();
76 histos2[iStudy] = (TH1*) gDirectory->Get(
"htf_MomRes_Mom_2");
77 histos2[iStudy]->SetName(
78 string(
"htf_MomRes_Mom_2_" + NumberToString<Int_t>(iStudy)).c_str());
79 histos2[iStudy]->GetXaxis()->SetTitle(
"P [GeV/c]");
80 histos2[iStudy]->GetYaxis()->SetTitle(
"dP/P, #sigma [%]");
81 histos2[iStudy]->SetMinimum(0.);
82 histos2[iStudy]->SetMaximum(3.);
88 TCanvas* canvas4 =
CreateCanvas(
"fit_study_qa_momentum_momres_mom_rms",
89 "fit_study_qa_momentum_momres_mom_rms",
92 vector<TH1*> histos3(nofStudies);
93 for (UInt_t iStudy = 0; iStudy < nofStudies; iStudy++) {
94 TH2* hMomres =
HM()[iStudy]->H2(
"htf_MomRes_Mom");
95 Int_t nBins = hMomres->GetNbinsX();
96 histos3[iStudy] = hMomres->ProjectionX(
97 string(
"htf_MomRes_Mom_ProjectionX_" + NumberToString<Int_t>(iStudy))
99 for (Int_t
i = 1;
i < nBins;
i++) {
100 TH1* projY = hMomres->ProjectionY(
"_py",
i,
i);
101 Double_t rms = projY->GetRMS();
102 histos3[iStudy]->SetBinContent(
i, rms);
103 histos3[iStudy]->SetBinError(
i, histos2[iStudy]->GetBinError(
i));
105 histos3[iStudy]->GetXaxis()->SetTitle(
"P [GeV/c]");
106 histos3[iStudy]->GetYaxis()->SetTitle(
"dP/P, RMS [%]");
107 histos3[iStudy]->SetMinimum(0.);
108 histos3[iStudy]->SetMaximum(3.);
111 gPad->SetGridx(
true);
112 gPad->SetGridy(
true);
115 "fit_study_qa_chi_primary",
"fit_study_qa_chi_primary", 600, 600);
116 vector<TH1*> histos4(nofStudies);
117 for (UInt_t iStudy = 0; iStudy < nofStudies; iStudy++) {
118 histos4[iStudy] =
HM()[iStudy]->H1(
"htf_ChiPrimary");
119 histos4[iStudy]->Scale(1. / histos4[iStudy]->Integral());
122 gPad->SetGridx(
true);
123 gPad->SetGridy(
true);