ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/root/qcd_purity_electron.C
Revision: 1.2
Committed: Fri May 1 07:54:09 2009 UTC (16 years ago) by kukartse
Content type: text/plain
Branch: MAIN
Changes since 1.1: +9 -5 lines
Log Message:
electron channel fit updates

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.2 //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     //the_cut = cut3_rev_electrons;
34     the_cut = cut3_electrons;
35     //the_cut="";
36    
37     double lumi = 20.0;
38    
39     double xsec_ttbar = 317.0; //pb
40     double xsec_w = 40000.0;
41     double xsec_z = 3700.0;
42     double xsec_qcd_bctoept20_30 = 0.40e9;
43     double xsec_qcd_bctoept30_80 = 0.10e9;
44     double xsec_qcd_bctoept80_170 = 1.9e6;
45     double xsec_qcd_empt20_30 = 0.40e9;
46     double xsec_qcd_empt30_80 = 0.10e9;
47     double xsec_qcd_empt80_170 = 1.9e6;
48    
49     double eff_gen_ttbar = 1.0;
50     double eff_gen_w = 1.0;
51     double eff_gen_z = 1.0;
52     double eff_gen_qcd_bctoept20_30 = 4.8e-4;
53     double eff_gen_qcd_bctoept30_80 = 2.4e-3;
54     double eff_gen_qcd_bctoept80_170 = 0.012;
55     double eff_gen_qcd_empt20_30 = 0.0080;
56     double eff_gen_qcd_empt30_80 = 0.047;
57     double eff_gen_qcd_empt80_170 = 0.15;
58    
59     Long64_t n_processed_ttbar = 1018322;
60     Long64_t n_processed_w = 100529384; // Fastsim
61     Long64_t n_processed_z = 9679459; // Fastsim
62     Long64_t n_processed_qcd_bctoept20_30 = 1997072;
63     Long64_t n_processed_qcd_bctoept30_80 = 2016487;
64     Long64_t n_processed_qcd_bctoept80_170 = 809704;
65     Long64_t n_processed_qcd_empt20_30 = 19919765;
66     Long64_t n_processed_qcd_empt30_80 = 38298918;
67     Long64_t n_processed_qcd_empt80_170 = 5706169;
68    
69     cout << "Selecting events..." << endl;
70     Long64_t n_selected_ttbar = chain_ttbar -> Draw("event", the_cut);
71     Long64_t n_selected_w = chain_wjets -> Draw("event", the_cut);
72     Long64_t n_selected_z = chain_zjets -> Draw("event", the_cut);
73     Long64_t n_selected_qcd_bctoept20_30 = chain_qcd_bctoept20_30 -> Draw("event", the_cut);
74     Long64_t n_selected_qcd_bctoept30_80 = chain_qcd_bctoept30_80 -> Draw("event", the_cut);
75     Long64_t n_selected_qcd_bctoept80_170 = chain_qcd_bctoept80_170 -> Draw("event", the_cut);
76     Long64_t n_selected_qcd_empt20_30 = chain_qcd_empt20_30 -> Draw("event", the_cut);
77     Long64_t n_selected_qcd_empt30_80 = chain_qcd_empt30_80 -> Draw("event", the_cut);
78     Long64_t n_selected_qcd_empt80_170 = chain_qcd_empt80_170 -> Draw("event", the_cut);
79    
80     double eff_sel_ttbar = (double)n_selected_ttbar/(double)n_processed_ttbar;
81     double eff_sel_w = (double)n_selected_w/(double)n_processed_w;
82     double eff_sel_z = (double)n_selected_z/(double)n_processed_z;
83     double eff_sel_qcd_bctoept20_30 = (double)n_selected_qcd_bctoept20_30/(double)n_processed_qcd_bctoept20_30;
84     double eff_sel_qcd_bctoept30_80 = (double)n_selected_qcd_bctoept30_80/(double)n_processed_qcd_bctoept30_80;
85     double eff_sel_qcd_bctoept80_170 = (double)n_selected_qcd_bctoept80_170/(double)n_processed_qcd_bctoept80_170;
86     double eff_sel_qcd_empt20_30 = (double)n_selected_qcd_empt20_30/(double)n_processed_qcd_empt20_30;
87     double eff_sel_qcd_empt30_80 = (double)n_selected_qcd_empt30_80/(double)n_processed_qcd_empt30_80;
88     double eff_sel_qcd_empt80_170 = (double)n_selected_qcd_empt80_170/(double)n_processed_qcd_empt80_170;
89    
90     double n_expected_ttbar = xsec_ttbar * eff_gen_ttbar * eff_sel_ttbar * lumi;
91     double n_expected_w = xsec_w * eff_gen_w * eff_sel_w * lumi;
92     double n_expected_z = xsec_z * eff_gen_z * eff_sel_z * lumi;
93     double n_expected_qcd_bctoept20_30 = xsec_qcd_bctoept20_30 * eff_gen_qcd_bctoept20_30 * eff_sel_qcd_bctoept20_30 * lumi;
94     double n_expected_qcd_bctoept30_80 = xsec_qcd_bctoept30_80 * eff_gen_qcd_bctoept30_80 * eff_sel_qcd_bctoept30_80 * lumi;
95     double n_expected_qcd_bctoept80_170 = xsec_qcd_bctoept80_170 * eff_gen_qcd_bctoept80_170 * eff_sel_qcd_bctoept80_170 * lumi;
96     double n_expected_qcd_empt20_30 = xsec_qcd_empt20_30 * eff_gen_qcd_empt20_30 * eff_sel_qcd_empt20_30 * lumi;
97     double n_expected_qcd_empt30_80 = xsec_qcd_empt30_80 * eff_gen_qcd_empt30_80 * eff_sel_qcd_empt30_80 * lumi;
98     double n_expected_qcd_empt80_170 = xsec_qcd_empt80_170 * eff_gen_qcd_empt80_170 * eff_sel_qcd_empt80_170 * lumi;
99    
100     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;
101     double n_expected_phys = n_expected_ttbar + n_expected_w + n_expected_z;
102    
103     //
104     // _____ mixing QCD ___________________________________________________
105     //
106     double eff_lumi_ttbar = n_processed_ttbar/xsec_ttbar/eff_gen_ttbar;
107     double eff_lumi_w = n_processed_w/xsec_w/eff_gen_w;
108     double eff_lumi_z = n_processed_z/xsec_z/eff_gen_z;
109     double eff_lumi_qcd_bctoept20_30 = n_processed_qcd_bctoept20_30/xsec_qcd_bctoept20_30/eff_gen_qcd_bctoept20_30;
110     double eff_lumi_qcd_bctoept30_80 = n_processed_qcd_bctoept30_80/xsec_qcd_bctoept30_80/eff_gen_qcd_bctoept30_80;
111     double eff_lumi_qcd_bctoept80_170 = n_processed_qcd_bctoept80_170/xsec_qcd_bctoept80_170/eff_gen_qcd_bctoept80_170;
112     double eff_lumi_qcd_empt20_30 = n_processed_qcd_empt20_30/xsec_qcd_empt20_30/eff_gen_qcd_empt20_30;
113     double eff_lumi_qcd_empt30_80 = n_processed_qcd_empt30_80/xsec_qcd_empt30_80/eff_gen_qcd_empt30_80;
114     double eff_lumi_qcd_empt80_170 = n_processed_qcd_empt80_170/xsec_qcd_empt80_170/eff_gen_qcd_empt80_170;
115     //
116     //double n_template_ttbar = (double)n_selected_ttbar*eff_lumi_qcd_empt20_30/eff_lumi_ttbar;
117     //double n_template_w = (double)n_selected_w*eff_lumi_qcd_empt20_30/eff_lumi_w;
118     //double n_template_z = (double)n_selected_z*eff_lumi_qcd_empt20_30/eff_lumi_z;
119     double n_template_qcd_bctoept20_30 = (double)n_selected_qcd_bctoept20_30*eff_lumi_qcd_empt20_30/eff_lumi_qcd_bctoept20_30;
120     double n_template_qcd_bctoept30_80 = (double)n_selected_qcd_bctoept30_80*eff_lumi_qcd_empt20_30/eff_lumi_qcd_bctoept30_80;
121     double n_template_qcd_bctoept80_170 = (double)n_selected_qcd_bctoept80_170*eff_lumi_qcd_empt20_30/eff_lumi_qcd_bctoept80_170;
122     double n_template_qcd_empt20_30 = (double)n_selected_qcd_empt20_30*eff_lumi_qcd_empt20_30/eff_lumi_qcd_empt20_30;
123     double n_template_qcd_empt30_80 = (double)n_selected_qcd_empt30_80*eff_lumi_qcd_empt20_30/eff_lumi_qcd_empt30_80;
124     double n_template_qcd_empt80_170 = (double)n_selected_qcd_empt80_170*eff_lumi_qcd_empt20_30/eff_lumi_qcd_empt80_170;
125    
126    
127    
128     cout << endl << "Selection efficiency, ttbar events: " << eff_sel_ttbar << endl;
129     cout << "Selected ttbar events: " << n_selected_ttbar << endl;
130     cout << "Expected ttbar events: " << n_expected_ttbar << endl;
131     cout << "Effective ttbar lumi: " << eff_lumi_ttbar << endl;
132     cout << endl << "Selection efficiency, w events: " << eff_sel_w << endl;
133     cout << "Selected w events: " << n_selected_w << endl;
134     cout << "Expected w events: " << n_expected_w << endl;
135     cout << "Effective w lumi: " << eff_lumi_w << endl;
136     cout << endl << "Selection efficiency, z events: " << eff_sel_z << endl;
137     cout << "Selected z events: " << n_selected_z << endl;
138     cout << "Expected z events: " << n_expected_z << endl;
139     cout << "Effective z lumi: " << eff_lumi_z << endl;
140    
141     cout << endl << "Selection efficiency, qcd_bctoept20_30 events: " << eff_sel_qcd_bctoept20_30 << endl;
142     cout << "Selected qcd_bctoept20_30 events: " << n_selected_qcd_bctoept20_30 << endl;
143     cout << "Expected qcd_bctoept20_30 events: " << n_expected_qcd_bctoept20_30 << endl;
144     cout << "Effective qcd_bctoept20_30 lumi: " << eff_lumi_qcd_bctoept20_30 << endl;
145     cout << "Events for the template: " << n_template_qcd_bctoept20_30 << endl;
146     cout << endl << "Selection efficiency, qcd_bctoept30_80 events: " << eff_sel_qcd_bctoept30_80 << endl;
147     cout << "Selected qcd_bctoept30_80 events: " << n_selected_qcd_bctoept30_80 << endl;
148     cout << "Expected qcd_bctoept30_80 events: " << n_expected_qcd_bctoept30_80 << endl;
149     cout << "Effective qcd_bctoept30_80 lumi: " << eff_lumi_qcd_bctoept30_80 << endl;
150     cout << "Events for the template: " << n_template_qcd_bctoept30_80 << endl;
151     cout << endl << "Selection efficiency, qcd_bctoept80_170 events: " << eff_sel_qcd_bctoept80_170 << endl;
152     cout << "Selected qcd_bctoept80_170 events: " << n_selected_qcd_bctoept80_170 << endl;
153     cout << "Expected qcd_bctoept80_170 events: " << n_expected_qcd_bctoept80_170 << endl;
154     cout << "Effective qcd_bctoept80_170 lumi: " << eff_lumi_qcd_bctoept80_170 << endl;
155     cout << "Events for the template: " << n_template_qcd_bctoept80_170 << endl;
156    
157     cout << endl << "Selection efficiency, qcd_empt20_30 events: " << eff_sel_qcd_empt20_30 << endl;
158     cout << "Selected qcd_empt20_30 events: " << n_selected_qcd_empt20_30 << endl;
159     cout << "Expected qcd_empt20_30 events: " << n_expected_qcd_empt20_30 << endl;
160     cout << "Effective qcd_empt20_30 lumi: " << eff_lumi_qcd_empt20_30 << endl;
161     cout << "Events for the template: " << n_template_qcd_empt20_30 << endl;
162     cout << endl << "Selection efficiency, qcd_empt30_80 events: " << eff_sel_qcd_empt30_80 << endl;
163     cout << "Selected qcd_empt30_80 events: " << n_selected_qcd_empt30_80 << endl;
164     cout << "Expected qcd_empt30_80 events: " << n_expected_qcd_empt30_80 << endl;
165     cout << "Effective qcd_empt30_80 lumi: " << eff_lumi_qcd_empt30_80 << endl;
166     cout << "Events for the template: " << n_template_qcd_empt30_80 << endl;
167     cout << endl << "Selection efficiency, qcd_empt80_170 events: " << eff_sel_qcd_empt80_170 << endl;
168     cout << "Selected qcd_empt80_170 events: " << n_selected_qcd_empt80_170 << endl;
169     cout << "Expected qcd_empt80_170 events: " << n_expected_qcd_empt80_170 << endl;
170     cout << "Effective qcd_empt80_170 lumi: " << eff_lumi_qcd_empt80_170 << endl;
171     cout << "Events for the template: " << n_template_qcd_empt80_170 << endl;
172    
173     cout << endl << "Total events expected: " << n_expected_all << endl;
174     cout << "Ttbar,W,Z+jets events expected: " << n_expected_phys << endl;
175    
176    
177    
178     }
179    
180