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