ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/root/plot.C
Revision: 1.3
Committed: Fri Jun 12 17:48:04 2009 UTC (15 years, 10 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, HEAD
Branch point for: ZMorph-V00-03-01, CMSSW_22X_branch
Changes since 1.2: +24 -8 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 { gROOT->SetStyle("Plain");
2 gStyle->SetOptStat(0000);
3 gStyle->SetPalette(1);
4
5 TChain ch_ttbar("mva/ttljets");
6 //TChain ch_w("mva/ttljets");
7 //TChain ch_z("mva/ttljets");
8 TChain ch_w("ttljets");
9 TChain ch_z("ttljets");
10 TChain ch_qcd("mva/ttljets");
11 //ch_ttbar . Add("tjets_muon-08apr2009.root");
12 ch_ttbar . Add("TTJets_Fall08.root");
13 //
14 //ch_w . Add("wjets_muon-08apr2009.root");
15 //ch_z . Add("zjets_muon-08apr2009.root");
16 ch_w . Add("wjets_muon_fastsim-23apr2009.root");
17 ch_z . Add("zjets_muon_fastsim-23apr2009.root");
18 ch_qcd . Add("qcd_muon-08apr2009.root");
19
20 #include "cuts.C"
21
22 //reversible_cut = "lepton_pt/(lepton_pt + lepton_calo_iso) > 0.9";
23 //reversible_cut = "lepton_pt/(lepton_pt + lepton_track_iso) > 0.9";
24
25 TCut nom_cut = semilep_cut && reversible_cut;
26 TCut rev_cut = semilep_cut && !reversible_cut;
27
28 //the_cut = "";
29 //the_cut = cut3;
30 //the_cut = cut3_rev;
31 //the_cut = cut3_qcd;
32 the_cut = cut4;
33
34 double lumi = 20.0;
35
36 double xsec_ttbar = 317.0;
37 double xsec_w = 40000.0;
38 double xsec_z = 3700.0;
39 double xsec_qcd = 0.5091e+9;
40
41 double eff_gen_ttbar = 1.0;
42 double eff_gen_w = 1.0;
43 double eff_gen_z = 1.0;
44 double eff_gen_qcd = 0.000239;
45
46 Long64_t n_processed_ttbar = 1018924;
47 //Long64_t n_processed_w = 9984223; // FIXME not precise fullsim
48 //Long64_t n_processed_z = 1163479; //PAT: 236345
49 Long64_t n_processed_w = 101467739;
50 Long64_t n_processed_z = 9679459; // PAT: 2000116
51 //Long64_t n_processed_qcd = 3889924; // ~half of the processed set
52 Long64_t n_processed_qcd = 6142581; // PAT: 1282829
53
54 cout << "Selecting events..." << endl;
55
56 //TH1F h1("h1","IP",100,-0.2, 0.2);
57 TH1F h1("h1","PDF weight positive",100,-10.0, 10.0);
58 TH1F h2("h2","PDF weight negative",100,-10.0, 10.0);
59 //TH1F h2("h2","IP",100,-0.2, 0.2);
60 TH1F h3("h3","IP",100,-0.2, 0.2);
61 TH1F h4("h4","IP",100,-0.2, 0.2);
62 h1 . SetFillColor(2);
63 h2 . SetFillColor(3);
64 h2 . SetFillColor(4);
65 h2 . SetFillColor(5);
66
67 TCanvas c("canvas", "canvas", 800, 400);
68 c.Divide(2,1);
69 c.GetPad(0)->SetLogy(1);
70 c.GetPad(1)->SetLogy(1);
71
72 //Long64_t n_selected_ttbar = ch_ttbar -> Draw("weight_pdf_pos>>h1", the_cut);
73 c.cd(1);
74 Long64_t n_selected_ttbar = ch_ttbar -> Draw("((weight_pdf_pos-1.0)/4.69)+1.0>>h1", the_cut);
75 c.cd(2);
76 Long64_t n_selected_ttbar = ch_ttbar -> Draw("1.0-((1.0-weight_pdf_neg)/4.69)>>h2", the_cut);
77 cout << "Selected ttbar events: " << n_selected_ttbar << endl;
78 //
79 //Long64_t n_selected_ttbar = ch_ttbar -> Draw("lepton_d0>>h1", the_cut);
80 //Long64_t n_selected_w = ch_w -> Draw("lepton_d0>>h2", the_cut);
81 //Long64_t n_selected_z = ch_z -> Draw("lepton_d0>>h3", the_cut);
82 //Long64_t n_selected_qcd = ch_qcd -> Draw("lepton_d0>>h4", the_cut);
83
84
85 /*
86 double eff_sel_ttbar = (double)n_selected_ttbar/(double)n_processed_ttbar;
87 double eff_sel_w = (double)n_selected_w/(double)n_processed_w;
88 double eff_sel_z = (double)n_selected_z/(double)n_processed_z;
89 double eff_sel_qcd = (double)n_selected_qcd/(double)n_processed_qcd;
90
91 double n_expected_ttbar = xsec_ttbar * eff_gen_ttbar * eff_sel_ttbar * lumi;
92 double n_expected_w = xsec_w * eff_gen_w * eff_sel_w * lumi;
93 double n_expected_z = xsec_z * eff_gen_z * eff_sel_z * lumi;
94 double n_expected_qcd = xsec_qcd * eff_gen_qcd * eff_sel_qcd * lumi;
95
96 double n_expected_all = n_expected_ttbar + n_expected_w + n_expected_z + n_expected_qcd;
97 double n_expected_phys = n_expected_ttbar + n_expected_w + n_expected_z;
98 */
99 //h1.Draw();
100
101 /*
102 TH1F h_id("h_id","Track Isolation",60,0, 60);
103 h_id . SetFillColor(2);
104
105
106 TH1F h_calo_iso("h_calo_iso","Calorimeter Isolation",100,0, 6);
107 TH1F h_calo_iso_2("h_calo_iso_2","Calorimeter Isolation",100,0, 6);
108 h_calo_iso . SetFillColor(2);
109 h_calo_iso_2 . SetFillColor(3);
110
111 TH1F h_apl("h_apl","Aplanarity",100,0, 0.5);
112 TH1F h_apl_2("h_apl_2","Aplanarity",100,0, 0.5);
113 h_apl . SetFillColor(2);
114 h_apl_2 . SetFillColor(3);
115
116 TH1F h_et3("h_et3","Et3",100,0, 300);
117 TH1F h_et3_2("h_et3_2","Et3",100,0, 300);
118 h_et3 . SetFillColor(2);
119 h_et3_2 . SetFillColor(3);
120
121 TH1F h_ht2p("h_ht2p","Ht2p",100,0, 3);
122 TH1F h_ht2p_2("h_ht2p_2","Ht2p",100,0, 3);
123 h_ht2p . SetFillColor(2);
124 h_ht2p_2 . SetFillColor(3);
125
126 TH1F h_sphericity("h_sphericity","Sphericity",100,0, 1);
127 TH1F h_sphericity_2("h_sphericity_2","Sphericity",100,0, 1);
128 h_sphericity . SetFillColor(2);
129 h_sphericity_2 . SetFillColor(3);
130
131 //TCanvas c("canvas", "canvas", 770, 595);
132
133 //chain . Draw("process_id>>h_id", weight);
134 //chain . Draw("process_id>>h_id_2", weight*sig_cut, "same");
135 h_id . SetMarkerSize(1.5);
136 chain . Draw("process_id>>h_id", weight, "TEXT");
137 */
138 }