Skip to content
Snippets Groups Projects
Commit fcb63bd1 authored by Patrick L.S. Connor's avatar Patrick L.S. Connor
Browse files

synchronising phase space to QCD fits'

parent 5b4e27cb
No related branches found
No related tags found
No related merge requests found
...@@ -29,9 +29,14 @@ int main (int argc, char * argv[]) ...@@ -29,9 +29,14 @@ int main (int argc, char * argv[])
cout << "ROOT version: " << gROOT->GetVersion() << endl; cout << "ROOT version: " << gROOT->GetVersion() << endl;
TH1::SetDefaultSumw2(true); TH1::SetDefaultSumw2(true);
array<array<vector<vector<double>>,6>,6> statcovariances;
////array< vector<double> ,5 > differences;
//array<map<int,vector<double>>, 6> systUps, systDns;
//int ndfTot = 0;
auto fOut = TFile::Open("CMS.root", "RECREATE"); auto fOut = TFile::Open("CMS.root", "RECREATE");
map<int,stringstream> rows; map<int,stringstream> rows;
for (int y = 1; y <= 5; ++y) { for (int y = 1; y <= 6; ++y) {
fOut->cd(); fOut->cd();
cout << "--------------------------- y = " << y << '\n'; cout << "--------------------------- y = " << y << '\n';
...@@ -54,6 +59,9 @@ int main (int argc, char * argv[]) ...@@ -54,6 +59,9 @@ int main (int argc, char * argv[])
} }
fIn.close(); fIn.close();
int N = h->GetNbinsX();
while (std::abs(h->GetBinContent(N)) < Step::eps) { --N; assert(N > 1); }
fIn.open(Form("tables/CMS_8TeV_jets_Ybin%d.corr",y)); fIn.open(Form("tables/CMS_8TeV_jets_Ybin%d.corr",y));
while (fIn.good()) { while (fIn.good()) {
int lowedge1, lowedge2; double content; int lowedge1, lowedge2; double content;
...@@ -66,21 +74,22 @@ int main (int argc, char * argv[]) ...@@ -66,21 +74,22 @@ int main (int argc, char * argv[])
fIn.close(); fIn.close();
auto cov = (TH2 *) corr->Clone("cov"); auto cov = (TH2 *) corr->Clone("cov");
for (int x = 1; x <= cov->GetNbinsX(); ++x) for (int x1 = 1; x1 <= N; ++x1)
for (int y = 1; y <= cov->GetNbinsY(); ++y) { for (int x2 = 1; x2 <= N; ++x2) {
auto content = corr->GetBinContent(x,y); auto content = corr->GetBinContent(x1,x2);
auto sx = h->GetBinError(x), auto s1 = h->GetBinError(x1),
sy = h->GetBinError(y); s2 = h->GetBinError(x2);
auto sigsig = content*sx*sy; auto sigsig = content*s1*s2;
if (x == y) sigsig = sigsig + pow(0.01 * h->GetBinContent(x),2); if (x1 == x2) sigsig += pow(0.01 * h->GetBinContent(x1),2);
if (sx*sy > 0) cov->SetBinContent(x,y,sigsig); if (s1*s2 > 0) cov->SetBinContent(x1,x2,sigsig);
statcovariances[y-1][y-1][x1-1][x2-1] = sigsig;
} }
auto hExt = (TH1 *) h->Clone("hExt"); auto hExt = (TH1 *) h->Clone("hExt");
for (int x = 1; x <= cov->GetNbinsX(); ++x) { for (int x = 1; x <= N; ++x) {
auto content = hExt->GetBinContent(x), auto content = hExt->GetBinContent(x),
error = hExt->GetBinError (x); error = hExt->GetBinError (x);
hExt->SetBinError(x,hypot(error,0.01*content)); hExt->SetBinError(x,hypot(error,0.01*content));
...@@ -88,8 +97,6 @@ int main (int argc, char * argv[]) ...@@ -88,8 +97,6 @@ int main (int argc, char * argv[])
h->GetYaxis()->SetTitle("#frac{d^{2}#sigma}{dp_{T}dy} / Step( #frac{d^{2}#sigma}{dp_{T}dy} )"); h->GetYaxis()->SetTitle("#frac{d^{2}#sigma}{dp_{T}dy} / Step( #frac{d^{2}#sigma}{dp_{T}dy} )");
hExt->GetYaxis()->SetTitle(h->GetYaxis()->GetTitle()); hExt->GetYaxis()->SetTitle(h->GetYaxis()->GetTitle());
int N = h->GetNbinsX();
while (std::abs(h->GetBinContent(N)) < Step::eps) { --N; assert(N > 1); }
TF1 * f = Step::GetSmoothFit<Step::Basis::Chebyshev,log,exp>(hExt, cov, 1, N, maxdegree, nsigma, autostop, cout); TF1 * f = Step::GetSmoothFit<Step::Basis::Chebyshev,log,exp>(hExt, cov, 1, N, maxdegree, nsigma, autostop, cout);
//TF1 * f = Step::GetSmoothFitHK(hExt, cov, 1, N, nsigma, autostop, cout); //TF1 * f = Step::GetSmoothFitHK(hExt, cov, 1, N, nsigma, autostop, cout);
cout << "Best fit: " << f->GetTitle() << endl; cout << "Best fit: " << f->GetTitle() << endl;
......
2 863.47±0.25 1028.76±0.25 1447.42±0.25 1965.38±0.26 1934.94±0.29 2 863.47±0.25 1028.76±0.25 1447.42±0.25 1965.38±0.26 1934.94±0.29 6137.77±0.35
3 49.73±0.25 68.12±0.25 117.05±0.25 187.72±0.26 190.07±0.30 3 49.73±0.25 68.12±0.25 117.05±0.25 187.72±0.26 190.07±0.30 952.02±0.37
4 6.94±0.25 6.99±0.25 13.22±0.25 20.62±0.27 16.99±0.31 4 6.94±0.25 6.99±0.25 13.22±0.25 20.62±0.27 16.99±0.31 75.97±0.38
5 0.77±0.26 0.91±0.26 1.05±0.26 1.04±0.27 0.79±0.32 5 0.77±0.26 0.91±0.26 1.05±0.26 1.04±0.27 0.79±0.32 7.77±0.39
6 0.70±0.26 0.63±0.26 0.49±0.26 0.50±0.28 0.44±0.32 6 0.70±0.26 0.63±0.26 0.49±0.26 0.50±0.28 0.44±0.32 4.18±0.41
7 0.72±0.27 0.65±0.27 0.45±0.27 0.33±0.28 0.32±0.33 7 0.72±0.27 0.65±0.27 0.45±0.27 0.33±0.28 0.32±0.33 4.51±0.43
8 0.74±0.27 0.67±0.27 0.45±0.27 0.35±0.29 0.34±0.34 8 0.74±0.27 0.67±0.27 0.45±0.27 0.35±0.29 0.34±0.34 3.53±0.45
...@@ -33,3 +33,5 @@ ...@@ -33,3 +33,5 @@
1410 0.000315407 1.535e-05 1410 0.000315407 1.535e-05
1497 0.000183499 1.143e-05 1497 0.000183499 1.143e-05
1588 7.20384e-05 4.876e-06 1588 7.20384e-05 4.876e-06
1784 1.50941e-05 1.71e-06
2116 7.22909e-07 3.417e-07
74 74 1
74 84 0.6667
74 97 -0.02824
74 114 -0.2407
74 133 -0.07916
74 153 0.1111
74 174 0.02832
74 196 -0.006699
74 220 -0.01478
74 245 -0.002388
74 272 0.0001061
74 300 0.0002536
74 330 5.107e-05
74 362 6.308e-06
74 395 7.529e-07
74 430 6.091e-09
74 468 5.341e-10
74 507 1.152e-12
84 74 0.6667
84 84 1
84 97 0.5517
84 114 -0.1628
84 133 -0.4254
84 153 0.04539
84 174 0.05771
84 196 0.008305
84 220 -0.01029
84 245 -0.004827
84 272 -0.001102
84 300 -0.0001803
84 330 -3.538e-06
84 362 -8.424e-07
84 395 -1.046e-06
84 430 -5.478e-08
84 468 -3.162e-08
84 507 -1.726e-11
97 74 -0.02824
97 84 0.5517
97 97 1
97 114 0.5536
97 133 -0.369
97 153 -0.3523
97 174 0.01549
97 196 0.05393
97 220 0.03968
97 245 -0.005392
97 272 -0.005402
97 300 -0.002527
97 330 -0.0003766
97 362 -4.918e-05
97 395 -1.025e-05
97 430 -2.985e-07
97 468 -1.521e-07
97 507 -8.869e-11
114 74 -0.2407
114 84 -0.1628
114 97 0.5536
114 114 1
114 133 0.2426
114 153 -0.583
114 174 -0.08788
114 196 0.06841
114 220 0.08657
114 245 -0.0003368
114 272 -0.007826
114 300 -0.004266
114 330 -0.0006068
114 362 -5.51e-05
114 395 -4.798e-06
114 430 -8.681e-08
114 468 -8.858e-08
114 507 -8.683e-11
133 74 -0.07916
133 84 -0.4254
133 97 -0.369
133 114 0.2426
133 133 1
133 153 0.1721
133 174 -0.2409
133 196 -0.1069
133 220 0.09293
133 245 0.05883
133 272 0.000328
133 300 -0.01105
133 330 -0.002414
133 362 -1.031e-05
133 395 0.0001807
133 430 1.015e-05
133 468 6.037e-06
133 507 3.397e-09
153 74 0.1111
153 84 0.04539
153 97 -0.3523
153 114 -0.583
153 133 0.1721
153 153 1
153 174 0.3441
153 196 -0.24
153 220 -0.3124
153 245 0.08773
153 272 0.04787
153 300 -0.0003336
153 330 -0.005445
153 362 -0.001203
153 395 -7.304e-05
153 430 9.155e-06
153 468 8.616e-06
153 507 4.746e-09
174 74 0.02832
174 84 0.05771
174 97 0.01549
174 114 -0.08788
174 133 -0.2409
174 153 0.3441
174 174 1
174 196 0.4665
174 220 -0.4585
174 245 -0.298
174 272 0.04209
174 300 0.08583
174 330 0.01128
174 362 -0.003023
174 395 -0.002564
174 430 -0.0001184
174 468 -6.855e-05
174 507 -5.019e-08
196 74 -0.006699
196 84 0.008305
196 97 0.05393
196 114 0.06841
196 133 -0.1069
196 153 -0.24
196 174 0.4665
196 196 1
196 220 0.2191
196 245 -0.5993
196 272 -0.06868
196 300 0.128
196 330 0.03429
196 362 -0.001362
196 395 -0.004296
196 430 -0.0002358
196 468 -0.000127
196 507 -1.41e-07
220 74 -0.01478
220 84 -0.01029
220 97 0.03968
220 114 0.08657
220 133 0.09293
220 153 -0.3124
220 174 -0.4585
220 196 0.2191
220 220 1
220 245 0.149
220 272 -0.2434
220 300 -0.1175
220 330 0.04882
220 362 0.0173
220 395 -0.001661
220 430 -0.0004593
220 468 -0.000301
220 507 -3.806e-06
245 74 -0.002388
245 84 -0.004827
245 97 -0.005392
245 114 -0.0003368
245 133 0.05883
245 153 0.08773
245 174 -0.298
245 196 -0.5993
245 220 0.149
245 245 1
245 272 0.3827
245 300 -0.2945
245 330 -0.1328
245 362 0.02132
245 395 0.02668
245 430 0.0005436
245 468 -0.0009943
245 507 -3.53e-05
272 74 0.0001061
272 84 -0.001102
272 97 -0.005402
272 114 -0.007826
272 133 0.000328
272 153 0.04787
272 174 0.04209
272 196 -0.06868
272 220 -0.2434
272 245 0.3827
272 272 1
272 300 0.2049
272 330 -0.3179
272 362 -0.05761
272 395 0.04945
272 430 0.003981
272 468 -0.0007499
272 507 -0.0002361
300 74 0.0002536
300 84 -0.0001803
300 97 -0.002527
300 114 -0.004266
300 133 -0.01105
300 153 -0.0003336
300 174 0.08583
300 196 0.128
300 220 -0.1175
300 245 -0.2945
300 272 0.2049
300 300 1
300 330 0.3163
300 362 -0.2225
300 395 -0.1225
300 430 0.008872
300 468 0.01366
300 507 -0.0005726
330 74 5.107e-05
330 84 -3.538e-06
330 97 -0.0003766
330 114 -0.0006068
330 133 -0.002414
330 153 -0.005445
330 174 0.01128
330 196 0.03429
330 220 0.04882
330 245 -0.1328
330 272 -0.3179
330 300 0.3163
330 330 1
330 362 0.4402
330 395 -0.2308
330 430 -0.03971
330 468 0.02249
330 507 0.01225
362 74 6.308e-06
362 84 -8.424e-07
362 97 -4.918e-05
362 114 -5.51e-05
362 133 -1.031e-05
362 153 -0.001203
362 174 -0.003023
362 196 -0.001362
362 220 0.0173
362 245 0.02132
362 272 -0.05761
362 300 -0.2225
362 330 0.4402
362 362 1
362 395 0.2371
362 430 -0.1503
362 468 -0.03104
362 507 0.09337
395 74 7.529e-07
395 84 -1.046e-06
395 97 -1.025e-05
395 114 -4.798e-06
395 133 0.0001807
395 153 -7.304e-05
395 174 -0.002564
395 196 -0.004296
395 220 -0.001661
395 245 0.02668
395 272 0.04945
395 300 -0.1225
395 330 -0.2308
395 362 0.2371
395 395 1
395 430 0.07689
395 468 -0.2265
395 507 0.002078
430 74 6.091e-09
430 84 -5.478e-08
430 97 -2.985e-07
430 114 -8.681e-08
430 133 1.015e-05
430 153 9.155e-06
430 174 -0.0001184
430 196 -0.0002358
430 220 -0.0004593
430 245 0.0005436
430 272 0.003981
430 300 0.008872
430 330 -0.03971
430 362 -0.1503
430 395 0.07689
430 430 1
430 468 -0.1294
430 507 -0.9735
468 74 5.341e-10
468 84 -3.162e-08
468 97 -1.521e-07
468 114 -8.858e-08
468 133 6.037e-06
468 153 8.616e-06
468 174 -6.855e-05
468 196 -0.000127
468 220 -0.000301
468 245 -0.0009943
468 272 -0.0007499
468 300 0.01366
468 330 0.02249
468 362 -0.03104
468 395 -0.2265
468 430 -0.1294
468 468 1
468 507 0.2399
507 74 1.152e-12
507 84 -1.726e-11
507 97 -8.869e-11
507 114 -8.683e-11
507 133 3.397e-09
507 153 4.746e-09
507 174 -5.019e-08
507 196 -1.41e-07
507 220 -3.806e-06
507 245 -3.53e-05
507 272 -0.0002361
507 300 -0.0005726
507 330 0.01225
507 362 0.09337
507 395 0.002078
507 430 -0.9735
507 468 0.2399
507 507 1
74 12492.6 147.2
84 5885.76 92.08
97 2481.03 52.55
114 957.669 31.58
133 370.346 4.494
153 150.926 2.732
174 61.5716 1.389
196 24.5217 0.7239
220 9.31754 0.121
245 3.57007 0.06876
272 1.26343 0.02864
300 0.424595 0.008469
330 0.137002 0.004428
362 0.038388 0.002461
395 0.00949764 0.0005875
430 0.00198574 0.000282
468 0.000391317 0.0001234
507 3.86442e-05 8.907e-06
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment