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