ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Jeng/scripts/fitLandau.C
(Generate patch)

Comparing UserCode/Jeng/scripts/fitLandau.C (file contents):
Revision 1.2 by jengbou, Tue Apr 21 20:49:17 2009 UTC vs.
Revision 1.3 by jengbou, Mon Apr 27 22:37:00 2009 UTC

# Line 17 | Line 17 | using namespace std;
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:
# Line 31 | Line 31 | TString isoname = "New";
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");
# Line 60 | Line 60 | void fitLandau()
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    }
# Line 96 | Line 96 | void fitLandau()
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    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines