ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/root/make_fake_data.C
Revision: 1.10
Committed: Tue Mar 30 01:32:32 2010 UTC (15 years, 1 month ago) by msegala
Content type: text/plain
Branch: MAIN
CVS Tags: V00-03-01, ZMorph_BASE_20100408, gak040610_morphing, HEAD
Branch point for: ZMorph-V00-03-01
Changes since 1.9: +279 -52 lines
Error occurred while calculating annotation data.
Log Message:
msegala32910

File Contents

# Content
1 {
2 //TChain ch_ttbar("mva/ttljets");
3 TChain ch_ttbar("ttljets");
4 TChain ch_w("ttljets");
5 TChain ch_z("ttljets");
6 TChain ch_tW("ttljets"); // single top
7 TChain ch_t("ttljets"); // single top
8 TChain ch_s("ttljets"); // single top
9 //TChain ch_qcd("ttljets");
10
11 /***********************************
12 //
13 // For Min Numer of JETS = 4
14 //
15 ***********************************/
16
17
18 //ch_ttbar . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/TTbar-madgraph_Summer09_7TeV/all.root");
19
20 //Nominal, jet pt > 30
21 //ch_w . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MuonSwitchScaledMassJes10FullVariableList/NoMuonSwitch/WJets/all.root");
22
23 //jet pt > 20
24 //ch_w . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MuonSwitchScaledMassJes10FullVariableList/NoMuonSwitch/WJets_Jetpt20/all.root"); //USE THIS ONE
25
26 //Nominal, 1 muon required, jet pt > 30
27 //ch_z . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/ZJets-madgraph_Summer09_7TeV/all.root");
28
29 //2 muons required, jet pt>20 //USE THIS ONE
30 // ch_z . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/ZJets-madgraph_Summer09_7TeV_JetPt20/all.root");
31 //
32 // ch_t . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/SingleTop_tChannel-madgraph_Summer09_7TeV/all.root");
33 // ch_tW. Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/SingleTop_tWChannel-madgraph_Summer09_7TeV/all.root");
34 // ch_s . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/SingleTop_sChannel-madgraph_Summer09_7TeV/all.root");
35 //
36 //ch_qcd . Add("InclusiveMuPt15_Summer08_IDEAL_V9_v1_14may2009.root");
37
38
39
40 /***********************************
41 //
42 // For Min Numer of JETS = 3
43 //
44 ***********************************/
45
46 /*
47 ch_ttbar . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/TTbar-madgraph_Summer09_7TeV/all.root");
48
49 ch_w . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MuonSwitchScaledMassJes10FullVariableList/MinNumberofJets3/NoMuonSwitch/WJets_Jetpt20/all.root");
50
51 ch_z . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/ZJets-madgraph_Summer09_7TeV_JetPt20/all.root");
52
53 ch_t . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/SingleTop_tChannel-madgraph_Summer09_7TeV/all.root");
54 ch_tW. Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/SingleTop_tWChannel-madgraph_Summer09_7TeV/all.root");
55 ch_s . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/SingleTop_sChannel-madgraph_Summer09_7TeV/all.root");
56
57 */
58
59
60 /***********************************
61 //
62 // For Min Numer of JETS = 2
63 //
64 ***********************************/
65
66 /*
67 ch_ttbar . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets2/TTbar-madgraph_Summer09_7TeV/all.root");
68
69 ch_w . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MuonSwitchScaledMassJes10FullVariableList/MinNumberofJets2/NoMuonSwitch/WJets_Jetpt20/all.root");
70
71 ch_z . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets2/ZJets-madgraph_Summer09_7TeV_JetPt20/all.root");
72
73 ch_t . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets2/SingleTop_tChannel-madgraph_Summer09_7TeV/all.root");
74 ch_tW. Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets2/SingleTop_tWChannel-madgraph_Summer09_7TeV/all.root");
75 ch_s . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets2/SingleTop_sChannel-madgraph_Summer09_7TeV/all.root");
76
77 */
78
79
80
81
82
83 /***********************************
84 //
85 // For Min Numer of JETS = 3, Z Mass Morphing Allpied
86 //
87 ***********************************/
88
89
90 ch_ttbar . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/TTbar-madgraph_Summer09_7TeV/all.root");
91 ch_w . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MuonSwitchScaledMassJes10FullVariableList/MinNumberofJets3/NoMuonSwitch/WJets_Jetpt20/all.root");
92 ch_z . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/ZJets-madgraph_Summer09_7TeV_JetPt20/all.root");
93 ch_t . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/SingleTop_tChannel-madgraph_Summer09_7TeV/all.root");
94 ch_tW. Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/SingleTop_tWChannel-madgraph_Summer09_7TeV/all.root");
95 ch_s . Add("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/SingleTop_sChannel-madgraph_Summer09_7TeV/all.root");
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111 // selection
112 #include "cuts.C"
113 the_cut = cut4;
114 the_cut_Z = cut4Z;
115 //the_cut = cut4_abcd;
116 TCut the_qcd_cut = cut4_qcd;
117
118 // when copying, include all branches
119 ch_ttbar . SetBranchStatus("*",1);
120 ch_w . SetBranchStatus("*",1);
121 ch_z . SetBranchStatus("*",1);
122 ch_t . SetBranchStatus("*",1);
123 ch_tW. SetBranchStatus("*",1);
124 ch_s . SetBranchStatus("*",1);
125 //ch_qcd . SetBranchStatus("*",1);
126
127 // create new TTrees from the input
128 TTree * t_sig = ch_ttbar . CopyTree(the_cut);
129 TTree * t_wjets = ch_w . CopyTree(the_cut);
130 TTree * t_zjets = ch_z . CopyTree(the_cut_Z); //Required 2 muons, jet pt > 20, invarant mass cut
131 TTree * t_t = ch_t . CopyTree(the_cut);
132 TTree * t_tW = ch_tW . CopyTree(the_cut);
133 TTree * t_s = ch_s . CopyTree(the_cut);
134 //TTree * t_qcd = ch_qcd . CopyTree(the_cut);
135 //TTree * t_qcd = ch_qcd . CopyTree(the_qcd_cut);
136
137
138
139 /***********************************
140 //
141 // For Min Numer of JETS = 4
142 //
143 ***********************************/
144
145
146 //
147 //_____ 20/pb data for 7TeV____________________________________________
148 //
149 /*
150 TTree * _data = t_sig->CopyTree("","",23,0);
151 TTree * _wjets = t_wjets->CopyTree("","",19,0);
152 TTree * _zjets = t_zjets->CopyTree("","",5,0);
153 TTree * _t = t_t ->CopyTree("","",2,0);
154 TTree * _tW = t_tW->CopyTree("","",1,0);
155 TTree * _s = t_s ->CopyTree("","",0,0);
156 //TTree * _qcd = t_qcd->CopyTree("","",,0);
157 */
158
159 /*
160 //
161 //_____ 200/pb data for 7TeV____________________________________________
162 //
163 TTree * _data = t_sig->CopyTree("","",1884,0);
164 //TTree * _wjets = t_wjets->CopyTree("","",635,0); //jet pt > 30
165 TTree * _wjets = t_wjets->CopyTree("","",2402,0); //jet pt >20 , must use if jet pt > 20 for ZJets!!!!!!!!!
166 TTree * _zjets = t_zjets->CopyTree("","",290,0); //Required 2 muons, jet pt > 20, invarant mass cut
167 TTree * _t = t_t ->CopyTree("","",24,0);
168 TTree * _tW = t_tW->CopyTree("","",44,0);
169 TTree * _s = t_s ->CopyTree("","",1,0);
170 //TTree * _qcd = t_qcd->CopyTree("","",,0);
171
172 */
173
174
175 //
176 //_____ 1/fb data for 7TeV____________________________________________
177 //
178 /*
179 TTree * _data = t_sig->CopyTree("","",1133,0);
180 TTree * _wjets = t_wjets->CopyTree("","",944,0);
181 TTree * _zjets = t_zjets->CopyTree("","",229,0);
182 TTree * _t = t_t ->CopyTree("","",116,0);
183 TTree * _tW = t_tW->CopyTree("","",69,0);
184 TTree * _s = t_s ->CopyTree("","",2,0);
185 //TTree * _qcd = t_qcd->CopyTree("","",,0);
186 */
187
188
189
190
191
192
193 /***********************************
194 //
195 // For Min Numer of JETS = 3
196 //
197 ***********************************/
198
199 //
200 //_____ 20/pb data for 7TeV____________________________________________
201 //
202 /*
203 TTree * _data = t_sig->CopyTree("","",352,0);
204 TTree * _wjets = t_wjets->CopyTree("","",1046,0);
205 TTree * _zjets = t_zjets->CopyTree("","",124,0);
206 TTree * _t = t_t ->CopyTree("","",9,0);
207 TTree * _tW = t_tW->CopyTree("","",13,0);
208 TTree * _s = t_s ->CopyTree("","",1,0);
209 //TTree * _qcd = t_qcd->CopyTree("","",,0);
210 */
211
212
213
214
215 //
216 //_____ 200/pb data for 7TeV, Z Mass Morphing Method Applied____________________________________________
217 //
218 /*
219 TTree * _data = t_sig->CopyTree("","",3110,0);
220 TTree * _wjets = t_wjets->CopyTree("","",12206,0);
221 TTree * _zjets = t_zjets->CopyTree("","",1513,0);
222 TTree * _t = t_t ->CopyTree("","",93,0);
223 TTree * _tW = t_tW->CopyTree("","",123,0);
224 TTree * _s = t_s ->CopyTree("","",9,0);
225 //TTree * _qcd = t_qcd->CopyTree("","",,0);
226 */
227
228
229 //For Lepton to Neutrino Switch
230
231 TTree * _data = t_sig->CopyTree("","",473,0);
232 TTree * _wjets = t_wjets->CopyTree("","",1858,0);
233 TTree * _zjets = t_zjets->CopyTree("","",230,0);
234 TTree * _t = t_t ->CopyTree("","",14,0);
235 TTree * _tW = t_tW->CopyTree("","",18,0);
236 TTree * _s = t_s ->CopyTree("","",1,0);
237
238
239
240 /***********************************
241 //
242 // For Min Numer of JETS = 2
243 //
244 ***********************************/
245
246 //
247 //_____ 20/pb data for 7TeV____________________________________________
248 //
249 /*
250 TTree * _data = t_sig->CopyTree("","",452,0);
251 TTree * _wjets = t_wjets->CopyTree("","",4582,0);
252 TTree * _zjets = t_zjets->CopyTree("","",505,0);
253 TTree * _t = t_t ->CopyTree("","",37,0);
254 TTree * _tW = t_tW->CopyTree("","",23,0);
255 TTree * _s = t_s ->CopyTree("","",2,0);
256 //TTree * _qcd = t_qcd->CopyTree("","",,0);
257 */
258
259
260
261
262
263
264
265
266 //
267 //_____ for abcd: check n qcd in the signal region ____________________
268 //
269 //Long64_t _nqcd = _qcd -> Draw("event", cut4);
270 //cout << "True N of QCD events in the signal region: " << _nqcd << endl;
271
272 //
273 _data -> CopyAddresses(_wjets);
274 _data -> CopyEntries(_wjets);
275 _data -> CopyAddresses(_zjets);
276 _data -> CopyEntries(_zjets);
277 _data -> CopyAddresses(_t);
278 _data -> CopyEntries(_t);
279 _data -> CopyAddresses(_tW);
280 _data -> CopyEntries(_tW);
281 _data -> CopyAddresses(_s);
282 _data -> CopyEntries(_s);
283 //_data -> CopyAddresses(_qcd);
284 //_data -> CopyEntries(_qcd);
285
286
287 // define new TTree names
288 _data.SetName("data");
289
290 // output file
291
292 //20 pb-1. 7TeV, FOR MIN NUMBER OF JETS = 4
293 //TFile * out_file = new TFile("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/20pbTemplates/fake_data_20pb-7TeV.root", "RECREATE");
294
295 //TFile * out_file = new TFile("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/200pbTemplates/fake_data_200pb-7TeV.root", "RECREATE");
296
297 //TFile * out_file = new TFile("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/1fbTemplates/fake_data_1fb-7TeV.root", "RECREATE");
298
299
300
301 //FOR MIN NUMBER OF JETS = 3
302
303 //TFile * out_file = new TFile("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/20pbTemplates/fake_data_20pb-7TeV.root", "RECREATE");
304
305
306
307 //FOR MIN NUMBER OF JETS = 3, Z Mass Method Applied
308
309 //TFile * out_file = new TFile("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/200pbTemplates/fake_data_200pb-7TeVZMassMethod.root", "RECREATE");
310
311 //For Lepton to Neutrino switch
312
313 TFile * out_file = new TFile("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets3/200pbTemplates/fake_data_200pb-7TeVZMassMethodLeponToNeutrinoSwitch.root", "RECREATE");
314
315
316
317
318
319 //FOR MIN NUMBER OF JETS = 2
320
321 //TFile * out_file = new TFile("/uscms_data/d2/mike1886/LeptonNeutrinoSwitch/AnalyzedSamplesFor7TeV/MinNumberofJets2/20pbTemplates/fake_data_20pb-7TeV.root", "RECREATE");
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336 out_file->cd();
337 _data->Write();
338
339 out_file->Write();
340 delete out_file;
341 }
342