ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/Modules/GeneratorLevelStudyModule.C
Revision: 1.3
Committed: Tue Mar 13 17:59:38 2012 UTC (13 years, 1 month ago) by buchmann
Content type: text/plain
Branch: MAIN
Changes since 1.2: +6 -4 lines
Log Message:
Updated generator level file

File Contents

# Content
1 #include <iostream>
2 #include <vector>
3 #include <sys/stat.h>
4
5 #include <TCut.h>
6 #include <TROOT.h>
7 #include <TCanvas.h>
8 #include <TMath.h>
9 #include <TColor.h>
10 #include <TPaveText.h>
11 #include <TRandom.h>
12 #include <TH1.h>
13 #include <TH2.h>
14 #include <TH3.h>
15 #include <TF1.h>
16 #include <TSQLResult.h>
17 #include <TProfile.h>
18 #include <TPaveStats.h>
19 #include <TChain.h>
20
21 using namespace std;
22
23 using namespace PlottingSetup;
24
25 namespace GenLevelStudy {
26 void X_vs_generation_lm4();
27 void var_vs_generation_lm4(string var, int nbins, float xmin, float xmax);
28 void compare_sms_lm4();
29 void MomentumFraction();
30 void AngleMETsumLSP();
31 void AngleMETsumLSPScenario(float massglu, float masslsp);
32 void RatioMETsumLSP();
33 void RatioMETsumLSPScenario(float massglu, float masslsp);
34 void AngleLSPLSP();
35 void AngleLSPLSPScenario(float massglu, float masslsp);
36 void AngleLSPZ();
37 void AngleLSPZScenario(float massglu, float masslsp);
38 void MomentumFractionScenario(float massglu, float masslsp);
39 void WidthIllustration();
40 void ZDecayIllustration();
41 void pStarIllustration(float x);
42 void DeltaLSPmomentum();
43 void DeltaLSPmomentumScenario(float massglu, float masslsp);
44 void DrawJetBand(float massglu, float masslsp);
45 void DrawJetBand();
46 void pStarDistributions();
47 void pStarDistributions(string name, float modelx);
48 void fill_pstar_histos(string scandir, float x, TH1F* pstarhistos[], int npstarhistos, TLegend *leg, bool addlegentry);
49 void DrawOnly100to150inJetBand();
50 void DrawOnly100to150inJetBand(float massglu,float masslsp);
51 void ImpactOfGluinoChi2MassDifference();
52
53 // string LM4sample="/scratch/buchmann/ntuples/GeneratorInformationInJZB___JZBplusSamples_PrimeTime__SAMPLES__Gen_V11/LM4_SUSY_sftsht_7TeV-pythia6__Summer11-PU_S4_START42_V11-v2__withIndex.root";
54 string LM4sample="/scratch/buchmann/buchmann/SignalWithLeptonsStartingAt5GeV/LM4_SUSY_sftsht_7TeV-pythia.root";
55 // string LM4sample="/scratch/buchmann/ntuples/GeneratorInformationInJZB___JZBplusSamples_PrimeTime__SAMPLES__Gen_V16_sumJet_with_LSPsum_LM8only_fixed/LM8_SUSY_sftsht_7TeV-pythia6__Summer11-PU_S4_START42_V11-v2_novtx_fixed3.root";
56 string SMSsample="/scratch/buchmann/buchmann/GeneratorInformationInJZB___JZBplusSamples_PrimeTime__SAMPLES__Gen_V12_with_zchi2angle_bf1/SMS-T5zz_x-05_Mgluino-150to1200_mLSP-50to1150_7TeV-Pythia6Z__Summer11-PU_START42_V11_FastSim-v2__AODSIM___inclindex_v2_complet.root";
57 string histoname(int i);
58 Color_t histocolor(int i);
59 Color_t diversehistocolor(int i);
60
61 float pstarlow=0;
62 float pstarhigh=400;
63
64 } // end of GenLevelStudy namespace
65
66 Color_t GenLevelStudy::histocolor(int i) {
67 i=i-2;
68
69 if(i==0) return kRed;
70 if(i==1) return kGreen;
71 if(i==2) return kBlue;
72 if(i==3) return kOrange-3;
73 // if(i==4) return kMagenta-3;
74 if(i==4) return TColor::GetColor("#00AF64");
75 if(i==5) return kRed-4;
76 // if(i==6) return kGreen-2;
77 if(i==6) return TColor::GetColor("#FF4900");
78 if(i==7) return kMagenta-2;
79 // if(i==8) return kBlue-2;
80 if(i==8) return TColor::GetColor("#FF9200");
81 if(i==9) return kRed-2;
82
83 return TColor::GetColor("#0B61A4");
84 }
85 Color_t GenLevelStudy::diversehistocolor(int i) {
86 if(i==0) return TColor::GetColor("#000000"); // Black
87 if(i==1) return TColor::GetColor("#800000"); //Dark Red
88 if(i==2) return TColor::GetColor("#008000");//Dark Green
89 if(i==3) return TColor::GetColor("#808000");//Dark Yellow
90 if(i==4) return TColor::GetColor("#000080");//Dark Blue
91 if(i==5) return TColor::GetColor("#800080");//Dark Magenta
92 if(i==6) return TColor::GetColor("#008080");//Dark Cyan
93 if(i==7) return TColor::GetColor("#C0C0C0");//Light Gray
94 if(i==8) return TColor::GetColor("#C0DCC0");//Grass Green
95 if(i==9) return TColor::GetColor("#A6CAF0");//Light Blue
96 if(i==10) return TColor::GetColor("#FFFBF0");//Cream
97 if(i==11) return TColor::GetColor("#A0A0A4");//Medium Gray
98 if(i==12) return TColor::GetColor("#808080");//Dark Gray
99 if(i==13) return TColor::GetColor("#FF0000");//Red
100 if(i==14) return TColor::GetColor("#00FF00");//Green
101 if(i==15) return TColor::GetColor("#0000FF");//Blue
102 if(i==16) return TColor::GetColor("#FFFF00");//Yellow
103 if(i==17) return TColor::GetColor("#FF00FF");//Magenta
104 if(i==18) return TColor::GetColor("#00FFFF");//Cyan
105 if(i==19) return TColor::GetColor("#00AF64");//something else
106
107 return TColor::GetColor("#0B61A4");
108 }
109
110
111 string GenLevelStudy::histoname(int i) {
112 stringstream histname;
113 histname << "GenLevelHisto_" << i;
114 return histname.str();
115 }
116
117 void GenLevelStudy::var_vs_generation_lm4(string var, int nbins, float xmin, float xmax) {
118 TFile *f = new TFile(GenLevelStudy::LM4sample.c_str());
119 string promptnessCriterion="LSPPromptnessLevel[0]+LSPPromptnessLevel[1]";
120 TTree *events = (TTree*)f->Get("events");
121 TCanvas *can = new TCanvas("can","can");
122 TH1F *generationdists[20];
123 TLegend *leg = make_legend();
124 TLegend *leg2 = make_legend();
125 leg->SetY1(0.7);
126 leg->SetX1(0.52);
127 leg2->SetY1(0.7);
128 leg2->SetX1(0.52);
129 int startat=6;
130 int endat=14;
131 THStack allstacked;
132
133 for(int i=0;i<20;i+=2) {
134 generationdists[i] = new TH1F((GenLevelStudy::histoname(i)).c_str(),(GenLevelStudy::histoname(i)).c_str(),nbins,xmin,xmax);
135 stringstream variable;
136 variable << var << ">>" << GenLevelStudy::histoname(i);
137 stringstream cut;
138 cut << "LSPPromptnessLevel[0]>0&&LSPPromptnessLevel[1]>0&&abs(pureGeneratorJZB)>0&&genNjets>2";
139 if(i==startat) cut << "&&" << promptnessCriterion<<"==" << i;
140 if(i>startat&&i<endat-1) cut << "&&abs(" << promptnessCriterion<<"-" << i-0.5 << ")<0.6";
141 if(i==endat-2) cut << "&&" << promptnessCriterion<<">=" << i-1;
142 events->Draw(variable.str().c_str(),cut.str().c_str());
143 if(var=="pureGeneratorJZB") generationdists[i]->GetXaxis()->SetTitle("Generator JZB");
144 if(var=="genMET") generationdists[i]->GetXaxis()->SetTitle("Generator MET");
145 if(var=="pureGeneratorZpt") generationdists[i]->GetXaxis()->SetTitle("Generator Z p_{T}");
146 generationdists[i]->GetYaxis()->SetTitle("");
147 generationdists[i]->GetYaxis()->CenterTitle();
148 }
149 for(int i=startat;i<endat;i+=2) {
150 generationdists[i]->SetLineColor(GenLevelStudy::histocolor(i));
151 if(i==startat) generationdists[i]->DrawNormalized("histo");
152 else generationdists[i]->DrawNormalized("histo,same");
153 stringstream entryname;
154 if(i==startat) entryname << "Generations = " << i;
155 if(i>startat&&i<endat-2) entryname << "Generations = " << i-1 << " , " << i;
156 if(i==endat-2) entryname << "Generations #geq " << i-1;
157 leg->AddEntry(generationdists[i],entryname.str().c_str(),"l");
158 leg2->AddEntry(generationdists[i],entryname.str().c_str(),"f");
159 }
160 leg->Draw("same");
161 stringstream saveas;
162 saveas << "GeneratorStudies/Generations_" << var;
163 CompleteSave(can,saveas.str());
164 for(int i=endat-2;i>=startat;i-=2) {
165 generationdists[i]->SetFillColor(generationdists[i]->GetLineColor());
166 allstacked.Add(generationdists[i]);
167 }
168 allstacked.Draw();
169 allstacked.GetXaxis()->SetTitle(generationdists[0]->GetXaxis()->GetTitle());
170 allstacked.GetXaxis()->CenterTitle();
171 allstacked.GetYaxis()->SetTitle("events");
172 allstacked.GetYaxis()->CenterTitle();
173 allstacked.Draw();
174 leg2->Draw();
175 saveas << "__stacked";
176 CompleteSave(can,saveas.str());
177 delete can;
178
179 }
180
181 void GenLevelStudy::X_vs_generation_lm4() {
182 write_warning(__FUNCTION__,"Deactivated this function! Please uncomment the lines below!");
183 GenLevelStudy::var_vs_generation_lm4("pureGeneratorJZB",50,-200,600);
184 GenLevelStudy::var_vs_generation_lm4("genMET",30,0,600);
185 GenLevelStudy::var_vs_generation_lm4("pureGeneratorZpt",30,0,400);
186 }
187
188 void GenLevelStudy::compare_sms_lm4() { cout << __FUNCTION__ << endl; }
189
190 void GenLevelStudy::MomentumFractionScenario(float massglu, float masslsp) {
191 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
192 TTree *events = (TTree*)f->Get("events");
193 TCanvas *jcan = new TCanvas("jcan","jcan");
194 stringstream cut;
195 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
196 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
197 events->Draw("(LSP1pt/LSP1Mopt):pureGeneratorJZB",cut.str().c_str(),"PROF");
198 TH1F *h = new TH1F("h","h",100,-500,500);
199 h->SetLineColor(kBlack);
200 TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
201 p->GetXaxis()->SetTitle("Generator JZB");
202 p->GetXaxis()->CenterTitle();
203 // p->GetYaxis()->SetTitle("( LSP p_{T} ) / ( LSP mother p_{T} )");
204 p->GetYaxis()->SetTitle("f");
205 p->GetYaxis()->CenterTitle();
206 p->SetLineColor(kBlue);
207 p->GetXaxis()->SetRangeUser(-500,1000);
208 p->GetYaxis()->SetRangeUser(0,2);
209 /* TLegend* leg = make_legend("", 0.20, 1.03, false);
210 leg->SetNColumns(2);
211 leg->AddEntry(p,"f_{LSP}","l");
212 leg->AddEntry(h,"f_{Z}","l");
213 leg->Draw();*/
214 // TText *title = write_title("JZB as a function of the first LSP's momentum transfer");
215 // title->Draw();
216 events->Draw("(genZPt/LSP1Mopt):pureGeneratorJZB","genNjets>2","PROF,same");
217
218 stringstream saveas;
219 saveas << "GeneratorStudies/MomentumFraction";
220 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
221 CompleteSave(jcan,saveas.str());
222 delete jcan;
223 }
224
225 void GenLevelStudy::MomentumFraction() {
226 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
227 GenLevelStudy::MomentumFractionScenario(-1,-1);
228 GenLevelStudy::MomentumFractionScenario(1175,500);
229 GenLevelStudy::MomentumFractionScenario(625,425);
230 }
231
232 void GenLevelStudy::AngleMETsumLSPScenario(float massglu, float masslsp) {
233 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
234 TTree *events = (TTree*)f->Get("events");
235 TCanvas *jcan = new TCanvas("jcan","jcan");
236 stringstream cut;
237 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
238 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
239 events->Draw("(dphiSumLSPgenMET):pureGeneratorJZB",cut.str().c_str(),"PROF");
240 TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
241 p->GetXaxis()->SetTitle("Generator JZB");
242 p->GetXaxis()->CenterTitle();
243 p->GetXaxis()->SetRangeUser(-500,1000);
244 p->GetYaxis()->SetRangeUser(-0.5,0.5);
245 p->GetYaxis()->SetTitle("#Delta#Phi(#Sigma LSP,MET)");
246 p->GetYaxis()->CenterTitle();
247 p->SetLineColor(kBlue);
248 stringstream saveas;
249 saveas << "GeneratorStudies/DPhi_METsumLSP";
250 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
251 CompleteSave(jcan,saveas.str());
252
253 }
254
255 void GenLevelStudy::AngleMETsumLSP() {
256 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
257 //AngleMETsumLSPScenario(-1,-1);
258 //AngleMETsumLSPScenario(1175,500.0);
259 //AngleMETsumLSPScenario(625,425);
260 }
261
262 void GenLevelStudy::RatioMETsumLSPScenario(float massglu, float masslsp) {
263 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
264 TTree *events = (TTree*)f->Get("events");
265 TCanvas *jcan = new TCanvas("jcan","jcan");
266 stringstream cut;
267 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
268 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
269 events->Draw("(absvalSumLSP/genMET):pureGeneratorJZB",cut.str().c_str(),"PROF");
270 TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
271 p->GetXaxis()->SetTitle("Generator JZB");
272 p->GetXaxis()->CenterTitle();
273 p->GetYaxis()->SetTitle("#Sigma LSP p_{T} / MET");
274 p->GetYaxis()->CenterTitle();
275 p->SetLineColor(kBlue);
276 p->GetXaxis()->SetRangeUser(-500,1000);
277 p->GetYaxis()->SetRangeUser(0,2);
278 stringstream saveas;
279 saveas << "GeneratorStudies/absvalSumLSP_over_MET";
280 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
281 CompleteSave(jcan,saveas.str());
282 }
283
284 void GenLevelStudy::RatioMETsumLSP() {
285 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
286 //RatioMETsumLSPScenario(-1,-1);
287 //RatioMETsumLSPScenario(1175,500.0);
288 //RatioMETsumLSPScenario(625,425);
289 }
290
291 void GenLevelStudy::AngleLSPLSPScenario(float massglu, float masslsp) {
292 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
293 TTree *events = (TTree*)f->Get("events");
294 TCanvas *jcan = new TCanvas("jcan","jcan");
295 stringstream cut;
296 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
297 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
298 events->Draw("angleLSPLSP/TMath::Pi():pureGeneratorJZB",cut.str().c_str(),"PROF");
299 TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
300 p->GetXaxis()->SetTitle("Generator JZB");
301 p->GetXaxis()->CenterTitle();
302 p->GetYaxis()->SetTitle("#angle (LSP,LSP) / #pi");
303 p->GetYaxis()->CenterTitle();
304 p->SetLineColor(kBlue);
305 p->GetXaxis()->SetRangeUser(-500,1000);
306 p->GetYaxis()->SetRangeUser(0,1);
307 stringstream saveas;
308 saveas << "GeneratorStudies/AngleLSPLSP";
309 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
310 CompleteSave(jcan,saveas.str());
311
312 TH1F *lsplsp= new TH1F("lsplsp","lsplsp",50,0,1.0);
313 events->Draw("angleLSPLSP/TMath::Pi()>>lsplsp",cut.str().c_str());
314 stringstream saveas2;
315 lsplsp->GetXaxis()->SetTitle("#angle(LSP,LSP) / #pi");
316 lsplsp->GetXaxis()->CenterTitle();
317 lsplsp->SetLineColor(kBlue);
318 saveas2 << "GeneratorStudies/AngleLSPLSPdistribution";
319 if(massglu>0&&masslsp>0) saveas2 << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
320 CompleteSave(jcan,saveas2.str());
321 delete jcan;
322 delete lsplsp;
323
324
325 }
326
327 void GenLevelStudy::AngleLSPLSP() {
328 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
329 // AngleLSPLSPScenario(-1,-1);
330 // AngleLSPLSPScenario(1175,500);
331 // AngleLSPLSPScenario(625,425);
332 }
333
334 void GenLevelStudy::AngleLSPZScenario(float massglu, float masslsp) {
335 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
336 TTree *events = (TTree*)f->Get("events");
337 TCanvas *jcan = new TCanvas("jcan","jcan");
338 stringstream cut;
339 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
340 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
341 events->Draw("angleLSPLSP:pureGeneratorJZB",cut.str().c_str(),"PROF");
342 TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
343 p->GetXaxis()->SetTitle("Generator JZB");
344 p->GetXaxis()->CenterTitle();
345 p->GetYaxis()->SetTitle("#ANGLE (LSP,Z)");
346 p->GetYaxis()->CenterTitle();
347 p->SetLineColor(kBlue);
348 stringstream saveas;
349 saveas << "GeneratorStudies/AngleLSPZ";
350 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
351 CompleteSave(jcan,saveas.str());
352 }
353
354 void GenLevelStudy::AngleLSPZ() {
355 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
356 // AngleLSPZScenario(-1,-1);
357 // AngleLSPZScenario(1175,500.0);
358 // AngleLSPZScenario(625,425);
359 }
360
361 void GenLevelStudy::WidthIllustration() {
362 TCanvas *can = new TCanvas("can","can");
363 TH1F *h = new TH1F("h","h",1,0,2);
364 h->SetStats(0);
365 h->GetYaxis()->SetRangeUser(-1,1);
366 h->GetXaxis()->SetTitle("#angle(Z,MET) / #pi");
367 h->GetXaxis()->CenterTitle();
368 h->GetYaxis()->SetTitle("JZB/MET");
369 h->GetYaxis()->CenterTitle();
370 h->SetTitle("");
371 h->Draw();
372
373
374 TF1 *f1 = new TF1("f1","(TMath::Sqrt((0.001+10*cos(x*TMath::Pi()))*(0.001+10*cos(x*TMath::Pi()))+10*10*sin(x*TMath::Pi())*sin(x*TMath::Pi()))-10)/0.001",0,2);///
375 f1->SetLineColor(kBlue);///
376 TF1 *f2 = new TF1("f2","(TMath::Sqrt((10+10*cos(x*TMath::Pi()))*(10+10*cos(x*TMath::Pi()))+10*10*sin(x*TMath::Pi())*sin(x*TMath::Pi()))-10)/10",0,2);
377 f2->SetLineColor(kGreen);
378 TF1 *f3 = new TF1("f3","(TMath::Sqrt((20+10*cos(x*TMath::Pi()))*(20+10*cos(x*TMath::Pi()))+10*10*sin(x*TMath::Pi())*sin(x*TMath::Pi()))-10)/20",0,2);
379 f3->SetLineColor(kRed);
380 TF1 *f4 = new TF1("f4","(TMath::Sqrt((40+10*cos(x*TMath::Pi()))*(40+10*cos(x*TMath::Pi()))+10*10*sin(x*TMath::Pi())*sin(x*TMath::Pi()))-10)/40",0,2);///
381 f4->SetLineColor(kMagenta-2);///
382
383 f1->SetNpx(100000);
384 f2->SetNpx(100000);
385 f3->SetNpx(100000);
386 f4->SetNpx(100000);
387
388 f1->Draw("same");//Blue
389 f2->Draw("same");//Green
390 f3->Draw("same");//Red
391 f4->Draw("same");//weird magenta (supposedly)
392
393 CompleteSave(can,"GeneratorStudies/JZB_over_MET__as_a_function_of_the_angle_between_Z_and_MET");
394 }
395
396 void GenLevelStudy::ZDecayIllustration() {
397 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
398 TTree *events = (TTree*)f->Get("events");
399 TCanvas *jcan = new TCanvas("jcan","jcan");
400 string cutdileptonic="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==2";
401 string cutsemihadronic="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==11";
402 string cutsemineutrino="genNjets>2&&abs(pureGeneratorJZB)>0&&DecayCode==101";
403
404 int nbins=100;
405 float xmin=-300;
406 float xmax=500;
407 TH1F *hdileptonic = new TH1F("hdileptonic","hdileptonic",nbins,xmin,xmax);
408 TH1F *hsemihadronic = new TH1F("hsemihadronic","hsemihadronic",nbins,xmin,xmax);
409 TH1F *hsemineutrino = new TH1F("hsemineutrino","hsemineutrino",nbins,xmin,xmax);
410 events->Draw("pureGeneratorJZB>>hdileptonic",cutdileptonic.c_str());
411 events->Draw("pureGeneratorJZB>>hsemihadronic",cutsemihadronic.c_str());
412 events->Draw("pureGeneratorJZB>>hsemineutrino",cutsemineutrino.c_str());
413
414 hdileptonic->GetXaxis()->SetTitle("Generator JZB");
415 hdileptonic->GetXaxis()->CenterTitle();
416 hdileptonic->GetYaxis()->SetTitle("");
417 hdileptonic->GetYaxis()->CenterTitle();
418 hdileptonic->SetLineColor(kBlue);
419 hsemihadronic->SetLineColor(kRed);
420 hsemineutrino->SetLineColor(kGreen+2);
421
422 hdileptonic->DrawNormalized("histo");
423 hsemineutrino->DrawNormalized("histo,same");
424 hsemihadronic->DrawNormalized("histo,same");
425
426 TLegend *leg = make_legend("", 0.60, 0.7, false);
427 leg->AddEntry(hdileptonic,"Z#rightarrow ll","l");
428 leg->AddEntry(hsemihadronic,"Z#rightarrow jj","l");
429 leg->AddEntry(hsemineutrino,"Z#rightarrow #nu#nu","l");
430 leg->Draw();
431
432 stringstream saveas;
433 saveas << "GeneratorStudies/ZDecayIllustration";
434 CompleteSave(jcan,saveas.str());
435
436 }
437
438
439 void GenLevelStudy::pStarIllustration(float x) {
440 TH2F *pstarlspmap = new TH2F("pstarlspmap", "",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,(int)((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
441 TH2F *pstarchimap = new TH2F("pstarchimap", "",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,(int)((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
442 TH2F *pstardiffmap = new TH2F("pstardiffmap", "",(int)((mgluend-mglustart)/mglustep+1),mglustart-0.5*mglustep,mgluend+0.5*mglustep,(int)((mLSPend-mLSPstart)/mLSPstep+1),mLSPstart-0.5*mLSPstep,mLSPend+0.5*mLSPstep);
443
444 for(int mglu=(int)mglustart;mglu<=mgluend;mglu+=(int)mglustep) {
445 for (int mlsp=(int)mLSPstart;mlsp<=mLSPend&&mlsp<=mglu;mlsp+=(int)mLSPstep)
446 {
447 float pstarlsp = pSTAR(mglu,mlsp,mlsp+x*(mglu-mlsp));
448 pstarlspmap->Fill(mglu,mlsp,pstarlsp);
449 float pstarchi = generalizedpSTAR(mglu,mlsp+x*(mglu-mlsp),1.0);//the second daughter is a jet; we're using 1 GeV here.
450 pstarchimap->Fill(mglu,mlsp,pstarchi);
451 pstardiffmap->Fill(mglu,mlsp,pstarchi-pstarlsp);
452 }
453 }
454
455 stringstream pstartitle;
456 pstartitle << "pstar_histo_x_equal_0p" << 100*x << "____NOT_efficiencymap";
457 pstarlspmap->SetTitle(pstartitle.str().c_str());
458 pstarlspmap->SetName(pstartitle.str().c_str());
459 pstarlspmap->GetXaxis()->SetTitle("m_{#tilde{g}} (GeV/c^{2})");
460 pstarlspmap->GetXaxis()->CenterTitle();
461 pstarlspmap->GetYaxis()->SetTitle("m_{LSP} (GeV/c^{2})");
462 pstarlspmap->GetYaxis()->CenterTitle();
463 pstarlspmap->GetZaxis()->SetTitle("p^{*}(LSP) (GeV/c)");
464 pstarlspmap->GetZaxis()->CenterTitle();
465
466 float corr=91.2/x;
467 TLine *l = new TLine(corr,0,1200,1200-corr);
468 l->SetLineWidth(3);
469 l->SetLineColor(kWhite);
470 TLine *l2 = (TLine*)l->Clone();
471 l2->SetLineWidth(1);
472 l2->SetLineColor(kRed);
473
474 TCanvas *can = new TCanvas("can","can");
475 can->SetRightMargin(0.16);
476 pstarlspmap->Draw("COLZ");
477 l->Draw("same");
478 l2->Draw("same");
479 stringstream saveas;
480 saveas << "GeneratorStudies/PStarLSP_x_0p" << x*100;
481 CompleteSave(can,saveas.str());
482
483 stringstream pstartitle2;
484 pstartitle2 << "pstar_histo_x_equal_0p" << 100*x << "____NOT_efficiencymap";
485 pstarchimap->SetTitle(pstartitle2.str().c_str());
486 pstarchimap->SetName(pstartitle2.str().c_str());
487 pstarchimap->GetXaxis()->SetTitle("m_{#tilde{g}} (GeV/c^{2})");
488 pstarchimap->GetXaxis()->CenterTitle();
489 pstarchimap->GetYaxis()->SetTitle("m_{LSP} (GeV/c^{2})");
490 pstarchimap->GetYaxis()->CenterTitle();
491 pstarchimap->GetZaxis()->SetTitle("p^{*}(#chi_{2}^{0}) (GeV/c)");
492 pstarchimap->GetZaxis()->CenterTitle();
493 pstarchimap->Draw("COLZ");
494 l->Draw("same");
495 l2->Draw("same");
496 stringstream saveas2;
497 saveas2 << "GeneratorStudies/PStarCHI_x_0p" << x*100;
498 CompleteSave(can,saveas2.str());
499
500 stringstream pstartitle3;
501 pstartitle3 << "pstar_histo_x_equal_0p" << 100*x << "____NOT_efficiencymap";
502 pstardiffmap->SetTitle(pstartitle3.str().c_str());
503 pstardiffmap->SetName(pstartitle3.str().c_str());
504 pstardiffmap->GetXaxis()->SetTitle("m_{#tilde{g}} (GeV/c^{2})");
505 pstardiffmap->GetXaxis()->CenterTitle();
506 pstardiffmap->GetYaxis()->SetTitle("m_{LSP} (GeV/c^{2})");
507 pstardiffmap->GetYaxis()->CenterTitle();
508 pstardiffmap->GetZaxis()->SetTitle("p^{*}(#chi_{2}^{0}) -p^{*}(LSP) (GeV/c)");
509 pstardiffmap->GetZaxis()->CenterTitle();
510 // pstardiffmap->GetZaxis()->SetRangeUser(0,250);
511 pstardiffmap->Draw("COLZ");
512 l->Draw("same");
513 l2->Draw("same");
514 stringstream saveas3;
515 saveas3 << "GeneratorStudies/PStar_CHI_minus_LSP__x_0p" << x*100;
516 CompleteSave(can,saveas3.str());
517
518
519 TFile *g = new TFile("pstarshapes.root","UPDATE");
520 pstarlspmap->Write();
521 pstarchimap->Write();
522 pstardiffmap->Write();
523 g->Close();
524 delete can;
525 delete pstarlspmap;
526 delete pstarchimap;
527 delete pstardiffmap;
528 }
529
530 void GenLevelStudy::DeltaLSPmomentumScenario(float massglu, float masslsp) {
531 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
532 TTree *events = (TTree*)f->Get("events");
533 TCanvas *jcan = new TCanvas("jcan","jcan");
534 stringstream cut;
535 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
536 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
537 events->Draw("(LSP1pt-LSP2pt):pureGeneratorJZB",cut.str().c_str(),"PROF");
538 TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
539 p->GetXaxis()->SetTitle("Generator JZB");
540 p->GetXaxis()->CenterTitle();
541 p->GetYaxis()->SetTitle("p_{T}(LSP1)-p_{T}(LSP2)");
542 p->GetYaxis()->CenterTitle();
543 p->GetXaxis()->SetRangeUser(-500,1000);
544 p->GetYaxis()->SetRangeUser(-800,800);
545 p->SetLineColor(kBlue);
546
547 stringstream saveas;
548 saveas << "GeneratorStudies/DeltaLSPPt";
549 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
550 CompleteSave(jcan,saveas.str());
551 delete jcan;
552 }
553
554
555 void GenLevelStudy::DeltaLSPmomentum() {
556 write_warning(__FUNCTION__,"Skipping this function (please uncomment the lines below)");
557 GenLevelStudy::DeltaLSPmomentumScenario(-1,-1);
558 GenLevelStudy::DeltaLSPmomentumScenario(1175,500);
559 GenLevelStudy::DeltaLSPmomentumScenario(625,425);
560
561 }
562
563 void GenLevelStudy::fill_pstar_histos(string scandir, float x, TH1F* pstarhistos[], int npstarhistos, TLegend *leg, bool addlegentry=false) {
564 TChain chain("events");
565 for(int i=0;i<15;i++) {
566 for(int j=0;j<15;j++) {
567 stringstream filename;
568 filename << "/shome/buchmann/ntuples/"<<scandir<<"/SMS_clean_splitup_" << i << "_" << j << ".root";
569 chain.Add(filename.str().c_str());
570 }
571 }
572
573 //Draw two very different distributions ... for illustration purposes.
574 if(TMath::Abs((float)(x-0.5))<0.1) {
575 TCanvas *cannie = new TCanvas("cannie","cannie");
576 TH1F *h1 = new TH1F("h1","h1",100,-400,600);
577 TH1F *h2 = new TH1F("h2","h2",100,-400,600);
578 chain.Draw("jzb[1]>>h1","(MassLSP==150&&MassGlu==400&&abs(jzb[1])>0)");
579 chain.Draw("jzb[1]>>h2","(MassLSP==150&&MassGlu==1200&&abs(jzb[1])>0)","sames");
580 h1->SetLineColor(histocolor(4));
581 h2->SetLineColor(histocolor(6));
582 h1->GetXaxis()->SetTitle("JZB (GeV/c)");
583 h1->GetXaxis()->CenterTitle();
584 h1->GetYaxis()->SetTitle("events (norm. to unit area)");
585 h1->GetYaxis()->CenterTitle();
586 h1->DrawNormalized("histo");
587 h2->DrawNormalized("histo,same");
588 TLegend *tleg = make_legend("",0.52,0.75,false);
589 tleg->AddEntry(h1,"(m_{#tilde{g}},m_{LSP})=(400,150)","l");
590 tleg->AddEntry(h2,"(m_{#tilde{g}},m_{LSP})=(1200,150)","l");
591 tleg->Draw("same");
592 CompleteSave(cannie,"GeneratorStudies/TwoVeryDifferentMassPoints");
593 }
594
595 float stepsize=(pstarhigh-pstarlow)/(float)npstarhistos;
596 /*
597 stringstream accdrawcommand;
598 accdrawcommand << "1+((" << x << "*(MassGlu+MassLSP)-MassLSP)>91.2)";
599
600 TCanvas *ca = new TCanvas("ca","ca");
601 chain.Draw(accdrawcommand.str().c_str(),"","COLZ");
602 stringstream saveACCas;
603 saveACCas << "GeneratorStudies/AcceptedRegion__x_0p" << 100*x;
604 CompleteSave(ca,saveACCas.str());
605
606 for(int i=0;i<npstarhistos;i++) {
607 float curr=(i+1)*stepsize;
608 stringstream cut;
609 cut << "pfJetGoodNum>=3&&TMath::Abs(mll-91.2)<20&&id1==id2&&";
610 cut << "(abs(TMath::Sqrt((("<< x*x << ")*(MassGlu+MassLSP)*(MassGlu+MassLSP)-(MassLSP+91.2)*(MassLSP+91.2))*((" << x*x << ")*(MassGlu+MassLSP)*(MassGlu+MassLSP)-(MassLSP-91.2)*(MassLSP-91.2)))/(2*(" << x << ")*(MassGlu+MassLSP))-" << curr-stepsize/2.0 << ")<" << stepsize/2.0 << ")";
611 cut << "&&((" << x << "*(MassGlu+MassLSP)-MassLSP)>91.2)"; // cleaning all events out that dont' have the imposed x
612 stringstream drawcommand;
613 drawcommand << "jzb[1]>>GenLevelHisto_" << i;
614 chain.Draw(drawcommand.str().c_str(),cut.str().c_str());
615 stringstream histotext;
616 histotext << curr-stepsize << " < p^{*} < " << curr;
617 if(addlegentry&&pstarhistos[i]->Integral()>0) leg->AddEntry(pstarhistos[i],histotext.str().c_str(),"l");
618 cout << "Finished working on " << scandir << " with a p* value in [" << curr - stepsize << "," << curr << "] (now contains: " << pstarhistos[i]->Integral() << " events)" << endl;
619
620 }
621 delete ca;
622 */
623 }
624
625 void GenLevelStudy::pStarDistributions(string name, float modelx) {
626 const int nhistos=20;
627 TH1F *pstarhistos[nhistos];
628 TCanvas *can = new TCanvas("can","can");
629 for(int i=0;i<nhistos;i++) pstarhistos[i] = new TH1F(histoname(i).c_str(),histoname(i).c_str(),100,-400,600);
630 TLegend *leg = make_legend("",0.6,0.3,false);
631
632 fill_pstar_histos(name,modelx,pstarhistos,nhistos,leg,true);
633
634 float x[nhistos],y[nhistos],ex[nhistos],ey[nhistos];
635 stringstream rootfilename;
636 rootfilename << "pstarhistos__x0p" << 100*modelx << ".root";
637 TFile *f = new TFile(rootfilename.str().c_str(),"RECREATE");
638 pstarhistos[0]->GetXaxis()->SetTitle("JZB");
639 pstarhistos[0]->GetXaxis()->CenterTitle();
640 pstarhistos[0]->GetYaxis()->SetTitle("");
641 pstarhistos[0]->GetYaxis()->CenterTitle();
642 for(int i=0;i<nhistos;i++) {
643 pstarhistos[i]->SetLineColor(diversehistocolor(i));
644 if(i==0) pstarhistos[i]->DrawNormalized();
645 else pstarhistos[i]->DrawNormalized("same");
646 pstarhistos[i]->Write();
647 float stepsize=(pstarhigh-pstarlow)/(float)nhistos;
648 x[i]=(i+0.5)*stepsize;
649 ex[i]=(0.5)*stepsize;
650 y[i]=pstarhistos[i]->GetMean();
651 ey[i]=pstarhistos[i]->GetRMS();
652 }
653 leg->Draw();
654 stringstream saveas;
655 saveas << "GeneratorStudies/pStarStudy__x_0p" << 100*modelx;
656 CompleteSave(can,saveas.str());
657
658 TGraphErrors *gr = new TGraphErrors(nhistos,x,y,ex,ey);
659 gr->Draw("AP");
660 gr->GetXaxis()->SetTitle("p^{*}");
661 gr->GetXaxis()->CenterTitle();
662 gr->GetYaxis()->SetTitle("JZB");
663 gr->GetYaxis()->CenterTitle();
664 gr->Draw("AP");
665 stringstream saveas2;
666 saveas2 << "GeneratorStudies/pStarVsJZB__x_0p" << 100*modelx;
667 CompleteSave(can,saveas2.str());
668 f->cd();
669 gr->Write();
670 f->Close();
671 for(int i=0;i<nhistos;i++) delete pstarhistos[i];
672
673 }
674 void GenLevelStudy::pStarDistributions() {
675 pStarDistributions("SMS_T5zzh_newslots",0.25);
676 pStarDistributions("SMS_T5zz",0.5);
677 pStarDistributions("SMS_T5zzl",0.75);
678 }
679
680 void GenLevelStudy::DrawJetBand(float massglu, float masslsp) {
681 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
682 TTree *events = (TTree*)f->Get("events");
683 TCanvas *jcan = new TCanvas("jcan","jcan");
684 jcan->SetRightMargin(0.16);
685 stringstream cut;
686 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
687 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")";
688 TH2F *histo = new TH2F("histo","histo",100,-600,600,100,0,800);
689 // events->Draw("sumJetPt[1]:pureGeneratorJZB:cos(angleChi2Z)>>histo",cut.str().c_str(),"");
690 events->Project("histo", "pureGeneratorJZB:pureGeneratorSumJetPt:acos(cos(angleChi2Z2d))", cut.str().c_str(), "COLZ");
691
692 // TH1F *h = new TH1F("h","h",100,-500,500);
693 // h->SetLineColor(kBlack);
694 //TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
695 histo->GetXaxis()->SetTitle("Sum Jet Pt");
696 histo->GetXaxis()->CenterTitle();
697 histo->GetYaxis()->SetTitle("Generator JZB");
698 histo->GetYaxis()->CenterTitle();
699 histo->GetZaxis()->SetTitle("|#angle(Z,#tilde{#Chi_{2}^{0}})|");
700 histo->GetZaxis()->CenterTitle();
701
702 histo->Draw("COLZ");
703 stringstream saveas;
704 saveas << "GeneratorStudies/JetPtBand";
705 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
706 CompleteSave(jcan,saveas.str());
707 delete jcan;
708 delete histo;
709 }
710
711 void GenLevelStudy::DrawOnly100to150inJetBand(float massglu, float masslsp) {
712 TFile *f = new TFile(GenLevelStudy::SMSsample.c_str());
713 TTree *events = (TTree*)f->Get("events");
714 TCanvas *jcan = new TCanvas("jcan","jcan");
715 jcan->SetRightMargin(0.16);
716 stringstream cut;
717 cut << "genNjets>2&&abs(pureGeneratorJZB)>0";
718 if(massglu>0&&masslsp>0) cut << "&&abs(MassGlu-" << massglu << ")<5&&abs(MassLSP-" << masslsp << ")&&abs(pureGeneratorSumJetPt-125)<25";
719 TH2F *p = new TH2F("histo","histo",100,-500,1000,100,0,800);
720 events->Draw("cos(angleChi2Z)",cut.str().c_str(),"");
721 // TH1F *h = new TH1F("h","h",100,-500,500);
722 // h->SetLineColor(kBlack);
723 /*TProfile *p = (TProfile*)jcan->GetPrimitive("htemp");
724 p->GetXaxis()->SetTitle("Generator JZB");
725 p->GetXaxis()->CenterTitle();
726 p->GetYaxis()->SetTitle("Sum Jet Pt");
727 p->GetYaxis()->CenterTitle();
728 p->GetZaxis()->SetTitle("cos(#angle(Z,#tilde{#Chi_{2}^{0}}))");
729 p->GetZaxis()->CenterTitle();
730 p->SetLineColor(kBlue);
731 p->GetXaxis()->SetRangeUser(-500,1000);
732 p->GetYaxis()->SetRangeUser(0,800);
733 */
734 // p->Draw("COLZ");
735 stringstream saveas;
736 saveas << "GeneratorStudies/Sliver_of_the_JetPtBand";
737 if(massglu>0&&masslsp>0) saveas << "__MassGlu" << massglu << "_MassLSP_" << masslsp;
738 CompleteSave(jcan,saveas.str());
739 delete jcan;
740 delete p;
741 }
742
743 void GenLevelStudy::DrawOnly100to150inJetBand() {
744 GenLevelStudy::DrawOnly100to150inJetBand(-1,-1);
745 GenLevelStudy::DrawOnly100to150inJetBand(1175,500);
746 GenLevelStudy::DrawOnly100to150inJetBand(625,425);
747 }
748
749
750 void GenLevelStudy::DrawJetBand() {
751 GenLevelStudy::DrawJetBand(-1,-1);
752 GenLevelStudy::DrawJetBand(1175,500);
753 GenLevelStudy::DrawJetBand(625,425);
754 }
755
756 void GenLevelStudy::ImpactOfGluinoChi2MassDifference() {
757 TCanvas *can = new TCanvas("can","can");
758 can->SetLogy(1);
759 TChain smsp025events("events");
760 TChain smsp050events("events");
761 TChain smsp075events("events");
762
763 for(int i=0;i<15;i++) {
764 for(int j=0;j<15;j++) {
765 stringstream filenamep25;
766 stringstream filenamep50;
767 stringstream filenamep75;
768 filenamep25 << "/shome/buchmann/ntuples/SMS_T5zzh_newslots/SMS_clean_splitup_" << i << "_" << j << ".root";
769 filenamep50 << "/shome/buchmann/ntuples/SMS_T5zz/SMS_clean_splitup_" << i << "_" << j << ".root";
770 filenamep75 << "/shome/buchmann/ntuples/SMS_T5zzl/SMS_clean_splitup_" << i << "_" << j << ".root";
771 smsp025events.Add(filenamep25.str().c_str());
772 smsp050events.Add(filenamep50.str().c_str());
773 smsp075events.Add(filenamep75.str().c_str());
774 }
775 }
776
777 stringstream cutp25m2;
778 cutp25m2 << "abs(MassGlu-700)<5&&abs(MassLSP-100)&&pfJetGoodNum>0";
779 stringstream cutp50m2;
780 cutp50m2 << "abs(MassGlu-400)<5&&abs(MassLSP-100)&&pfJetGoodNum>0";
781 stringstream cutp75m2;
782 cutp75m2 << "abs(MassGlu-300)<5&&abs(MassLSP-100)&&pfJetGoodNum>0";
783
784 stringstream cutp25m1;
785 cutp25m1 << "abs(MassGlu-700)<5&&abs(MassLSP-500)&&pfJetGoodNum>0";
786 stringstream cutp50m1;
787 cutp50m1 << "abs(MassGlu-700)<5&&abs(MassLSP-400)&&pfJetGoodNum>0";
788 stringstream cutp75m1;
789 cutp75m1 << "abs(MassGlu-700)<5&&abs(MassLSP-100)&&pfJetGoodNum>0";
790
791 TH1F *nJets25m2 = new TH1F("nJets25m2","nJets25m2",20,-0.5,19.5);
792 TH1F *nJets50m2 = new TH1F("nJets50m2","nJets50m2",20,-0.5,19.5);
793 TH1F *nJets75m2 = new TH1F("nJets75m2","nJets75m2",20,-0.5,19.5);
794
795 TH1F *sumJetpt25m2 = new TH1F("sumJetpt25m2","sumJetpt25m2",100,0,300);
796 TH1F *sumJetpt50m2 = new TH1F("sumJetpt50m2","sumJetpt50m2",100,0,300);
797 TH1F *sumJetpt75m2 = new TH1F("sumJetpt75m2","sumJetpt75m2",100,0,300);
798
799 TH1F *Zpt25m2 = new TH1F("Zpt25m2","Zpt25m2",100,0,200);
800 TH1F *Zpt50m2 = new TH1F("Zpt50m2","Zpt50m2",100,0,200);
801 TH1F *Zpt75m2 = new TH1F("Zpt75m2","Zpt75m2",100,0,200);
802
803 TH1F *nJets25m1 = new TH1F("nJets25m1","nJets25m1",20,-0.5,19.5);
804 TH1F *nJets50m1 = new TH1F("nJets50m1","nJets50m1",20,-0.5,19.5);
805 TH1F *nJets75m1 = new TH1F("nJets75m1","nJets75m1",20,-0.5,19.5);
806
807 TH1F *sumJetpt25m1 = new TH1F("sumJetpt25m1","sumJetpt25m1",100,0,300);
808 TH1F *sumJetpt50m1 = new TH1F("sumJetpt50m1","sumJetpt50m1",100,0,300);
809 TH1F *sumJetpt75m1 = new TH1F("sumJetpt75m1","sumJetpt75m1",100,0,300);
810
811 TH1F *Zpt25m1 = new TH1F("Zpt25m1","Zpt25m1",100,0,200);
812 TH1F *Zpt50m1 = new TH1F("Zpt50m1","Zpt50m1",100,0,200);
813 TH1F *Zpt75m1 = new TH1F("Zpt75m1","Zpt75m1",100,0,200);
814
815 smsp025events.Draw("pfJetGoodNum>>nJets25m2",("abs(mll-91.2)&&id1==id2&&"+cutp25m2.str()).c_str());
816 smsp050events.Draw("pfJetGoodNum>>nJets50m2",("abs(mll-91.2)&&id1==id2&&"+cutp50m2.str()).c_str());
817 smsp075events.Draw("pfJetGoodNum>>nJets75m2",("abs(mll-91.2)&&id1==id2&&"+cutp75m2.str()).c_str());
818
819 smsp025events.Draw("sumJetPt[1]>>sumJetpt25m2",("abs(mll-91.2)&&id1==id2&&"+cutp25m2.str()).c_str());
820 smsp050events.Draw("sumJetPt[1]>>sumJetpt50m2",("abs(mll-91.2)&&id1==id2&&"+cutp50m2.str()).c_str());
821 smsp075events.Draw("sumJetPt[1]>>sumJetpt75m2",("abs(mll-91.2)&&id1==id2&&"+cutp75m2.str()).c_str());
822
823 smsp025events.Draw("pt>>Zpt25m2",("abs(mll-91.2)&&id1==id2&&"+cutp25m2.str()).c_str());
824 smsp050events.Draw("pt>>Zpt50m2",("abs(mll-91.2)&&id1==id2&&"+cutp50m2.str()).c_str());
825 smsp075events.Draw("pt>>Zpt75m2",("abs(mll-91.2)&&id1==id2&&"+cutp75m2.str()).c_str());
826
827 smsp025events.Draw("pfJetGoodNum>>nJets25m1",("abs(mll-91.2)&&id1==id2&&"+cutp25m1.str()).c_str());
828 smsp050events.Draw("pfJetGoodNum>>nJets50m1",("abs(mll-91.2)&&id1==id2&&"+cutp50m1.str()).c_str());
829 smsp075events.Draw("pfJetGoodNum>>nJets75m1",("abs(mll-91.2)&&id1==id2&&"+cutp75m1.str()).c_str());
830
831 smsp025events.Draw("sumJetPt[1]>>sumJetpt25m1",("abs(mll-91.2)&&id1==id2&&"+cutp25m1.str()).c_str());
832 smsp050events.Draw("sumJetPt[1]>>sumJetpt50m1",("abs(mll-91.2)&&id1==id2&&"+cutp50m1.str()).c_str());
833 smsp075events.Draw("sumJetPt[1]>>sumJetpt75m1",("abs(mll-91.2)&&id1==id2&&"+cutp75m1.str()).c_str());
834
835 smsp025events.Draw("pt>>Zpt25m1",("abs(mll-91.2)&&id1==id2&&"+cutp25m1.str()).c_str());
836 smsp050events.Draw("pt>>Zpt50m1",("abs(mll-91.2)&&id1==id2&&"+cutp50m1.str()).c_str());
837 smsp075events.Draw("pt>>Zpt75m1",("abs(mll-91.2)&&id1==id2&&"+cutp75m1.str()).c_str());
838
839 sumJetpt25m1->GetXaxis()->SetTitle("Sum of Jet Pt (GeV)");
840 sumJetpt25m1->GetYaxis()->SetTitle("events");
841 sumJetpt25m1->GetXaxis()->CenterTitle();
842 sumJetpt25m1->GetYaxis()->CenterTitle();
843
844 sumJetpt25m1->SetLineColor(diversehistocolor(0));
845 sumJetpt50m1->SetLineColor(diversehistocolor(1));
846 sumJetpt75m1->SetLineColor(diversehistocolor(2));
847
848 TLegend *leg = make_legend("",0.6,0.6,false);
849 leg->AddEntry(sumJetpt25m1,"#Delta m_{2} = 50 GeV","l");
850 leg->AddEntry(sumJetpt50m1,"#Delta m_{2} = 150 GeV","l");
851 leg->AddEntry(sumJetpt75m1,"#Delta m_{2} = 450 GeV","l");
852
853 sumJetpt25m1->Draw("histo");
854 sumJetpt50m1->Draw("histo,same");
855 sumJetpt75m1->Draw("histo,same");
856 leg->Draw("same");
857 CompleteSave(can,"GeneratorStudies/MassDifferences/VaryingDeltaM2/ComparingSumJetPt_Of_Three_Different_Gluino_Chi2_MassDifferences");
858
859 nJets25m1->SetLineColor(diversehistocolor(0));
860 nJets50m1->SetLineColor(diversehistocolor(1));
861 nJets75m1->SetLineColor(diversehistocolor(2));
862 nJets25m1->GetXaxis()->SetTitle("N(Jets)");
863 nJets25m1->GetXaxis()->CenterTitle();
864 nJets25m1->GetYaxis()->SetTitle("events");
865 nJets25m1->GetYaxis()->CenterTitle();
866 nJets25m1->Draw("histo");
867 nJets50m1->Draw("histo,same");
868 nJets75m1->Draw("histo,same");
869 leg->Draw("same");
870 CompleteSave(can,"GeneratorStudies/MassDifferences/VaryingDeltaM2/ComparingNJets_Of_Three_Different_Gluino_Chi2_MassDifferences");
871
872 Zpt25m1->GetXaxis()->SetTitle("Z p_{T} (GeV)");
873 Zpt25m1->GetXaxis()->CenterTitle();
874 Zpt25m1->GetYaxis()->SetTitle("events");
875 Zpt25m1->GetYaxis()->CenterTitle();
876 Zpt25m1->SetLineColor(diversehistocolor(0));
877 Zpt50m1->SetLineColor(diversehistocolor(1));
878 Zpt75m1->SetLineColor(diversehistocolor(2));
879 Zpt25m1->Draw("histo");
880 Zpt50m1->Draw("histo,same");
881 Zpt75m1->Draw("histo,same");
882 leg->Draw("same");
883 CompleteSave(can,"GeneratorStudies/MassDifferences/VaryingDeltaM2/ComparingZPt_Of_Three_Different_Gluino_Chi2_MassDifferences");
884
885 //------------
886
887 sumJetpt25m2->GetXaxis()->SetTitle("Sum of Jet Pt (GeV)");
888 sumJetpt25m2->GetYaxis()->SetTitle("events");
889 sumJetpt25m2->GetXaxis()->CenterTitle();
890 sumJetpt25m2->GetYaxis()->CenterTitle();
891
892 sumJetpt25m2->SetLineColor(diversehistocolor(0));
893 sumJetpt50m2->SetLineColor(diversehistocolor(1));
894 sumJetpt75m2->SetLineColor(diversehistocolor(2));
895
896 TLegend *leg2 = make_legend("",0.6,0.6,false);
897 leg2->AddEntry(sumJetpt75m2,"#Delta m_{1} = 50 GeV","l");
898 leg2->AddEntry(sumJetpt50m2,"#Delta m_{1} = 150 GeV","l");
899 leg2->AddEntry(sumJetpt25m2,"#Delta m_{1} = 450 GeV","l");
900
901 sumJetpt25m2->Draw("histo");
902 sumJetpt50m2->Draw("histo,same");
903 sumJetpt75m2->Draw("histo,same");
904 leg2->Draw("same");
905 CompleteSave(can,"GeneratorStudies/MassDifferences/VaryingDeltaM1/ComparingSumJetPt_Of_Three_Different_Chi1_Chi2_MassDifferences");
906
907 nJets25m2->SetLineColor(diversehistocolor(0));
908 nJets50m2->SetLineColor(diversehistocolor(1));
909 nJets75m2->SetLineColor(diversehistocolor(2));
910 nJets25m2->GetXaxis()->SetTitle("N(Jets)");
911 nJets25m2->GetXaxis()->CenterTitle();
912 nJets25m2->GetYaxis()->SetTitle("events");
913 nJets25m2->GetYaxis()->CenterTitle();
914
915 nJets25m2->Draw("histo");
916 nJets50m2->Draw("histo,same");
917 nJets75m2->Draw("histo,same");
918 leg2->Draw("same");
919 CompleteSave(can,"GeneratorStudies/MassDifferences/VaryingDeltaM1/ComparingNJets_Of_Three_Different_Chi1_Chi2_MassDifferences");
920
921 Zpt25m2->GetXaxis()->SetTitle("Z p_{T} (GeV)");
922 Zpt25m2->GetXaxis()->CenterTitle();
923 Zpt25m2->GetYaxis()->SetTitle("events");
924 Zpt25m2->GetYaxis()->CenterTitle();
925
926 Zpt25m2->SetLineColor(diversehistocolor(0));
927 Zpt50m2->SetLineColor(diversehistocolor(1));
928 Zpt75m2->SetLineColor(diversehistocolor(2));
929 Zpt25m2->Draw("histo");
930 Zpt50m2->Draw("histo,same");
931 Zpt75m2->Draw("histo,same");
932 leg2->Draw("same");
933 CompleteSave(can,"GeneratorStudies/MassDifferences/VaryingDeltaM1/ComparingZPt_Of_Three_Different_Chi1_Chi2_MassDifferences");
934
935 //--------------
936 delete can;
937
938 delete nJets25m1;
939 delete nJets50m1;
940 delete nJets75m1;
941
942 delete nJets25m2;
943 delete nJets50m2;
944 delete nJets75m2;
945
946 delete sumJetpt25m1;
947 delete sumJetpt50m1;
948 delete sumJetpt75m1;
949
950 delete sumJetpt25m2;
951 delete sumJetpt50m2;
952 delete sumJetpt75m2;
953 }
954
955