ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/root/template_fit_test.C
Revision: 1.1
Committed: Wed Jan 21 18:36:10 2009 UTC (16 years, 3 months ago) by kukartse
Content type: text/plain
Branch: MAIN
CVS Tags: V00-03-01, ZMorph_BASE_20100408, gak040610_morphing, V00-02-02, gak011410, gak010310, ejterm2010_25nov2009, V00-02-01, V00-02-00, gak112409, CMSSW_22X_branch_base, segala101609, V00-01-15, V00-01-14, V00-01-13, V00-01-12, V00-01-11, V00-01-10, gak031009, gak030509, gak022309, gak021209, gak040209, gak012809, V00-01-09, V00-01-08, V00-01-07, V00-01-06, V00-01-05, V00-01-04, HEAD
Branch point for: ZMorph-V00-03-01, CMSSW_22X_branch
Log Message:
after JTerm status update

File Contents

# Content
1 #include <iostream>
2
3 #include "TFile.h"
4 #include "TTree.h"
5 #include "TH1D.h"
6 #include "TTbarFractionFitter.h"
7
8 using namespace std;
9
10 void test_fit(void){
11 TFile _file("TMVA.root", "READ");
12 TTree * tree = (TTree *)_file.Get("TestTree");
13
14 TH1D * data = new TH1D("data", "data", 100, 0, 1);
15 TH1D * ttbar = (TH1D *)_file.Get("Method_Likelihood/Likelihood/MVA_Likelihood_S");
16 TH1D * wjets = (TH1D *)_file.Get("Method_Likelihood/Likelihood/MVA_Likelihood_B");
17 TH1D * qcd = (TH1D *)_file.Get("Method_Likelihood/Likelihood/MVA_Likelihood_B");
18
19 tree->Draw("MVA_Likelihood>>data");
20
21 cout << " ==> Initializing the fitter..." << endl;
22 TTbarFractionFitter fitter;
23
24 cout << " ==> fitting..." << endl;
25 fitter.fit(data,ttbar,wjets,qcd,0.0);
26
27
28 }