File indexing completed on 2024-04-06 11:57:13
0001 {
0002 gROOT->Reset();
0003 gROOT->Clear();
0004
0005 gStyle->SetNdivisions(5);
0006 gStyle->SetCanvasBorderMode(0);
0007 gStyle->SetPadBorderMode(1);
0008 gStyle->SetOptTitle(1);
0009 gStyle->SetStatFont(42);
0010 gStyle->SetCanvasColor(10);
0011 gStyle->SetPadColor(0);
0012 gStyle->SetTitleFont(62,"xy");
0013 gStyle->SetLabelFont(62,"xy");
0014 gStyle->SetTitleFontSize(0.07);
0015 gStyle->SetTitleSize(0.045,"xy");
0016 gStyle->SetLabelSize(0.05,"xy");
0017 gStyle->SetHistFillStyle(1001);
0018 gStyle->SetHistFillColor(0);
0019 gStyle->SetHistLineStyle(1);
0020 gStyle->SetHistLineWidth(1);
0021 gStyle->SetHistLineColor(1);
0022 gStyle->SetTitleXOffset(1.1);
0023 gStyle->SetTitleYOffset(1.25);
0024
0025 gStyle->SetOptStat(kFALSE);
0026 gStyle->SetOptFit(0111);
0027 gStyle->SetStatH(0.1);
0028
0029 TCanvas *c1 = new TCanvas("c1", "c1",129,17,926,703);
0030
0031
0032
0033 c1->SetGrid(1,1);
0034
0035 TFile f0("/gpfs/defilippis/ValidationMisalignedTracker_ttbar.root");
0036 TTree *MyTree=FakeTracks;
0037
0038 TFile f1("/gpfs/defilippis/ValidationMisalignedTracker_ttbar_SurveyLAS_merged.root");
0039 TTree *MyTree1=FakeTracks;
0040
0041 TFile f2("/gpfs/defilippis/ValidationMisalignedTracker_ttbar_SurveyLASCosmics_merged.root");
0042 TTree *MyTree2=FakeTracks;
0043
0044 TFile f3("/gpfs/defilippis/ValidationMisalignedTracker_ttbar_10pb_merged.root");
0045 TTree *MyTree3=FakeTracks;
0046
0047 TFile f4("/gpfs/defilippis/ValidationMisalignedTracker_ttbar_100pb_merged.root");
0048 TTree *MyTree4=FakeTracks;
0049
0050 TFile f5("/gpfs/defilippis/ValidationMisalignedTracker_ttbar_10pb_NOAPE_merged.root");
0051 TTree *MyTree5=FakeTracks;
0052
0053
0054
0055
0056
0057
0058 TH1F *etazero = new TH1F("etazero","eta zero",70,0.,2.5);
0059 TH1F *etauno = new TH1F("etauno","eta uno",70,0.,2.5);
0060 TH1F *etadue = new TH1F("etadue","eta due",70,0.,2.5);
0061 TH1F *etatre = new TH1F("etatre","eta tre",70,0.,2.5);
0062
0063 MyTree->Project("etazero","abs(fakereceta)","fakerecnhit>=8");
0064 MyTree->Project("etauno","abs(fakereceta)","fakerecnhit>=8 && fake==1");
0065
0066 etadue->Add(etazero,etauno,1,-1);
0067
0068 etadue->Divide(etazero);
0069
0070
0071 float MC_bin=0.,Fake_bin=0.,err=0.;
0072 for (int k=1; k<71; k++){
0073 MC_bin = etazero->GetBinContent(k);
0074 Fake_bin =etadue->GetBinContent(k);
0075 if (MC_bin != 0.) {
0076 err=Fake_bin*(1.-Fake_bin)/MC_bin;
0077 if (err >0) {
0078 err=sqrt(err);
0079 }
0080 else {
0081 err=0.0001;
0082 }
0083 }
0084 etadue->SetBinError(k,err);
0085 MC_bin=0.;
0086 Fake_bin=0.;
0087 err=0.;
0088 }
0089
0090 etadue->SetTitle("Fake rate vs #eta for ttbar events");
0091 etadue->SetMarkerStyle(20);
0092 etadue->SetMarkerColor(2);
0093 etadue->SetMarkerSize(0.9);
0094 etadue->SetLineColor(1);
0095 etadue->SetLineWidth(1);
0096 etadue->Draw("P");
0097
0098 c1->Update();
0099
0100
0101
0102
0103
0104
0105 TH1F *etazero_scen1 = new TH1F("etazero_scen1","eta zero",70,0.,2.5);
0106 TH1F *etauno_scen1 = new TH1F("etauno_scen1","eta uno",70,0.,2.5);
0107 TH1F *etadue_scen1 = new TH1F("etadue_scen1","eta due",70,0.,2.5);
0108 TH1F *etatre_scen1 = new TH1F("etatre_scen1","eta tre",70,0.,2.5);
0109
0110 MyTree1->Project("etazero_scen1","abs(fakereceta)","fakerecnhit>=8");
0111 MyTree1->Project("etauno_scen1","abs(fakereceta)","fakerecnhit>=8 && fake==1");
0112
0113 etadue_scen1->Add(etazero_scen1,etauno_scen1,1,-1);
0114
0115 etadue_scen1->Divide(etazero_scen1);
0116
0117
0118 float MC_bin=0.,Fake_bin=0.,err=0.;
0119 for (int k=1; k<71; k++){
0120 MC_bin = etazero_scen1->GetBinContent(k);
0121 Fake_bin =etadue_scen1->GetBinContent(k);
0122 if (MC_bin != 0.) {
0123 err=Fake_bin*(1.-Fake_bin)/MC_bin;
0124 if (err >0) {
0125 err=sqrt(err);
0126 }
0127 else {
0128 err=0.0001;
0129 }
0130 }
0131 etadue_scen1->SetBinError(k,err);
0132 MC_bin=0.;
0133 Fake_bin=0.;
0134 err=0.;
0135 }
0136
0137
0138 etadue_scen1->SetTitle("Fake rate vs #eta for ttbar events");
0139 etadue_scen1->SetMarkerStyle(21);
0140 etadue_scen1->SetMarkerColor(3);
0141 etadue_scen1->SetMarkerSize(0.9);
0142 etadue_scen1->SetLineColor(1);
0143 etadue_scen1->SetLineWidth(1);
0144 etadue_scen1->Draw("P");
0145
0146 c1->Update();
0147 c1->WaitPrimitive();
0148
0149
0150
0151
0152
0153
0154 TH1F *etazero_scen2 = new TH1F("etazero_scen2","eta zero",70,0.,2.5);
0155 TH1F *etauno_scen2 = new TH1F("etauno_scen2","eta uno",70,0.,2.5);
0156 TH1F *etadue_scen2 = new TH1F("etadue_scen2","eta due",70,0.,2.5);
0157 TH1F *etatre_scen2 = new TH1F("etatre_scen2","eta tre",70,0.,2.5);
0158
0159 MyTree2->Project("etazero_scen2","abs(fakereceta)","fakerecnhit>=8");
0160 MyTree2->Project("etauno_scen2","abs(fakereceta)","fakerecnhit>=8 && fake==1");
0161
0162 etadue_scen2->Add(etazero_scen2,etauno_scen2,1,-1);
0163
0164 etadue_scen2->Divide(etazero_scen2);
0165
0166
0167 float MC_bin=0.,Fake_bin=0.,err=0.;
0168 for (int k=1; k<71; k++){
0169 MC_bin = etazero_scen2->GetBinContent(k);
0170 Fake_bin =etadue_scen2->GetBinContent(k);
0171 if (MC_bin != 0.) {
0172 err=Fake_bin*(1.-Fake_bin)/MC_bin;
0173 if (err >0) {
0174 err=sqrt(err);
0175 }
0176 else {
0177 err=0.0001;
0178 }
0179 }
0180 etadue_scen2->SetBinError(k,err);
0181 MC_bin=0.;
0182 Fake_bin=0.;
0183 err=0.;
0184 }
0185
0186
0187 etadue_scen2->SetTitle("Fake rate vs #eta for ttbar events");
0188 etadue_scen2->SetMarkerStyle(22);
0189 etadue_scen2->SetMarkerColor(4);
0190 etadue_scen2->SetMarkerSize(0.9);
0191 etadue_scen2->SetLineColor(1);
0192 etadue_scen2->SetLineWidth(1);
0193 etadue_scen2->Draw("P");
0194
0195 c1->Update();
0196 c1->WaitPrimitive();
0197
0198
0199
0200
0201
0202
0203 TH1F *etazero_scen3 = new TH1F("etazero_scen3","eta zero",70,0.,2.5);
0204 TH1F *etauno_scen3 = new TH1F("etauno_scen3","eta uno",70,0.,2.5);
0205 TH1F *etadue_scen3 = new TH1F("etadue_scen3","eta due",70,0.,2.5);
0206 TH1F *etatre_scen3 = new TH1F("etatre_scen3","eta tre",70,0.,2.5);
0207
0208 MyTree3->Project("etazero_scen3","abs(fakereceta)","fakerecnhit>=8");
0209 MyTree3->Project("etauno_scen3","abs(fakereceta)","fakerecnhit>=8 && fake==1");
0210
0211 etadue_scen3->Add(etazero_scen3,etauno_scen3,1,-1);
0212
0213 etadue_scen3->Divide(etazero_scen3);
0214
0215
0216 float MC_bin=0.,Fake_bin=0.,err=0.;
0217 for (int k=1; k<71; k++){
0218 MC_bin = etazero_scen3->GetBinContent(k);
0219 Fake_bin =etadue_scen3->GetBinContent(k);
0220 if (MC_bin != 0.) {
0221 err=Fake_bin*(1.-Fake_bin)/MC_bin;
0222 if (err >0) {
0223 err=sqrt(err);
0224 }
0225 else {
0226 err=0.0001;
0227 }
0228 }
0229 etadue_scen3->SetBinError(k,err);
0230 MC_bin=0.;
0231 Fake_bin=0.;
0232 err=0.;
0233 }
0234
0235 etadue_scen3->SetTitle("Fake rate vs #eta scen3");
0236 etadue_scen3->SetMarkerStyle(23);
0237 etadue_scen3->SetMarkerColor(5);
0238 etadue_scen3->SetMarkerSize(0.9);
0239 etadue_scen3->SetLineColor(1);
0240 etadue_scen3->SetLineWidth(1);
0241 etadue_scen3->Draw("P");
0242
0243 c1->Update();
0244 c1->WaitPrimitive();
0245
0246
0247
0248
0249
0250 TH1F *etazero_scen4 = new TH1F("etazero_scen4","eta zero",70,0.,2.5);
0251 TH1F *etauno_scen4 = new TH1F("etauno_scen4","eta uno",70,0.,2.5);
0252 TH1F *etadue_scen4 = new TH1F("etadue_scen4","eta due",70,0.,2.5);
0253 TH1F *etatre_scen4 = new TH1F("etatre_scen4","eta tre",70,0.,2.5);
0254
0255 MyTree4->Project("etazero_scen4","abs(fakereceta)","fakerecnhit>=8");
0256 MyTree4->Project("etauno_scen4","abs(fakereceta)","fakerecnhit>=8 && fake==1");
0257
0258 etadue_scen4->Add(etazero_scen4,etauno_scen4,1,-1);
0259
0260 etadue_scen4->Divide(etazero_scen4);
0261
0262
0263 float MC_bin=0.,Fake_bin=0.,err=0.;
0264 for (int k=1; k<71; k++){
0265 MC_bin = etazero_scen4->GetBinContent(k);
0266 Fake_bin =etadue_scen4->GetBinContent(k);
0267 if (MC_bin != 0.) {
0268 err=Fake_bin*(1.-Fake_bin)/MC_bin;
0269 if (err >0) {
0270 err=sqrt(err);
0271 }
0272 else {
0273 err=0.0001;
0274 }
0275 }
0276 etadue_scen4->SetBinError(k,err);
0277 MC_bin=0.;
0278 Fake_bin=0.;
0279 err=0.;
0280 }
0281
0282 etadue_scen4->SetTitle("Fake rate vs #eta scen4");
0283 etadue_scen4->SetMarkerStyle(24);
0284 etadue_scen4->SetMarkerColor(6);
0285 etadue_scen4->SetMarkerSize(0.9);
0286 etadue_scen4->SetLineColor(1);
0287 etadue_scen4->SetLineWidth(1);
0288 etadue_scen4->Draw("P");
0289
0290 c1->Update();
0291 c1->WaitPrimitive();
0292
0293
0294
0295
0296
0297 TH1F *etazero_noErr = new TH1F("etazero_noErr","eta zero",70,0.,2.5);
0298 TH1F *etauno_noErr = new TH1F("etauno_noErr","eta uno",70,0.,2.5);
0299 TH1F *etadue_noErr = new TH1F("etadue_noErr","eta due",70,0.,2.5);
0300 TH1F *etatre_noErr = new TH1F("etatre_noErr","eta tre",70,0.,2.5);
0301
0302 MyTree5->Project("etazero_noErr","abs(fakereceta)","fakerecnhit>=8");
0303 MyTree5->Project("etauno_noErr","abs(fakereceta)","fakerecnhit>=8 && fake==1");
0304
0305 etadue_noErr->Add(etazero_noErr,etauno_noErr,1,-1);
0306
0307 etadue_noErr->Divide(etazero_noErr);
0308
0309
0310 float MC_bin=0.,Fake_bin=0.,err=0.;
0311 for (int k=1; k<71; k++){
0312 MC_bin = etazero_noErr->GetBinContent(k);
0313 Fake_bin =etadue_noErr->GetBinContent(k);
0314 if (MC_bin != 0.) {
0315 err=Fake_bin*(1.-Fake_bin)/MC_bin;
0316 if (err >0) {
0317 err=sqrt(err);
0318 }
0319 else {
0320 err=0.0001;
0321 }
0322 }
0323 etadue_noErr->SetBinError(k,err);
0324 MC_bin=0.;
0325 Fake_bin=0.;
0326 err=0.;
0327 }
0328
0329 etadue_noErr->SetTitle("Fake rate vs #eta noErr");
0330 etadue_noErr->SetMarkerStyle(26);
0331 etadue_noErr->SetMarkerColor(7);
0332 etadue_noErr->SetMarkerSize(0.9);
0333 etadue_noErr->SetLineColor(1);
0334 etadue_noErr->SetLineWidth(1);
0335 etadue_noErr->Draw("P");
0336
0337 c1->Update();
0338 c1->WaitPrimitive();
0339
0340
0341
0342
0343
0344
0345 etadue->SetTitle("Fake rate vs #eta for ttbar events");
0346 etadue->SetXTitle("#eta");
0347 etadue->SetYTitle("Fake Rate");
0348 etadue->SetAxisRange(-0.005,0.35,"Y");
0349 etadue->Draw();
0350 etadue_noErr->Draw("same");
0351 etadue_scen1->Draw("same");
0352 etadue_scen2->Draw("same");
0353 etadue_scen3->Draw("same");
0354 etadue_scen4->Draw("same");
0355
0356 TLegend *leg1 = new TLegend(0.105,0.65,0.45,0.895);
0357 leg1->SetTextAlign(32);
0358 leg1->SetTextColor(1);
0359 leg1->SetTextSize(0.033);
0360 leg1->SetFillColor(0);
0361
0362
0363 leg1->AddEntry(etadue,"perfect ", "P");
0364 leg1->AddEntry(etadue_scen1,"SurveyLAS ", "P");
0365 leg1->AddEntry(etadue_scen2,"SurveyLASCosmics ", "P");
0366 leg1->AddEntry(etadue_scen3,"10 pb^{-1} ", "P");
0367 leg1->AddEntry(etadue_scen4,"100 pb^{-1} ", "P");
0368 leg1->AddEntry(etadue_noErr,"10 pb^{-1}; APE not used", "P");
0369
0370
0371 leg1->Draw();
0372
0373 c1->Update();
0374 c1->SaveAs("Fake_eta_ttbar.eps");
0375 c1->SaveAs("Fake_eta_ttbar.gif");
0376 c1->WaitPrimitive();
0377
0378 gROOT->Reset();
0379 gROOT->Clear();
0380
0381 delete c1;
0382 }