ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/root/plot.C
(Generate patch)

Comparing UserCode/LJMet/MultivariateAnalysis/root/plot.C (file contents):
Revision 1.1 by kukartse, Wed Jan 21 18:36:10 2009 UTC vs.
Revision 1.3 by kukartse, Fri Jun 12 17:48:04 2009 UTC

# Line 1 | Line 1
1 < {
2 <  TChain chain("ttljets");
3 <  //chain . Add("./ttlj_chowder_muon.root");
4 <  chain . Add("./ttlj_chowder_electron.root");
5 <  chain . Add("./ttlj_gumbo_electron.root");
6 <  //chain . Add("./ttlj_gumbo_muon.root");
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 <  gROOT->Macro("./cuts.C");
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  
13  TH1F h_track_iso("h_track_iso","Track Isolation",100,0, 3);
14  TH1F h_track_iso_2("h_track_iso_2","Track Isolation",100,0, 3);
15  h_track_iso . SetFillColor(2);
16  h_track_iso_2 . SetFillColor(3);
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);
# Line 40 | Line 128
128    h_sphericity . SetFillColor(2);
129    h_sphericity_2 . SetFillColor(3);
130  
43  TCut sig_cut = ttbar;
44  TCut bg_cut = wzjets;
45
131    //TCanvas c("canvas", "canvas", 770, 595);
47  TCanvas c("canvas", "canvas", 800, 400);
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 <
54 <  //chain . Draw("aplanarity>>h_apl", weight*(sig_cut || bg_cut));
55 <  //chain . Draw("aplanarity>>h_apl_2", weight*sig_cut, "same");
56 <
57 <  //chain . Draw("et3>>h_et3", weight*(!ttbar));
58 <  //chain . Draw("et3>>h_et3_2", weight*ttbar, "same");
59 <
60 <  //chain . Draw("ht2p>>h_ht2p", weight*(!ttbar));
61 <  //chain . Draw("ht2p>>h_ht2p_2", weight*ttbar, "same");
62 <
63 <  //chain . Draw("sphericity>>h_sphericity", weight*(!ttbar));
64 <  //chain . Draw("sphericity>>h_sphericity_2", weight*ttbar, "same");
65 <
66 <  //c.GetPad(0)->SetLogy();
67 <  //chain . Draw("lepton_track_iso>>h_track_iso", weight*(ttbar||wzjets) );
68 <  //chain . Draw("lepton_track_iso>>h_track_iso_2", weight*wzjets, "same");
69 <
70 <  //c.GetPad(0)->SetLogy();
71 <  //chain . Draw("lepton_calo_iso>>h_calo_iso", weight*ttbar );
72 <  //chain . Draw("lepton_calo_iso>>h_calo_iso_2", weight*wzjets, "same");
137 >  */
138   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines