ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/root/qcd_purity_electron.C
Revision: 1.4
Committed: Wed May 6 08:04:29 2009 UTC (16 years ago) by kukartse
Content type: text/plain
Branch: MAIN
Changes since 1.3: +8 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 kukartse 1.1 { gROOT->SetStyle("Plain");
2     gStyle->SetOptStat(0000);
3     gStyle->SetPalette(1);
4    
5     TChain chain_ttbar("ttljets");
6     chain_ttbar . Add("TTJets-madgraph_Fall08_IDEAL_V9_v2_ejets_dr03.root");
7    
8 kukartse 1.3 TChain chain_wjets("ttljets");
9     chain_wjets . Add("Wjets-madgraph_Winter09_IDEAL_V11_FastSim_v1_ejets_dr03.root");
10     //TChain chain_wjets("mva/ttljets");
11     //chain_wjets . Add("WJets-madgraph_Fall08_IDEAL_V9_v1_ejets.root");
12    
13     TChain chain_zjets("ttljets");
14     chain_zjets . Add("Zjets-madgraph_Winter09_IDEAL_V11_FastSim_v1_ejets_dr03.root");
15     //TChain chain_zjets("mva/ttljets");
16     //chain_zjets . Add("ZJets-madgraph_Fall08_IDEAL_V9_reco-v2_ejets.root");
17 kukartse 1.1
18     TChain chain_qcd_bctoept20_30("ttljets");
19     chain_qcd_bctoept20_30 . Add("QCD_BCtoE_Pt20to30_Summer08_IDEAL_V11_redigi_v1_ejets_dr03.root");
20     TChain chain_qcd_bctoept30_80("ttljets");
21     chain_qcd_bctoept30_80 . Add("QCD_BCtoE_Pt30to80_Summer08_IDEAL_V11_redigi_v1_ejets_dr03.root");
22     TChain chain_qcd_bctoept80_170("ttljets");
23     chain_qcd_bctoept80_170 . Add("QCD_BCtoE_Pt80to170_Summer08_IDEAL_V11_redigi_v1_ejets_dr03.root");
24     TChain chain_qcd_empt20_30("ttljets");
25     chain_qcd_empt20_30 . Add("QCD_EMenriched_Pt20to30_Summer08_IDEAL_V11_redigi_v2_ejets_dr03.root");
26     TChain chain_qcd_empt30_80("ttljets");
27     chain_qcd_empt30_80 . Add("QCD_EMenriched_Pt30to80_Summer08_IDEAL_V11_redigi_v2_ejets_dr03.root");
28     TChain chain_qcd_empt80_170("ttljets");
29     chain_qcd_empt80_170 . Add("QCD_EMenriched_Pt80to170_Summer08_IDEAL_V11_redigi_v1_ejets_dr03.root");
30    
31     // selection
32     #include "cuts.C"
33 kukartse 1.4 the_cut="n_jets>=4";
34 kukartse 1.1 //the_cut = cut3_rev_electrons;
35 kukartse 1.4 //the_cut = cut3_electrons;
36     //the_cut = cut4_electrons;
37     //the_cut = electron_qual_cut && rel_iso_cut_electron && electron_ip_cut && !W_MT_vs_lepton_pt_cut;
38 kukartse 1.1
39     double lumi = 20.0;
40    
41     double xsec_ttbar = 317.0; //pb
42     double xsec_w = 40000.0;
43     double xsec_z = 3700.0;
44     double xsec_qcd_bctoept20_30 = 0.40e9;
45     double xsec_qcd_bctoept30_80 = 0.10e9;
46     double xsec_qcd_bctoept80_170 = 1.9e6;
47     double xsec_qcd_empt20_30 = 0.40e9;
48     double xsec_qcd_empt30_80 = 0.10e9;
49     double xsec_qcd_empt80_170 = 1.9e6;
50    
51     double eff_gen_ttbar = 1.0;
52     double eff_gen_w = 1.0;
53     double eff_gen_z = 1.0;
54     double eff_gen_qcd_bctoept20_30 = 4.8e-4;
55     double eff_gen_qcd_bctoept30_80 = 2.4e-3;
56     double eff_gen_qcd_bctoept80_170 = 0.012;
57     double eff_gen_qcd_empt20_30 = 0.0080;
58     double eff_gen_qcd_empt30_80 = 0.047;
59     double eff_gen_qcd_empt80_170 = 0.15;
60    
61     Long64_t n_processed_ttbar = 1018322;
62     Long64_t n_processed_w = 100529384; // Fastsim
63     Long64_t n_processed_z = 9679459; // Fastsim
64     Long64_t n_processed_qcd_bctoept20_30 = 1997072;
65     Long64_t n_processed_qcd_bctoept30_80 = 2016487;
66     Long64_t n_processed_qcd_bctoept80_170 = 809704;
67     Long64_t n_processed_qcd_empt20_30 = 19919765;
68     Long64_t n_processed_qcd_empt30_80 = 38298918;
69     Long64_t n_processed_qcd_empt80_170 = 5706169;
70    
71     cout << "Selecting events..." << endl;
72     Long64_t n_selected_ttbar = chain_ttbar -> Draw("event", the_cut);
73     Long64_t n_selected_w = chain_wjets -> Draw("event", the_cut);
74     Long64_t n_selected_z = chain_zjets -> Draw("event", the_cut);
75     Long64_t n_selected_qcd_bctoept20_30 = chain_qcd_bctoept20_30 -> Draw("event", the_cut);
76     Long64_t n_selected_qcd_bctoept30_80 = chain_qcd_bctoept30_80 -> Draw("event", the_cut);
77     Long64_t n_selected_qcd_bctoept80_170 = chain_qcd_bctoept80_170 -> Draw("event", the_cut);
78     Long64_t n_selected_qcd_empt20_30 = chain_qcd_empt20_30 -> Draw("event", the_cut);
79     Long64_t n_selected_qcd_empt30_80 = chain_qcd_empt30_80 -> Draw("event", the_cut);
80     Long64_t n_selected_qcd_empt80_170 = chain_qcd_empt80_170 -> Draw("event", the_cut);
81    
82     double eff_sel_ttbar = (double)n_selected_ttbar/(double)n_processed_ttbar;
83     double eff_sel_w = (double)n_selected_w/(double)n_processed_w;
84     double eff_sel_z = (double)n_selected_z/(double)n_processed_z;
85     double eff_sel_qcd_bctoept20_30 = (double)n_selected_qcd_bctoept20_30/(double)n_processed_qcd_bctoept20_30;
86     double eff_sel_qcd_bctoept30_80 = (double)n_selected_qcd_bctoept30_80/(double)n_processed_qcd_bctoept30_80;
87     double eff_sel_qcd_bctoept80_170 = (double)n_selected_qcd_bctoept80_170/(double)n_processed_qcd_bctoept80_170;
88     double eff_sel_qcd_empt20_30 = (double)n_selected_qcd_empt20_30/(double)n_processed_qcd_empt20_30;
89     double eff_sel_qcd_empt30_80 = (double)n_selected_qcd_empt30_80/(double)n_processed_qcd_empt30_80;
90     double eff_sel_qcd_empt80_170 = (double)n_selected_qcd_empt80_170/(double)n_processed_qcd_empt80_170;
91    
92     double n_expected_ttbar = xsec_ttbar * eff_gen_ttbar * eff_sel_ttbar * lumi;
93     double n_expected_w = xsec_w * eff_gen_w * eff_sel_w * lumi;
94     double n_expected_z = xsec_z * eff_gen_z * eff_sel_z * lumi;
95     double n_expected_qcd_bctoept20_30 = xsec_qcd_bctoept20_30 * eff_gen_qcd_bctoept20_30 * eff_sel_qcd_bctoept20_30 * lumi;
96     double n_expected_qcd_bctoept30_80 = xsec_qcd_bctoept30_80 * eff_gen_qcd_bctoept30_80 * eff_sel_qcd_bctoept30_80 * lumi;
97     double n_expected_qcd_bctoept80_170 = xsec_qcd_bctoept80_170 * eff_gen_qcd_bctoept80_170 * eff_sel_qcd_bctoept80_170 * lumi;
98     double n_expected_qcd_empt20_30 = xsec_qcd_empt20_30 * eff_gen_qcd_empt20_30 * eff_sel_qcd_empt20_30 * lumi;
99     double n_expected_qcd_empt30_80 = xsec_qcd_empt30_80 * eff_gen_qcd_empt30_80 * eff_sel_qcd_empt30_80 * lumi;
100     double n_expected_qcd_empt80_170 = xsec_qcd_empt80_170 * eff_gen_qcd_empt80_170 * eff_sel_qcd_empt80_170 * lumi;
101    
102     double n_expected_all = n_expected_ttbar + n_expected_w + n_expected_z + n_expected_qcd_bctoept20_30 + n_expected_qcd_bctoept30_80 + n_expected_qcd_bctoept80_170 + n_expected_qcd_empt20_30 + n_expected_qcd_empt30_80 + n_expected_qcd_empt80_170;
103     double n_expected_phys = n_expected_ttbar + n_expected_w + n_expected_z;
104    
105     //
106     // _____ mixing QCD ___________________________________________________
107     //
108     double eff_lumi_ttbar = n_processed_ttbar/xsec_ttbar/eff_gen_ttbar;
109     double eff_lumi_w = n_processed_w/xsec_w/eff_gen_w;
110     double eff_lumi_z = n_processed_z/xsec_z/eff_gen_z;
111     double eff_lumi_qcd_bctoept20_30 = n_processed_qcd_bctoept20_30/xsec_qcd_bctoept20_30/eff_gen_qcd_bctoept20_30;
112     double eff_lumi_qcd_bctoept30_80 = n_processed_qcd_bctoept30_80/xsec_qcd_bctoept30_80/eff_gen_qcd_bctoept30_80;
113     double eff_lumi_qcd_bctoept80_170 = n_processed_qcd_bctoept80_170/xsec_qcd_bctoept80_170/eff_gen_qcd_bctoept80_170;
114     double eff_lumi_qcd_empt20_30 = n_processed_qcd_empt20_30/xsec_qcd_empt20_30/eff_gen_qcd_empt20_30;
115     double eff_lumi_qcd_empt30_80 = n_processed_qcd_empt30_80/xsec_qcd_empt30_80/eff_gen_qcd_empt30_80;
116     double eff_lumi_qcd_empt80_170 = n_processed_qcd_empt80_170/xsec_qcd_empt80_170/eff_gen_qcd_empt80_170;
117     //
118     //double n_template_ttbar = (double)n_selected_ttbar*eff_lumi_qcd_empt20_30/eff_lumi_ttbar;
119     //double n_template_w = (double)n_selected_w*eff_lumi_qcd_empt20_30/eff_lumi_w;
120     //double n_template_z = (double)n_selected_z*eff_lumi_qcd_empt20_30/eff_lumi_z;
121     double n_template_qcd_bctoept20_30 = (double)n_selected_qcd_bctoept20_30*eff_lumi_qcd_empt20_30/eff_lumi_qcd_bctoept20_30;
122     double n_template_qcd_bctoept30_80 = (double)n_selected_qcd_bctoept30_80*eff_lumi_qcd_empt20_30/eff_lumi_qcd_bctoept30_80;
123     double n_template_qcd_bctoept80_170 = (double)n_selected_qcd_bctoept80_170*eff_lumi_qcd_empt20_30/eff_lumi_qcd_bctoept80_170;
124     double n_template_qcd_empt20_30 = (double)n_selected_qcd_empt20_30*eff_lumi_qcd_empt20_30/eff_lumi_qcd_empt20_30;
125     double n_template_qcd_empt30_80 = (double)n_selected_qcd_empt30_80*eff_lumi_qcd_empt20_30/eff_lumi_qcd_empt30_80;
126     double n_template_qcd_empt80_170 = (double)n_selected_qcd_empt80_170*eff_lumi_qcd_empt20_30/eff_lumi_qcd_empt80_170;
127    
128    
129    
130     cout << endl << "Selection efficiency, ttbar events: " << eff_sel_ttbar << endl;
131     cout << "Selected ttbar events: " << n_selected_ttbar << endl;
132     cout << "Expected ttbar events: " << n_expected_ttbar << endl;
133     cout << "Effective ttbar lumi: " << eff_lumi_ttbar << endl;
134     cout << endl << "Selection efficiency, w events: " << eff_sel_w << endl;
135     cout << "Selected w events: " << n_selected_w << endl;
136     cout << "Expected w events: " << n_expected_w << endl;
137     cout << "Effective w lumi: " << eff_lumi_w << endl;
138     cout << endl << "Selection efficiency, z events: " << eff_sel_z << endl;
139     cout << "Selected z events: " << n_selected_z << endl;
140     cout << "Expected z events: " << n_expected_z << endl;
141     cout << "Effective z lumi: " << eff_lumi_z << endl;
142    
143 kukartse 1.4 cout << endl << "Selected qcd events: " << n_selected_qcd_empt20_30+n_selected_qcd_empt30_80+n_selected_qcd_empt80_170+n_selected_qcd_bctoept20_30+n_selected_qcd_bctoept30_80+n_selected_qcd_bctoept80_170 << endl;
144     cout << "Expected qcd events: " << n_expected_qcd_empt20_30+n_expected_qcd_empt30_80+n_expected_qcd_empt80_170+n_expected_qcd_bctoept20_30+n_expected_qcd_bctoept30_80+n_expected_qcd_bctoept80_170 << endl;
145     cout << "Events for the template: " << n_template_qcd_empt20_30+n_template_qcd_empt30_80+n_template_qcd_empt80_170+n_template_qcd_bctoept20_30+n_template_qcd_bctoept30_80+n_template_qcd_bctoept80_170 << endl;
146    
147 kukartse 1.1 cout << endl << "Selection efficiency, qcd_bctoept20_30 events: " << eff_sel_qcd_bctoept20_30 << endl;
148     cout << "Selected qcd_bctoept20_30 events: " << n_selected_qcd_bctoept20_30 << endl;
149     cout << "Expected qcd_bctoept20_30 events: " << n_expected_qcd_bctoept20_30 << endl;
150     cout << "Effective qcd_bctoept20_30 lumi: " << eff_lumi_qcd_bctoept20_30 << endl;
151     cout << "Events for the template: " << n_template_qcd_bctoept20_30 << endl;
152     cout << endl << "Selection efficiency, qcd_bctoept30_80 events: " << eff_sel_qcd_bctoept30_80 << endl;
153     cout << "Selected qcd_bctoept30_80 events: " << n_selected_qcd_bctoept30_80 << endl;
154     cout << "Expected qcd_bctoept30_80 events: " << n_expected_qcd_bctoept30_80 << endl;
155     cout << "Effective qcd_bctoept30_80 lumi: " << eff_lumi_qcd_bctoept30_80 << endl;
156     cout << "Events for the template: " << n_template_qcd_bctoept30_80 << endl;
157     cout << endl << "Selection efficiency, qcd_bctoept80_170 events: " << eff_sel_qcd_bctoept80_170 << endl;
158     cout << "Selected qcd_bctoept80_170 events: " << n_selected_qcd_bctoept80_170 << endl;
159     cout << "Expected qcd_bctoept80_170 events: " << n_expected_qcd_bctoept80_170 << endl;
160     cout << "Effective qcd_bctoept80_170 lumi: " << eff_lumi_qcd_bctoept80_170 << endl;
161     cout << "Events for the template: " << n_template_qcd_bctoept80_170 << endl;
162    
163     cout << endl << "Selection efficiency, qcd_empt20_30 events: " << eff_sel_qcd_empt20_30 << endl;
164     cout << "Selected qcd_empt20_30 events: " << n_selected_qcd_empt20_30 << endl;
165     cout << "Expected qcd_empt20_30 events: " << n_expected_qcd_empt20_30 << endl;
166     cout << "Effective qcd_empt20_30 lumi: " << eff_lumi_qcd_empt20_30 << endl;
167     cout << "Events for the template: " << n_template_qcd_empt20_30 << endl;
168     cout << endl << "Selection efficiency, qcd_empt30_80 events: " << eff_sel_qcd_empt30_80 << endl;
169     cout << "Selected qcd_empt30_80 events: " << n_selected_qcd_empt30_80 << endl;
170     cout << "Expected qcd_empt30_80 events: " << n_expected_qcd_empt30_80 << endl;
171     cout << "Effective qcd_empt30_80 lumi: " << eff_lumi_qcd_empt30_80 << endl;
172     cout << "Events for the template: " << n_template_qcd_empt30_80 << endl;
173     cout << endl << "Selection efficiency, qcd_empt80_170 events: " << eff_sel_qcd_empt80_170 << endl;
174     cout << "Selected qcd_empt80_170 events: " << n_selected_qcd_empt80_170 << endl;
175     cout << "Expected qcd_empt80_170 events: " << n_expected_qcd_empt80_170 << endl;
176     cout << "Effective qcd_empt80_170 lumi: " << eff_lumi_qcd_empt80_170 << endl;
177     cout << "Events for the template: " << n_template_qcd_empt80_170 << endl;
178    
179     cout << endl << "Total events expected: " << n_expected_all << endl;
180     cout << "Ttbar,W,Z+jets events expected: " << n_expected_phys << endl;
181    
182    
183    
184     }
185    
186