6 TFile *fin =
new TFile( fname,
"OPEN");
7 TH3F *hin3D = (TH3F*)fin->Get(
"MomMagMap");
10 cout <<
"X axis = " << hin3D->GetXaxis()->GetTitle() << endl;
11 cout <<
"Y axis = " << hin3D->GetYaxis()->GetTitle() << endl;
12 cout <<
"Z axis = " << hin3D->GetZaxis()->GetTitle() << endl;
14 unsigned nbins_ptrue = hin3D->GetXaxis()->GetNbins();
15 unsigned nbins_eta = hin3D->GetYaxis()->GetNbins();
16 unsigned nbins_pdiff = hin3D->GetZaxis()->GetNbins();
22 ofstream ofs(
"fitslices_out.csv");
25 TH2D* HistMomMagMap_0 = (TH2D*)gDirectory->Get(
"HistMomMagMap_0");
26 TH2D* HistMomMagMap_1 = (TH2D*)gDirectory->Get(
"HistMomMagMap_1");
27 TH2D* HistMomMagMap_2 = (TH2D*)gDirectory->Get(
"HistMomMagMap_2");
29 for (
unsigned bin_eta = 1; bin_eta <= nbins_eta; bin_eta++ )
32 for (
unsigned bin_ptrue = 1; bin_ptrue <= nbins_ptrue; bin_ptrue++ )
35 double eta_i = HistMomMagMap_1->GetYaxis()->GetBinCenter(bin_eta);
36 double ptrue_i = HistMomMagMap_1->GetXaxis()->GetBinCenter(bin_ptrue);
39 double norm_i = HistMomMagMap_0->GetBinContent(bin_ptrue,bin_eta);
40 double mean_i = HistMomMagMap_1->GetBinContent(bin_ptrue,bin_eta);
41 double sigm_i = HistMomMagMap_2->GetBinContent(bin_ptrue,bin_eta);
43 double mean_err_i = HistMomMagMap_1->GetBinError(bin_ptrue,bin_eta);
44 double sigm_err_i = HistMomMagMap_2->GetBinError(bin_ptrue,bin_eta);
46 cout << eta_i <<
" " << ptrue_i <<
" " << norm_i <<
" " << mean_i <<
" " << sigm_i <<
" " << mean_err_i <<
" " << sigm_err_i << endl;
50 ofs << ptrue_i <<
"," << eta_i <<
"," << sigm_i <<
"," << sigm_err_i <<
"," << mean_i <<
"," << mean_err_i <<
"," << norm_i << endl;