ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/Modules/GeneratorLevelStudyModule.C
Revision: 1.2
Committed: Thu Feb 23 15:19:55 2012 UTC (13 years, 2 months ago) by buchmann
Content type: text/plain
Branch: MAIN
Changes since 1.1: +264 -17 lines
Log Message:
Added study of impact of gluino-chi2 mass difference (needs to be refined)

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