17 |
|
#include "Math/GSLIntegrator.h" |
18 |
|
#include "Math/WrappedTF1.h" |
19 |
|
|
20 |
< |
TString fileName = "skimmed/QCDbin4.root"; |
20 |
> |
TString fileName = "skimmed/QCDbin4_005.root"; |
21 |
|
// Dynamic(true) or static(false) range |
22 |
|
bool dynamic = true; |
23 |
|
// Dynamic fit region weight |
24 |
< |
double wxmin = 1.9; // 1.82 for loose 2.1 for tight |
25 |
< |
double wxmax = 3.0; // 0.6 for loose 0.8 for tight |
24 |
> |
double wxmin = 2.; // 1.82 for loose 2.1 for tight |
25 |
> |
double wxmax = 0.8; // 0.6 for loose 0.8 for tight |
26 |
|
// Select fitting function: |
27 |
|
TString s0 = "landau"; |
28 |
|
// Select New or Old reliso: |
31 |
|
void fitLandau() |
32 |
|
{ |
33 |
|
gStyle->SetOptFit(01111); |
34 |
< |
|
34 |
> |
|
35 |
|
TFile *file = TFile::Open(fileName); |
36 |
|
TTree *tree = (TTree*)file->Get("myTree"); |
37 |
|
TH1D *h0 = (TH1D*)file->Get("histos/h_RelIso_all"); |
60 |
|
else if ( isoname.Contains("New") ) { |
61 |
|
// new |
62 |
|
ax0 = 0.0; |
63 |
< |
axf = 0.053; // default: 0.053; loose:0.11 |
63 |
> |
axf = 0.05; // default: 0.053; loose:0.11 |
64 |
|
bx0 = 0.2; |
65 |
|
bxf = 2.; |
66 |
|
} |
96 |
|
} |
97 |
|
h_all->Draw(); |
98 |
|
|
99 |
+ |
Int_t nbxMax = h_all->GetXaxis()->FindBin(2.0); |
100 |
+ |
h_all->GetXaxis()->SetRange(2,h_all->GetXaxis()->FindBin(bxf)); |
101 |
+ |
Int_t nbMax = h_all->GetMaximumBin(); |
102 |
+ |
cout << "Bin number at peak= " << nbMax << endl; |
103 |
+ |
h_all->GetXaxis()->SetRange(1,nbxMax); |
104 |
+ |
TAxis *axis0 = h_all->GetXaxis(); |
105 |
+ |
double bwidth = axis0->GetBinWidth(nbMax); |
106 |
+ |
cout << "bwidth = " << bwidth << endl; |
107 |
+ |
|
108 |
|
cout << "\n>>>>> Iteration step: "<< niter << endl; |
109 |
|
h_all->Fit(s0,"0","",bx0,bxf); |
110 |
|
|