File indexing completed on 2025-08-05 08:12:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <cmath>
0012 #include <TFile.h>
0013 #include <TString.h>
0014 #include <TLine.h>
0015 #include <TTree.h>
0016 #include <cassert>
0017 #include "SaveCanvas.C"
0018 #include "SetOKStyle.C"
0019 using namespace std;
0020
0021 TFile * _file0 = NULL;
0022 TTree * T = NULL;
0023 TString cuts = "";
0024
0025 void
0026 DrawEcal_Likelihood_Sum(
0027
0028
0029
0030 TString base_dir =
0031 "../../sPHENIX_work/production_analysis_cemc2x2/embedding/emcstudies/pidstudies/spacal2d/fieldmap/",
0032
0033
0034 TString kine_config = "eta0"
0035
0036 )
0037 {
0038 SetOKStyle();
0039 gStyle->SetOptStat(0);
0040 gStyle->SetOptFit(1111);
0041 TVirtualFitter::SetDefaultFitter("Minuit2");
0042
0043 gSystem->Load("libg4eval.so");
0044 gSystem->Load("libemcal_ana.so");
0045 gSystem->Load("libg4vertex.so");
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079 RejectionCurve_AuAuSummaryPos("../../sPHENIX_work/production_analysis_cemc2x2/embedding/emcstudies/pidstudies/spacal2d/fieldmap/",
0080 "2-D Proj. SPACAL, e^{+} VS h^{+} in Au+Au 10%C");
0081
0082
0083
0084
0085
0086
0087
0088
0089 }
0090
0091 void
0092 RejectionCurvePos(
0093 TString base_dir =
0094 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
0095 TString kine_config = "eta0",
0096 TString ll_config = "Edep_LL_Distribution_eval_sample",
0097 TString hist_name = "hll_edep_diff",
0098 const double min_eff = 0.85)
0099 {
0100
0101 TCanvas *c1 = new TCanvas(
0102 "RejectionCurvePos" + kine_config + "_" + ll_config + "_" + hist_name,
0103 "RejectionCurvePos" + kine_config + "_" + ll_config + "_" + hist_name,
0104 900, 900);
0105 c1->Divide(1, 1);
0106 int idx = 1;
0107 TPad * p;
0108
0109 p = (TPad *) c1->cd(idx++);
0110 c1->Update();
0111 p->SetLogy();
0112
0113 p->DrawFrame(min_eff, 1, 1, 1e3,
0114 ";Electron Efficiency;Positively Charged Hadron Rejection");
0115
0116 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0117 hist_name, "e+", "pi+");
0118
0119 ge->SetLineColor(kRed + 2);
0120 ge->SetMarkerColor(kRed + 2);
0121 ge->SetFillColor(kRed - 9);
0122 ge->SetLineWidth(3);
0123
0124 ge->Draw("lx");
0125 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0126 hist_name, "e+", "kaon+");
0127
0128 ge->SetLineColor(kRed + 2);
0129 ge->SetMarkerColor(kRed + 2);
0130 ge->SetFillColor(kRed - 9);
0131 ge->SetLineWidth(3);
0132 ge->SetLineStyle(kDashed);
0133
0134 ge->Draw("lx");
0135 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0136 hist_name, "e+", "proton");
0137 ge->SetLineColor(kRed + 2);
0138 ge->SetMarkerColor(kRed + 2);
0139 ge->SetFillColor(kRed - 9);
0140 ge->SetLineWidth(3);
0141 ge->SetLineStyle(kDotted);
0142
0143 ge->Draw("lx");
0144
0145 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0146 hist_name, "e+", "pi+");
0147 ge->SetLineColor(kBlue + 2);
0148 ge->SetMarkerColor(kBlue + 2);
0149 ge->SetFillColor(kBlue - 9);
0150 ge->SetLineWidth(3);
0151
0152 ge->Draw("lx");
0153 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0154 hist_name, "e+", "kaon+");
0155
0156 ge->SetLineColor(kBlue + 2);
0157 ge->SetMarkerColor(kBlue + 2);
0158 ge->SetFillColor(kBlue - 9);
0159 ge->SetLineWidth(3);
0160 ge->SetLineStyle(kDashed);
0161
0162 ge->Draw("lx");
0163 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0164 hist_name, "e+", "proton");
0165 ge->SetLineColor(kBlue + 2);
0166 ge->SetMarkerColor(kBlue + 2);
0167 ge->SetFillColor(kBlue - 9);
0168 ge->SetLineWidth(3);
0169 ge->SetLineStyle(kDotted);
0170
0171 ge->Draw("lx");
0172
0173 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0174 hist_name, "e+", "pi+");
0175
0176 ge->SetLineColor(kGreen + 3);
0177 ge->SetMarkerColor(kGreen + 3);
0178 ge->SetFillColor(kGreen - 9);
0179 ge->SetLineWidth(3);
0180
0181 ge->Draw("lx");
0182 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0183 hist_name, "e+", "kaon+");
0184 ge->SetLineColor(kGreen + 3);
0185 ge->SetMarkerColor(kGreen + 3);
0186 ge->SetFillColor(kGreen - 9);
0187 ge->SetLineWidth(3);
0188 ge->SetLineStyle(kDashed);
0189
0190 ge->Draw("lx");
0191 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0192 hist_name, "e+", "proton");
0193 ge->SetLineColor(kGreen + 3);
0194 ge->SetMarkerColor(kGreen + 3);
0195 ge->SetFillColor(kGreen - 9);
0196 ge->SetLineWidth(3);
0197 ge->SetLineStyle(kDotted);
0198
0199 ge->Draw("lx");
0200
0201 SaveCanvas(c1,
0202 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()),
0203 kFALSE);
0204 }
0205
0206 void
0207 RejectionCurve(
0208 TString base_dir =
0209 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
0210 TString kine_config = "eta0",
0211 TString ll_config = "Edep_LL_Distribution_eval_sample",
0212 TString hist_name = "hll_edep_diff",
0213 const double min_eff = 0.85)
0214 {
0215
0216 TCanvas *c1 = new TCanvas(
0217 "RejectionCurve" + kine_config + "_" + ll_config + "_" + hist_name,
0218 "RejectionCurve" + kine_config + "_" + ll_config + "_" + hist_name, 900,
0219 900);
0220 c1->Divide(1, 1);
0221 int idx = 1;
0222 TPad * p;
0223
0224 p = (TPad *) c1->cd(idx++);
0225 c1->Update();
0226 p->SetLogy();
0227
0228 p->DrawFrame(min_eff, 1, 1, 1e3, ";Electron Efficiency;Hadron Rejection");
0229
0230 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0231 hist_name);
0232
0233 ge->SetLineColor(kRed + 2);
0234 ge->SetMarkerColor(kRed + 2);
0235 ge->SetFillColor(kRed - 9);
0236 ge->SetLineWidth(3);
0237
0238 ge->Draw("lx");
0239 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0240 hist_name, "e-", "kaon-");
0241
0242 ge->SetLineColor(kRed + 2);
0243 ge->SetMarkerColor(kRed + 2);
0244 ge->SetFillColor(kRed - 9);
0245 ge->SetLineWidth(3);
0246 ge->SetLineStyle(kDashed);
0247
0248 ge->Draw("lx");
0249 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0250 hist_name, "e-", "anti_proton");
0251 ge->SetLineColor(kRed + 2);
0252 ge->SetMarkerColor(kRed + 2);
0253 ge->SetFillColor(kRed - 9);
0254 ge->SetLineWidth(3);
0255 ge->SetLineStyle(kDotted);
0256
0257 ge->Draw("lx");
0258
0259 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0260 hist_name);
0261 ge->SetLineColor(kBlue + 2);
0262 ge->SetMarkerColor(kBlue + 2);
0263 ge->SetFillColor(kBlue - 9);
0264 ge->SetLineWidth(3);
0265
0266 ge->Draw("lx");
0267 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0268 hist_name, "e-", "kaon-");
0269
0270 ge->SetLineColor(kBlue + 2);
0271 ge->SetMarkerColor(kBlue + 2);
0272 ge->SetFillColor(kBlue - 9);
0273 ge->SetLineWidth(3);
0274 ge->SetLineStyle(kDashed);
0275
0276 ge->Draw("lx");
0277 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0278 hist_name, "e-", "anti_proton");
0279 ge->SetLineColor(kBlue + 2);
0280 ge->SetMarkerColor(kBlue + 2);
0281 ge->SetFillColor(kBlue - 9);
0282 ge->SetLineWidth(3);
0283 ge->SetLineStyle(kDotted);
0284
0285 ge->Draw("lx");
0286
0287 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0288 hist_name);
0289
0290 ge->SetLineColor(kGreen + 3);
0291 ge->SetMarkerColor(kGreen + 3);
0292 ge->SetFillColor(kGreen - 9);
0293 ge->SetLineWidth(3);
0294
0295 ge->Draw("lx");
0296 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0297 hist_name, "e-", "kaon-");
0298 ge->SetLineColor(kGreen + 3);
0299 ge->SetMarkerColor(kGreen + 3);
0300 ge->SetFillColor(kGreen - 9);
0301 ge->SetLineWidth(3);
0302 ge->SetLineStyle(kDashed);
0303
0304 ge->Draw("lx");
0305 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0306 hist_name, "e-", "anti_proton");
0307 ge->SetLineColor(kGreen + 3);
0308 ge->SetMarkerColor(kGreen + 3);
0309 ge->SetFillColor(kGreen - 9);
0310 ge->SetLineWidth(3);
0311 ge->SetLineStyle(kDotted);
0312
0313 ge->Draw("lx");
0314
0315 SaveCanvas(c1,
0316 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()),
0317 kFALSE);
0318 }
0319
0320 void
0321 RejectionCurve_PiProton(
0322 TString base_dir =
0323 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
0324 TString kine_config = "eta0",
0325 TString ll_config = "Edep_LL_Distribution_eval_sample",
0326 TString hist_name = "hll_edep_diff",
0327 const double min_eff = 0.85)
0328 {
0329
0330 TCanvas *c1 = new TCanvas(
0331 "RejectionCurve_PiProton" + kine_config + "_" + ll_config + "_"
0332 + hist_name,
0333 "RejectionCurve_PiProton" + kine_config + "_" + ll_config + "_"
0334 + hist_name, 900, 900);
0335 c1->Divide(1, 1);
0336 int idx = 1;
0337 TPad * p;
0338
0339 p = (TPad *) c1->cd(idx++);
0340 c1->Update();
0341 p->SetLogy();
0342
0343 p->DrawFrame(min_eff, 10, 1, 1e3, ";Electron Efficiency;Hadron Rejection");
0344
0345 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0346 hist_name);
0347
0348 ge->SetLineColor(kRed + 2);
0349 ge->SetMarkerColor(kRed + 2);
0350 ge->SetFillColor(kRed - 9);
0351 ge->SetLineWidth(3);
0352
0353 ge->Draw("lx");
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0365 hist_name, "e-", "anti_proton");
0366 ge->SetLineColor(kRed + 2);
0367 ge->SetMarkerColor(kRed + 2);
0368 ge->SetFillColor(kRed - 9);
0369 ge->SetLineWidth(3);
0370 ge->SetLineStyle(kDotted);
0371
0372 ge->Draw("lx");
0373
0374 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0375 hist_name);
0376 ge->SetLineColor(kBlue + 2);
0377 ge->SetMarkerColor(kBlue + 2);
0378 ge->SetFillColor(kBlue - 9);
0379 ge->SetLineWidth(3);
0380
0381 ge->Draw("lx");
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0393 hist_name, "e-", "anti_proton");
0394 ge->SetLineColor(kBlue + 2);
0395 ge->SetMarkerColor(kBlue + 2);
0396 ge->SetFillColor(kBlue - 9);
0397 ge->SetLineWidth(3);
0398 ge->SetLineStyle(kDotted);
0399
0400 ge->Draw("lx");
0401
0402 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0403 hist_name);
0404
0405 ge->SetLineColor(kGreen + 3);
0406 ge->SetMarkerColor(kGreen + 3);
0407 ge->SetFillColor(kGreen - 9);
0408 ge->SetLineWidth(3);
0409
0410 ge->Draw("lx");
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0421 hist_name, "e-", "anti_proton");
0422 ge->SetLineColor(kGreen + 3);
0423 ge->SetMarkerColor(kGreen + 3);
0424 ge->SetFillColor(kGreen - 9);
0425 ge->SetLineWidth(3);
0426 ge->SetLineStyle(kDotted);
0427
0428 ge->Draw("lx");
0429
0430 SaveCanvas(c1,
0431 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()),
0432 kFALSE);
0433 }
0434
0435 void
0436 RejectionCurve_PiProtonPos(
0437 TString base_dir =
0438 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
0439 TString kine_config = "eta0",
0440 TString ll_config = "Edep_LL_Distribution_eval_sample",
0441 TString hist_name = "hll_edep_diff",
0442 const double min_eff = 0.85)
0443 {
0444
0445 TCanvas *c1 = new TCanvas(
0446 "RejectionCurve_PiProtonPos" + kine_config + "_" + ll_config + "_"
0447 + hist_name,
0448 "RejectionCurve_PiProtonPos" + kine_config + "_" + ll_config + "_"
0449 + hist_name, 900, 900);
0450 c1->Divide(1, 1);
0451 int idx = 1;
0452 TPad * p;
0453
0454 p = (TPad *) c1->cd(idx++);
0455 c1->Update();
0456 p->SetLogy();
0457
0458 p->DrawFrame(min_eff, 10, 1, 1e3,
0459 ";Electron Efficiency;Positively Charged Hadron Rejection");
0460
0461 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0462 hist_name, "e+", "pi+");
0463
0464 ge->SetLineColor(kRed + 2);
0465 ge->SetMarkerColor(kRed + 2);
0466 ge->SetFillColor(kRed - 9);
0467 ge->SetLineWidth(3);
0468
0469 ge->Draw("lx");
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV", ll_config,
0481 hist_name, "e+", "proton");
0482 ge->SetLineColor(kRed + 2);
0483 ge->SetMarkerColor(kRed + 2);
0484 ge->SetFillColor(kRed - 9);
0485 ge->SetLineWidth(3);
0486 ge->SetLineStyle(kDotted);
0487
0488 ge->Draw("lx");
0489
0490 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0491 hist_name, "e+", "pi+");
0492 ge->SetLineColor(kBlue + 2);
0493 ge->SetMarkerColor(kBlue + 2);
0494 ge->SetFillColor(kBlue - 9);
0495 ge->SetLineWidth(3);
0496
0497 ge->Draw("lx");
0498
0499
0500
0501
0502
0503
0504
0505
0506
0507
0508 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV", ll_config,
0509 hist_name, "e+", "proton");
0510 ge->SetLineColor(kBlue + 2);
0511 ge->SetMarkerColor(kBlue + 2);
0512 ge->SetFillColor(kBlue - 9);
0513 ge->SetLineWidth(3);
0514 ge->SetLineStyle(kDotted);
0515
0516 ge->Draw("lx");
0517
0518 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0519 hist_name, "e+", "pi+");
0520
0521 ge->SetLineColor(kGreen + 3);
0522 ge->SetMarkerColor(kGreen + 3);
0523 ge->SetFillColor(kGreen - 9);
0524 ge->SetLineWidth(3);
0525
0526 ge->Draw("lx");
0527
0528
0529
0530
0531
0532
0533
0534
0535
0536 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV", ll_config,
0537 hist_name, "e+", "proton");
0538 ge->SetLineColor(kGreen + 3);
0539 ge->SetMarkerColor(kGreen + 3);
0540 ge->SetFillColor(kGreen - 9);
0541 ge->SetLineWidth(3);
0542 ge->SetLineStyle(kDotted);
0543
0544 ge->Draw("lx");
0545
0546 SaveCanvas(c1,
0547 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()),
0548 kFALSE);
0549 }
0550
0551 void
0552 RejectionCurve_RejMethodComparison(
0553 TString base_dir =
0554 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
0555 TString kine_config = "eta0",
0556 const double min_eff = 0.85)
0557 {
0558
0559 TCanvas *c1 = new TCanvas("RejectionCurve_RejMethodComparison_" + kine_config,
0560 "RejectionCurve_RejMethodComparison_" + kine_config, 900, 900);
0561 c1->Divide(1, 1);
0562 int idx = 1;
0563 TPad * p;
0564
0565 p = (TPad *) c1->cd(idx++);
0566 c1->Update();
0567 p->SetLogy();
0568 p->SetGridx(0);
0569 p->SetGridy(0);
0570
0571 p->DrawFrame(min_eff, 10, 1, 1e3, ";Electron Efficiency;Hadron Rejection");
0572 TLine * l = new TLine(0.95, 10, 0.95, 1e3);
0573 l->SetLineColor(kGray);
0574 l->SetLineWidth(5);
0575 l->Draw();
0576
0577 TLatex * text = new TLatex(0.85, 1e3 * 1.1,
0578 "2-D Proj. SPACAL, e^{-}-#pi^{-} separation @ 0 < #eta < 0.1");
0579 text->SetTextAlign(11);
0580 text->SetTextSize(0.044);
0581 text->SetTextFont(42);
0582 text->Draw();
0583
0584 TLegend * leg1 = new TLegend(0.12, 0.15, 0.65, 0.4);
0585 TLegend * leg2 = new TLegend(0.65, 0.15, 0.85, 0.4);
0586
0587 TGraphErrors *ge = new TGraphErrors();
0588 ge->SetLineWidth(3);
0589 leg1->AddEntry(ge, "EMCal+HCal Likelihood", "lx");
0590 TGraphErrors *ge = new TGraphErrors();
0591 ge->SetLineWidth(3);
0592 ge->SetLineStyle(kDashed);
0593 leg1->AddEntry(ge, "EMCal E/p Likelihood", "lx");
0594 TGraphErrors *ge = new TGraphErrors();
0595 ge->SetLineWidth(3);
0596 ge->SetLineStyle(kDotted);
0597 leg1->AddEntry(ge, "Cut on min. E/p", "lx");
0598
0599 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
0600 "Edep_LL_Distribution_eval_sample", "hll_edep_diff");
0601 ge->SetLineColor(kRed + 2);
0602 ge->SetMarkerColor(kRed + 2);
0603 ge->SetFillColor(kRed - 9);
0604 ge->SetLineWidth(3);
0605
0606 ge->Draw("lx");
0607 leg2->AddEntry(ge, "8 GeV/c", "lx");
0608 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
0609 "EP_LL_Distribution_eval_sample", "hll_ep_diff");
0610 ge->SetLineColor(kRed + 2);
0611 ge->SetMarkerColor(kRed + 2);
0612 ge->SetFillColor(kRed - 9);
0613 ge->SetLineWidth(3);
0614 ge->SetLineStyle(kDashed);
0615
0616 ge->Draw("lx");
0617 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
0618 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep");
0619 ge->SetLineColor(kRed + 2);
0620 ge->SetMarkerColor(kRed + 2);
0621 ge->SetFillColor(kRed - 9);
0622 ge->SetLineWidth(3);
0623 ge->SetLineStyle(kDotted);
0624
0625 ge->Draw("lx");
0626
0627 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
0628 "Edep_LL_Distribution_eval_sample", "hll_edep_diff");
0629 ge->SetLineColor(kBlue + 2);
0630 ge->SetMarkerColor(kBlue + 2);
0631 ge->SetFillColor(kBlue - 9);
0632 ge->SetLineWidth(3);
0633
0634 ge->Draw("lx");
0635 leg2->AddEntry(ge, "4 GeV/c", "lx");
0636 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
0637 "EP_LL_Distribution_eval_sample", "hll_ep_diff");
0638 ge->SetLineColor(kBlue + 2);
0639 ge->SetMarkerColor(kBlue + 2);
0640 ge->SetFillColor(kBlue - 9);
0641 ge->SetLineWidth(3);
0642 ge->SetLineStyle(kDashed);
0643
0644 ge->Draw("lx");
0645 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
0646 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep");
0647 ge->SetLineColor(kBlue + 2);
0648 ge->SetMarkerColor(kBlue + 2);
0649 ge->SetFillColor(kBlue - 9);
0650 ge->SetLineWidth(3);
0651 ge->SetLineStyle(kDotted);
0652
0653 ge->Draw("lx");
0654
0655 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
0656 "Edep_LL_Distribution_eval_sample", "hll_edep_diff");
0657 ge->SetLineColor(kGreen + 3);
0658 ge->SetMarkerColor(kGreen + 3);
0659 ge->SetFillColor(kGreen - 9);
0660 ge->SetLineWidth(3);
0661
0662 ge->Draw("lx");
0663 leg2->AddEntry(ge, "2 GeV/c", "lx");
0664 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
0665 "EP_LL_Distribution_eval_sample", "hll_ep_diff");
0666 ge->SetLineColor(kGreen + 3);
0667 ge->SetMarkerColor(kGreen + 3);
0668 ge->SetFillColor(kGreen - 9);
0669 ge->SetLineWidth(3);
0670 ge->SetLineStyle(kDashed);
0671
0672 ge->Draw("lx");
0673 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
0674 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep");
0675 ge->SetLineColor(kGreen + 3);
0676 ge->SetMarkerColor(kGreen + 3);
0677 ge->SetFillColor(kGreen - 9);
0678 ge->SetLineWidth(3);
0679 ge->SetLineStyle(kDotted);
0680
0681 ge->Draw("lx");
0682
0683 leg2->Draw();
0684 leg1->Draw();
0685
0686 SaveCanvas(c1,
0687 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
0688 }
0689
0690 void
0691 RejectionCurve_ppSummary(
0692 TString base_dir =
0693 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
0694
0695 const double min_eff = 0.85)
0696 {
0697
0698 TCanvas *c1 = new TCanvas("RejectionCurve_ppSummary",
0699 "RejectionCurve_ppSummary", 900, 900);
0700 c1->Divide(1, 1);
0701 int idx = 1;
0702 TPad * p;
0703
0704 p = (TPad *) c1->cd(idx++);
0705 c1->Update();
0706 p->SetLogy();
0707 p->SetGridx(0);
0708 p->SetGridy(0);
0709
0710 p->DrawFrame(min_eff, 5, 1, 1e3,
0711 ";Electron Efficiency;Negatively Charged Hadron Rejection");
0712 TLine * l = new TLine(0.95, 5, 0.95, 1e3);
0713 l->SetLineColor(kGray);
0714 l->SetLineWidth(5);
0715 l->Draw();
0716
0717 TLatex * text = new TLatex(0.85, 1e3 * 1.1,
0718 "2-D Proj. SPACAL, e^{-}-h^{-} separation in p+p");
0719 text->SetTextAlign(11);
0720 text->SetTextSize(0.044);
0721 text->SetTextFont(42);
0722 text->Draw();
0723
0724 TLegend * leg1 = new TLegend(0.12, 0.15, 0.42, 0.4);
0725 TLegend * leg2 = new TLegend(0.42, 0.15, 0.67, 0.4);
0726
0727 TGraphErrors *ge = new TGraphErrors();
0728 ge->SetLineWidth(3);
0729 leg1->AddEntry(ge, "0.0 < #eta < 0.1", "lx");
0730 TGraphErrors *ge = new TGraphErrors();
0731 ge->SetLineWidth(3);
0732 ge->SetLineStyle(kDashed);
0733 leg1->AddEntry(ge, "0.9 < #eta < 1.0", "lx");
0734
0735
0736
0737
0738
0739 TString kine_config = "eta0";
0740 const double pt_over_p = 0.998;
0741
0742 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
0743 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
0744
0745
0746 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0747 kine_config + "_8GeV",
0748 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
0749 TGraphErrors *ge = MergeRejCurve(ge_pi,
0750 1 + GetHPiRatio(8 * pt_over_p, "kaon-", "pp"), ge_anti_proton,
0751 GetHPiRatio(8 * pt_over_p, "anti_proton", "pp"));
0752 ge->SetLineColor(kRed + 2);
0753 ge->SetMarkerColor(kRed + 2);
0754 ge->SetFillColor(kRed - 9);
0755 ge->SetLineWidth(3);
0756
0757 ge->Draw("lx");
0758 leg2->AddEntry(ge, "8 GeV/c", "lx");
0759
0760 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
0761 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
0762
0763
0764 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0765 kine_config + "_4GeV",
0766 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
0767 TGraphErrors *ge = MergeRejCurve(ge_pi,
0768 1 + GetHPiRatio(4 * pt_over_p, "kaon-", "pp"), ge_anti_proton,
0769 GetHPiRatio(4 * pt_over_p, "anti_proton", "pp"));
0770 ge->SetLineColor(kBlue + 2);
0771 ge->SetMarkerColor(kBlue + 2);
0772 ge->SetFillColor(kBlue - 9);
0773 ge->SetLineWidth(3);
0774
0775 ge->Draw("lx");
0776 leg2->AddEntry(ge, "4 GeV/c", "lx");
0777
0778 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
0779 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
0780
0781
0782 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0783 kine_config + "_2GeV",
0784 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
0785 TGraphErrors *ge = MergeRejCurve(ge_pi,
0786 1 + GetHPiRatio(2 * pt_over_p, "kaon-", "pp"), ge_anti_proton,
0787 GetHPiRatio(2 * pt_over_p, "anti_proton", "pp"));
0788 ge->SetLineColor(kGreen + 3);
0789 ge->SetMarkerColor(kGreen + 3);
0790 ge->SetFillColor(kGreen - 9);
0791 ge->SetLineWidth(3);
0792
0793 ge->Draw("lx");
0794 leg2->AddEntry(ge, "2 GeV/c", "lx");
0795
0796 TString kine_config = "eta0.90";
0797 const double pt_over_p = 0.673;
0798
0799 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
0800 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
0801
0802
0803 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0804 kine_config + "_8GeV",
0805 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
0806 TGraphErrors *ge = MergeRejCurve(ge_pi,
0807 1 + GetHPiRatio(8 * pt_over_p, "kaon-", "pp"), ge_anti_proton,
0808 GetHPiRatio(8 * pt_over_p, "anti_proton", "pp"));
0809 ge->SetLineColor(kRed + 2);
0810 ge->SetMarkerColor(kRed + 2);
0811 ge->SetFillColor(kRed - 9);
0812 ge->SetLineWidth(3);
0813
0814 ge->SetLineStyle(kDashed);
0815 ge->Draw("lx");
0816
0817 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
0818 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
0819
0820
0821 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0822 kine_config + "_4GeV",
0823 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
0824 TGraphErrors *ge = MergeRejCurve(ge_pi,
0825 1 + GetHPiRatio(4 * pt_over_p, "kaon-", "pp"), ge_anti_proton,
0826 GetHPiRatio(4 * pt_over_p, "anti_proton", "pp"));
0827 ge->SetLineColor(kBlue + 2);
0828 ge->SetMarkerColor(kBlue + 2);
0829 ge->SetFillColor(kBlue - 9);
0830 ge->SetLineWidth(3);
0831
0832 ge->SetLineStyle(kDashed);
0833 ge->Draw("lx");
0834
0835 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
0836 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
0837
0838
0839 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0840 kine_config + "_2GeV",
0841 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
0842 TGraphErrors *ge = MergeRejCurve(ge_pi,
0843 1 + GetHPiRatio(2 * pt_over_p, "kaon-", "pp"), ge_anti_proton,
0844 GetHPiRatio(2 * pt_over_p, "anti_proton", "pp"));
0845 ge->SetLineColor(kGreen + 3);
0846 ge->SetMarkerColor(kGreen + 3);
0847 ge->SetFillColor(kGreen - 9);
0848 ge->SetLineWidth(3);
0849
0850 ge->SetLineStyle(kDashed);
0851 ge->Draw("lx");
0852
0853 leg2->Draw();
0854 leg1->Draw();
0855
0856 SaveCanvas(c1,
0857 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
0858 }
0859
0860 void
0861 RejectionCurve_ppSummaryPos(
0862 TString base_dir =
0863 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
0864
0865 const double min_eff = 0.85)
0866 {
0867
0868 TCanvas *c1 = new TCanvas("RejectionCurve_ppSummaryPos",
0869 "RejectionCurve_ppSummaryPos", 900, 900);
0870 c1->Divide(1, 1);
0871 int idx = 1;
0872 TPad * p;
0873
0874 p = (TPad *) c1->cd(idx++);
0875 c1->Update();
0876 p->SetLogy();
0877 p->SetGridx(0);
0878 p->SetGridy(0);
0879
0880 p->DrawFrame(min_eff, 5, 1, 1e3,
0881 ";Electron Efficiency;Positively Charged Hadron Rejection");
0882 TLine * l = new TLine(0.95, 5, 0.95, 1e3);
0883 l->SetLineColor(kGray);
0884 l->SetLineWidth(5);
0885 l->Draw();
0886
0887 TLatex * text = new TLatex(0.85, 1e3 * 1.1,
0888 "2-D Proj. SPACAL, e^{+}-h^{+} separation in p+p");
0889 text->SetTextAlign(11);
0890 text->SetTextSize(0.044);
0891 text->SetTextFont(42);
0892 text->Draw();
0893
0894 TLegend * leg1 = new TLegend(0.12, 0.15, 0.42, 0.4);
0895 TLegend * leg2 = new TLegend(0.42, 0.15, 0.67, 0.4);
0896
0897 TGraphErrors *ge = new TGraphErrors();
0898 ge->SetLineWidth(3);
0899 leg1->AddEntry(ge, "0.0 < #eta < 0.1", "lx");
0900 TGraphErrors *ge = new TGraphErrors();
0901 ge->SetLineWidth(3);
0902 ge->SetLineStyle(kDashed);
0903 leg1->AddEntry(ge, "0.9 < #eta < 1.0", "lx");
0904
0905
0906
0907
0908
0909 TString kine_config = "eta0";
0910 const double pt_over_p = 0.998;
0911
0912 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
0913 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
0914
0915
0916 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0917 kine_config + "_8GeV",
0918 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
0919 TGraphErrors *ge = MergeRejCurve(ge_pi,
0920 1 + GetHPiRatio(8 * pt_over_p, "kaon+", "pp"), ge_anti_proton,
0921 GetHPiRatio(8 * pt_over_p, "proton", "pp"));
0922 ge->SetLineColor(kRed + 2);
0923 ge->SetMarkerColor(kRed + 2);
0924 ge->SetFillColor(kRed - 9);
0925 ge->SetLineWidth(3);
0926
0927 ge->Draw("lx");
0928 leg2->AddEntry(ge, "8 GeV/c", "lx");
0929
0930 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
0931 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
0932
0933
0934 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0935 kine_config + "_4GeV",
0936 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
0937 TGraphErrors *ge = MergeRejCurve(ge_pi,
0938 1 + GetHPiRatio(4 * pt_over_p, "kaon+", "pp"), ge_anti_proton,
0939 GetHPiRatio(4 * pt_over_p, "proton", "pp"));
0940 ge->SetLineColor(kBlue + 2);
0941 ge->SetMarkerColor(kBlue + 2);
0942 ge->SetFillColor(kBlue - 9);
0943 ge->SetLineWidth(3);
0944
0945 ge->Draw("lx");
0946 leg2->AddEntry(ge, "4 GeV/c", "lx");
0947
0948 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
0949 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
0950
0951
0952 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0953 kine_config + "_2GeV",
0954 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
0955 TGraphErrors *ge = MergeRejCurve(ge_pi,
0956 1 + GetHPiRatio(2 * pt_over_p, "kaon+", "pp"), ge_anti_proton,
0957 GetHPiRatio(2 * pt_over_p, "proton", "pp"));
0958 ge->SetLineColor(kGreen + 3);
0959 ge->SetMarkerColor(kGreen + 3);
0960 ge->SetFillColor(kGreen - 9);
0961 ge->SetLineWidth(3);
0962
0963 ge->Draw("lx");
0964 leg2->AddEntry(ge, "2 GeV/c", "lx");
0965
0966 TString kine_config = "eta0.90";
0967 const double pt_over_p = 0.673;
0968
0969 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
0970 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
0971
0972
0973 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0974 kine_config + "_8GeV",
0975 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
0976 TGraphErrors *ge = MergeRejCurve(ge_pi,
0977 1 + GetHPiRatio(8 * pt_over_p, "kaon+", "pp"), ge_anti_proton,
0978 GetHPiRatio(8 * pt_over_p, "proton", "pp"));
0979 ge->SetLineColor(kRed + 2);
0980 ge->SetMarkerColor(kRed + 2);
0981 ge->SetFillColor(kRed - 9);
0982 ge->SetLineWidth(3);
0983
0984 ge->SetLineStyle(kDashed);
0985 ge->Draw("lx");
0986
0987 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
0988 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
0989
0990
0991 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
0992 kine_config + "_4GeV",
0993 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
0994 TGraphErrors *ge = MergeRejCurve(ge_pi,
0995 1 + GetHPiRatio(4 * pt_over_p, "kaon+", "pp"), ge_anti_proton,
0996 GetHPiRatio(4 * pt_over_p, "proton", "pp"));
0997 ge->SetLineColor(kBlue + 2);
0998 ge->SetMarkerColor(kBlue + 2);
0999 ge->SetFillColor(kBlue - 9);
1000 ge->SetLineWidth(3);
1001
1002 ge->SetLineStyle(kDashed);
1003 ge->Draw("lx");
1004
1005 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1006 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
1007
1008
1009 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1010 kine_config + "_2GeV",
1011 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
1012 TGraphErrors *ge = MergeRejCurve(ge_pi,
1013 1 + GetHPiRatio(2 * pt_over_p, "kaon+", "pp"), ge_anti_proton,
1014 GetHPiRatio(2 * pt_over_p, "proton", "pp"));
1015 ge->SetLineColor(kGreen + 3);
1016 ge->SetMarkerColor(kGreen + 3);
1017 ge->SetFillColor(kGreen - 9);
1018 ge->SetLineWidth(3);
1019
1020 ge->SetLineStyle(kDashed);
1021 ge->Draw("lx");
1022
1023 leg2->Draw();
1024 leg1->Draw();
1025
1026 SaveCanvas(c1,
1027 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
1028 }
1029
1030 void
1031 RejectionCurve_AuAuSummary(
1032 TString base_dir =
1033 "../../sPHENIX_work/production_analysis_cemc2x2/embedding/emcstudies/pidstudies/spacal2d/fieldmap/",
1034 TString label = "2-D Proj. SPACAL, e^{-} VS h^{-} in Au+Au 10%C",
1035 const double min_eff = 0.6)
1036 {
1037
1038 TCanvas *c1 = new TCanvas("RejectionCurve_AuAuSummary",
1039 "RejectionCurve_AuAuSummary", 900, 900);
1040 c1->Divide(1, 1);
1041 int idx = 1;
1042 TPad * p;
1043
1044 p = (TPad *) c1->cd(idx++);
1045 c1->Update();
1046 p->SetLogy();
1047 p->SetGridx(0);
1048 p->SetGridy(0);
1049
1050 p->DrawFrame(min_eff, 1, 1, 1e3,
1051 ";Electron Efficiency;Negatively Charged Hadron Rejection");
1052 TLine * l = new TLine(0.9, 1, 0.9, 1e3);
1053 l->SetLineColor(kGray);
1054 l->SetLineWidth(5);
1055 l->Draw();
1056
1057 TLatex * text = new TLatex(0.6, 1e3 * 1.2, label);
1058 text->SetTextAlign(11);
1059 text->SetTextSize(0.044);
1060 text->SetTextFont(42);
1061 text->Draw();
1062
1063 TLegend * leg1 = new TLegend(0.12, 0.15, 0.42, 0.4);
1064 TLegend * leg2 = new TLegend(0.42, 0.15, 0.67, 0.4);
1065
1066 TGraphErrors *ge = new TGraphErrors();
1067 ge->SetLineWidth(3);
1068 leg1->AddEntry(ge, "0.0 < #eta < 0.1", "lx");
1069 TGraphErrors *ge = new TGraphErrors();
1070 ge->SetLineWidth(3);
1071 ge->SetLineStyle(kDashed);
1072 leg1->AddEntry(ge, "0.9 < #eta < 1.0", "lx");
1073
1074
1075
1076
1077
1078 TString kine_config = "eta0";
1079 const double pt_over_p = 0.998;
1080
1081 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1082 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
1083 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1084 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "kaon-");
1085 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1086 kine_config + "_8GeV",
1087 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1088 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1089 GetHPiRatio(8, "kaon-", "AuAu10%C"), ge_anti_proton,
1090 GetHPiRatio(8, "anti_proton", "AuAu10%C"));
1091 ge->SetLineColor(kRed + 2);
1092 ge->SetMarkerColor(kRed + 2);
1093 ge->SetFillColor(kRed - 9);
1094 ge->SetLineWidth(3);
1095
1096 ge->Draw("lx");
1097
1098 ge->SetName("MergeExtractRejCurve_" + kine_config + "_8GeV");
1099 leg2->AddEntry(ge, "8 GeV/c", "lx");
1100
1101 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1102 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
1103 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1104 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "kaon-");
1105 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1106 kine_config + "_4GeV",
1107 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1108 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1109 GetHPiRatio(4, "kaon-", "AuAu10%C"), ge_anti_proton,
1110 GetHPiRatio(4, "anti_proton", "AuAu10%C"));
1111 ge->SetLineColor(kBlue + 2);
1112 ge->SetMarkerColor(kBlue + 2);
1113 ge->SetFillColor(kBlue - 9);
1114 ge->SetLineWidth(3);
1115
1116 ge->Draw("lx");
1117 ge->SetName("MergeExtractRejCurve_" + kine_config + "_4GeV");
1118 leg2->AddEntry(ge, "4 GeV/c", "lx");
1119
1120 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1121 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
1122 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1123 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "kaon-");
1124 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1125 kine_config + "_2GeV",
1126 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1127 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1128 GetHPiRatio(2, "kaon-", "AuAu10%C"), ge_anti_proton,
1129 GetHPiRatio(2, "anti_proton", "AuAu10%C"));
1130 ge->SetLineColor(kGreen + 3);
1131 ge->SetMarkerColor(kGreen + 3);
1132 ge->SetFillColor(kGreen - 9);
1133 ge->SetLineWidth(3);
1134
1135 ge->Draw("lx");
1136 ge->SetName("MergeExtractRejCurve_" + kine_config + "_2GeV");
1137 leg2->AddEntry(ge, "2 GeV/c", "lx");
1138
1139 TString kine_config = "eta0.90";
1140 const double pt_over_p = 0.673;
1141
1142 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1143 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
1144 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1145 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "kaon-");
1146 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1147 kine_config + "_8GeV",
1148 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1149 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1150 GetHPiRatio(8, "kaon-", "AuAu10%C"), ge_anti_proton,
1151 GetHPiRatio(8, "anti_proton", "AuAu10%C"));
1152 ge->SetLineColor(kRed + 2);
1153 ge->SetMarkerColor(kRed + 2);
1154 ge->SetFillColor(kRed - 9);
1155 ge->SetLineWidth(3);
1156
1157 ge->SetLineStyle(kDashed);
1158 ge->SetName("MergeExtractRejCurve_" + kine_config + "_8GeV");
1159 ge->Draw("lx");
1160
1161 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1162 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
1163 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1164 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "kaon-");
1165 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1166 kine_config + "_4GeV",
1167 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1168 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1169 GetHPiRatio(4, "kaon-", "AuAu10%C"), ge_anti_proton,
1170 GetHPiRatio(4, "anti_proton", "AuAu10%C"));
1171 ge->SetLineColor(kBlue + 2);
1172 ge->SetMarkerColor(kBlue + 2);
1173 ge->SetFillColor(kBlue - 9);
1174 ge->SetLineWidth(3);
1175
1176 ge->SetLineStyle(kDashed);
1177 ge->SetName("MergeExtractRejCurve_" + kine_config + "_4GeV");
1178 ge->Draw("lx");
1179
1180 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1181 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "pi-");
1182 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1183 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "kaon-");
1184 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1185 kine_config + "_2GeV",
1186 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1187 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1188 GetHPiRatio(2, "kaon-", "AuAu10%C"), ge_anti_proton,
1189 GetHPiRatio(2, "anti_proton", "AuAu10%C"));
1190 ge->SetLineColor(kGreen + 3);
1191 ge->SetMarkerColor(kGreen + 3);
1192 ge->SetFillColor(kGreen - 9);
1193 ge->SetLineWidth(3);
1194
1195 ge->SetLineStyle(kDashed);
1196 ge->SetName("MergeExtractRejCurve_" + kine_config + "_2GeV");
1197 ge->Draw("lx");
1198
1199 leg2->Draw();
1200 leg1->Draw();
1201
1202 SaveCanvas(c1,
1203 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
1204 }
1205
1206 void
1207 RejectionCurve_AuAuSummaryPos(
1208 TString base_dir =
1209 "../../sPHENIX_work/production_analysis_cemc2x2/embedding/emcstudies/pidstudies/spacal2d/fieldmap/",
1210 TString label = "2-D Proj. SPACAL, e^{-} VS h^{+} in Au+Au 10%C",
1211 const double min_eff = 0.6)
1212 {
1213
1214 TCanvas *c1 = new TCanvas("RejectionCurve_AuAuSummaryPos",
1215 "RejectionCurve_AuAuSummaryPos: " + label, 900, 900);
1216 c1->Divide(1, 1);
1217 int idx = 1;
1218 TPad * p;
1219
1220 p = (TPad *) c1->cd(idx++);
1221 c1->Update();
1222 p->SetLogy();
1223 p->SetGridx(0);
1224 p->SetGridy(0);
1225
1226 p->DrawFrame(min_eff, 1, 1, 1e3,
1227 ";Electron Efficiency;Positively Charged Hadron Rejection");
1228 TLine * l = new TLine(0.9, 1, 0.9, 1e3);
1229 l->SetLineColor(kGray);
1230 l->SetLineWidth(5);
1231 l->Draw();
1232
1233 TLatex * text = new TLatex(0.6, 1e3 * 1.2, label);
1234 text->SetTextAlign(11);
1235 text->SetTextSize(0.044);
1236 text->SetTextFont(42);
1237 text->Draw();
1238
1239 TLegend * leg1 = new TLegend(0.12, 0.15, 0.42, 0.4);
1240 TLegend * leg2 = new TLegend(0.42, 0.15, 0.67, 0.4);
1241
1242 TGraphErrors *ge = new TGraphErrors();
1243 ge->SetLineWidth(3);
1244 leg1->AddEntry(ge, "0.0 < #eta < 0.1", "lx");
1245 TGraphErrors *ge = new TGraphErrors();
1246 ge->SetLineWidth(3);
1247 ge->SetLineStyle(kDashed);
1248 leg1->AddEntry(ge, "0.9 < #eta < 1.0", "lx");
1249
1250
1251
1252
1253
1254 TString kine_config = "eta0";
1255 const double pt_over_p = 0.998;
1256
1257 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1258 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
1259 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1260 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "kaon+");
1261 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1262 kine_config + "_8GeV",
1263 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
1264 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1265 GetHPiRatio(8, "kaon+", "AuAu10%C"), ge_anti_proton,
1266 GetHPiRatio(8, "proton", "AuAu10%C"));
1267 ge->SetLineColor(kRed + 2);
1268 ge->SetMarkerColor(kRed + 2);
1269 ge->SetFillColor(kRed - 9);
1270 ge->SetLineWidth(3);
1271
1272 ge->SetName("MergeExtractRejCurve_" + kine_config + "_8GeV");
1273 ge->Draw("lx");
1274 leg2->AddEntry(ge, "8 GeV/c", "lx");
1275
1276 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1277 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
1278 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1279 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "kaon+");
1280 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1281 kine_config + "_4GeV",
1282 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
1283 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1284 GetHPiRatio(4, "kaon+", "AuAu10%C"), ge_anti_proton,
1285 GetHPiRatio(4, "proton", "AuAu10%C"));
1286 ge->SetLineColor(kBlue + 2);
1287 ge->SetMarkerColor(kBlue + 2);
1288 ge->SetFillColor(kBlue - 9);
1289 ge->SetLineWidth(3);
1290
1291 ge->SetName("MergeExtractRejCurve_" + kine_config + "_4GeV");
1292 ge->Draw("lx");
1293 leg2->AddEntry(ge, "4 GeV/c", "lx");
1294
1295 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1296 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
1297 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1298 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "kaon+");
1299 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1300 kine_config + "_2GeV",
1301 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
1302 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1303 GetHPiRatio(2, "kaon+", "AuAu10%C"), ge_anti_proton,
1304 GetHPiRatio(2, "proton", "AuAu10%C"));
1305 ge->SetLineColor(kGreen + 3);
1306 ge->SetMarkerColor(kGreen + 3);
1307 ge->SetFillColor(kGreen - 9);
1308 ge->SetLineWidth(3);
1309
1310 ge->Draw("lx");
1311 ge->SetName("MergeExtractRejCurve_" + kine_config + "_2GeV");
1312 leg2->AddEntry(ge, "2 GeV/c", "lx");
1313
1314 TString kine_config = "eta0.90";
1315 const double pt_over_p = 0.673;
1316
1317 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1318 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
1319 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1320 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "kaon+");
1321 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1322 kine_config + "_8GeV",
1323 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
1324 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1325 GetHPiRatio(8, "kaon+", "AuAu10%C"), ge_anti_proton,
1326 GetHPiRatio(8, "proton", "AuAu10%C"));
1327 ge->SetLineColor(kRed + 2);
1328 ge->SetMarkerColor(kRed + 2);
1329 ge->SetFillColor(kRed - 9);
1330 ge->SetLineWidth(3);
1331
1332 ge->SetLineStyle(kDashed);
1333 ge->SetName("MergeExtractRejCurve_" + kine_config + "_8GeV");
1334 ge->Draw("lx");
1335
1336 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1337 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
1338 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1339 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "kaon+");
1340 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1341 kine_config + "_4GeV",
1342 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
1343 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1344 GetHPiRatio(4, "kaon+", "AuAu10%C"), ge_anti_proton,
1345 GetHPiRatio(4, "proton", "AuAu10%C"));
1346 ge->SetLineColor(kBlue + 2);
1347 ge->SetMarkerColor(kBlue + 2);
1348 ge->SetFillColor(kBlue - 9);
1349 ge->SetLineWidth(3);
1350
1351 ge->SetLineStyle(kDashed);
1352 ge->SetName("MergeExtractRejCurve_" + kine_config + "_4GeV");
1353 ge->Draw("lx");
1354
1355 TGraphErrors *ge_pi = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1356 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "pi+");
1357 TGraphErrors *ge_kaon = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1358 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "kaon+");
1359 TGraphErrors *ge_anti_proton = ExtractRejCurve(base_dir,
1360 kine_config + "_2GeV",
1361 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e+", "proton");
1362 TGraphErrors *ge = MergeRejCurve(ge_pi, 1, ge_kaon,
1363 GetHPiRatio(2, "kaon+", "AuAu10%C"), ge_anti_proton,
1364 GetHPiRatio(2, "proton", "AuAu10%C"));
1365 ge->SetLineColor(kGreen + 3);
1366 ge->SetMarkerColor(kGreen + 3);
1367 ge->SetFillColor(kGreen - 9);
1368 ge->SetLineWidth(3);
1369
1370 ge->SetLineStyle(kDashed);
1371 ge->SetName("MergeExtractRejCurve_" + kine_config + "_2GeV");
1372 ge->Draw("lx");
1373
1374 leg2->Draw();
1375 leg1->Draw();
1376
1377 SaveCanvas(c1,
1378 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
1379 }
1380
1381 TGraph *
1382 rejection_ratio(TFile * f_2d, TFile * f_1d, TString graph_name)
1383 {
1384 cout << "rejection_ratio - processing " << graph_name << endl;
1385
1386 TGraph * g_2d = (TGraph *) f_2d->GetObjectChecked(graph_name, "TGraph");
1387 assert(g_2d);
1388 TGraph * g_1d = (TGraph *) f_1d->GetObjectChecked(graph_name, "TGraph");
1389 assert(g_1d);
1390
1391 assert(g_1d -> GetN() == g_2d -> GetN());
1392
1393 double xs[10000] =
1394 { 0 };
1395 double ys[10000] =
1396 { 0 };
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408 int i = 0;
1409 for (double x = 0.6; x < 0.99; x += 0.01)
1410 {
1411 xs[i] = x;
1412
1413 ys[i] = g_2d->Eval(x) / g_1d->Eval(x);
1414
1415 cout << "At " << xs[i] << " -> " << g_2d->Eval(x) << "/"
1416 << g_1d->Eval(x) << " = " << ys[i] << endl;
1417 i++;
1418 }
1419
1420 TGraph * g_r = new TGraph(i, xs, ys);
1421 g_r->SetName(TString(g_1d->GetName()) + TString("_RejRatio"));
1422
1423 g_r->SetLineStyle(g_2d->GetLineStyle());
1424
1425 g_r->SetLineColor(g_2d->GetLineColor());
1426 g_r->SetLineWidth(g_2d->GetLineWidth());
1427
1428 return g_r;
1429 }
1430
1431 void
1432 RejectionCurve_AuAuSummary_Compare()
1433 {
1434
1435 TString base_dir =
1436 "../../sPHENIX_work/production_analysis_cemc2x2/embedding/emcstudies/pidstudies/";
1437 TString label = "1D VS 2D rejection ratio, e^{-} VS h^{-} in Au+Au 10%C";
1438 const double min_eff = 0.6;
1439
1440 TFile * f_2d =
1441 new TFile(
1442 base_dir
1443 + "/spacal2d/fieldmap/DrawEcal_Likelihood_Sum_RejectionCurve_AuAuSummary.root");
1444 assert(f_2d -> IsOpen());
1445 TFile * f_1d =
1446 new TFile(
1447 base_dir
1448 + "/spacal1d/fieldmap/DrawEcal_Likelihood_Sum_RejectionCurve_AuAuSummary.root");
1449 assert(f_1d -> IsOpen());
1450
1451 TCanvas *c1 = new TCanvas("RejectionCurve_AuAuSummary_Compare",
1452 "RejectionCurve_AuAuSummary_Compare", 900, 900);
1453 c1->Divide(1, 1);
1454 int idx = 1;
1455 TPad * p;
1456
1457 p = (TPad *) c1->cd(idx++);
1458 c1->Update();
1459
1460 p->SetGridx(0);
1461 p->SetGridy(0);
1462
1463 p->DrawFrame(min_eff, .5, 1, 1.5,
1464 ";Electron Efficiency;h^{-} Rejection Ratio, (2D proj.)/(1D proj.)");
1465 TLine * l = new TLine(min_eff, 1, 1, 1);
1466 l->SetLineColor(kGray);
1467 l->SetLineWidth(2);
1468 l->Draw();
1469
1470 TLatex * text = new TLatex(0.6, 1.5 +0.03, label);
1471 text->SetTextAlign(11);
1472 text->SetTextSize(0.044);
1473 text->SetTextFont(42);
1474 text->Draw();
1475
1476 TLegend * leg1 = new TLegend(0.12, 0.15, 0.42, 0.4);
1477 TLegend * leg2 = new TLegend(0.42, 0.15, 0.67, 0.4);
1478
1479 TGraph *ge = new TGraphErrors();
1480 ge->SetLineWidth(3);
1481 leg1->AddEntry(ge, "0.0 < #eta < 0.1", "lx");
1482 TGraph *ge = new TGraphErrors();
1483 ge->SetLineWidth(3);
1484 ge->SetLineStyle(kDashed);
1485 leg1->AddEntry(ge, "0.9 < #eta < 1.0", "lx");
1486
1487
1488
1489
1490
1491 TString kine_config = "eta0";
1492
1493 TString name = ("MergeExtractRejCurve_" + kine_config + "_8GeV");
1494 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1495
1496
1497
1498
1499 TString name = ("MergeExtractRejCurve_" + kine_config + "_4GeV");
1500 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1501 ge->Draw("lx");
1502 leg2->AddEntry(ge, "4 GeV/c", "lx");
1503
1504 TString name = ("MergeExtractRejCurve_" + kine_config + "_2GeV");
1505 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1506 ge->Draw("lx");
1507 leg2->AddEntry(ge, "2 GeV/c", "lx");
1508
1509 TString kine_config = "eta0.90";
1510
1511 TString name = ("MergeExtractRejCurve_" + kine_config + "_8GeV");
1512 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1513
1514
1515 TString name = ("MergeExtractRejCurve_" + kine_config + "_4GeV");
1516 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1517 ge->Draw("lx");
1518
1519 TString name = ("MergeExtractRejCurve_" + kine_config + "_2GeV");
1520 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1521 ge->Draw("lx");
1522
1523 leg2->Draw();
1524 leg1->Draw();
1525
1526 SaveCanvas(c1,
1527 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
1528 }
1529
1530 void
1531 RejectionCurve_AuAuSummary_Compare2()
1532 {
1533
1534 TString base_dir =
1535 "../../sPHENIX_work/production_analysis_cemc2x2/embedding/emcstudies/pidstudies/";
1536 TString base_dir2 =
1537 "../../sPHENIX_work/production_analysis/embedding/emcstudies/pidstudies/";
1538 TString label = "2x2-Ganging rej. ratio, e^{-} VS h^{-} in Au+Au 10%C";
1539 const double min_eff = 0.6;
1540
1541 TFile * f_2d =
1542 new TFile(
1543 base_dir
1544 + "/spacal2d/fieldmap/DrawEcal_Likelihood_Sum_RejectionCurve_AuAuSummary.root");
1545 assert(f_2d -> IsOpen());
1546 TFile * f_1d =
1547 new TFile(
1548 base_dir2
1549 + "/spacal2d/fieldmap/DrawEcal_Likelihood_Sum_RejectionCurve_AuAuSummary.root");
1550 assert(f_1d -> IsOpen());
1551
1552 TCanvas *c1 = new TCanvas("RejectionCurve_AuAuSummary_Compare2",
1553 "RejectionCurve_AuAuSummary_Compare2", 900, 900);
1554 c1->Divide(1, 1);
1555 int idx = 1;
1556 TPad * p;
1557
1558 p = (TPad *) c1->cd(idx++);
1559 c1->Update();
1560
1561 p->SetGridx(0);
1562 p->SetGridy(0);
1563
1564 p->DrawFrame(min_eff, .0, 1, 1.1,
1565 ";Electron Efficiency;h^{-} Rejection Ratio, (2x2 Ganging)/(Nominal)");
1566 TLine * l = new TLine(min_eff, 1, 1, 1);
1567 l->SetLineColor(kGray);
1568 l->SetLineWidth(2);
1569 l->Draw();
1570
1571 TLatex * text = new TLatex(0.6, 1.1 +0.03, label);
1572 text->SetTextAlign(11);
1573 text->SetTextSize(0.044);
1574 text->SetTextFont(42);
1575 text->Draw();
1576
1577 TLegend * leg1 = new TLegend(0.12, 0.15, 0.42, 0.4);
1578 TLegend * leg2 = new TLegend(0.42, 0.15, 0.67, 0.4);
1579
1580 TGraph *ge = new TGraphErrors();
1581 ge->SetLineWidth(3);
1582 leg1->AddEntry(ge, "0.0 < #eta < 0.1", "lx");
1583 TGraph *ge = new TGraphErrors();
1584 ge->SetLineWidth(3);
1585 ge->SetLineStyle(kDashed);
1586 leg1->AddEntry(ge, "0.9 < #eta < 1.0", "lx");
1587
1588 TString kine_config = "eta0";
1589
1590 TString name = ("MergeExtractRejCurve_" + kine_config + "_8GeV");
1591 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1592
1593 ge->Draw("lx");
1594 leg2->AddEntry(ge, "8 GeV/c", "lx");
1595
1596 TString name = ("MergeExtractRejCurve_" + kine_config + "_4GeV");
1597 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1598 ge->Draw("lx");
1599 leg2->AddEntry(ge, "4 GeV/c", "lx");
1600
1601 TString name = ("MergeExtractRejCurve_" + kine_config + "_2GeV");
1602 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1603 ge->Draw("lx");
1604 leg2->AddEntry(ge, "2 GeV/c", "lx");
1605
1606 TString kine_config = "eta0.90";
1607
1608 TString name = ("MergeExtractRejCurve_" + kine_config + "_8GeV");
1609 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1610 ge->Draw("lx");
1611
1612 TString name = ("MergeExtractRejCurve_" + kine_config + "_4GeV");
1613 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1614 ge->Draw("lx");
1615
1616 TString name = ("MergeExtractRejCurve_" + kine_config + "_2GeV");
1617 TGraph * ge = rejection_ratio(f_2d, f_1d, name);
1618 ge->Draw("lx");
1619
1620 leg2->Draw();
1621 leg1->Draw();
1622
1623 SaveCanvas(c1,
1624 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
1625 }
1626
1627 void
1628 RejectionCurve_RejMethodComparison_AntiProton(
1629 TString base_dir =
1630 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
1631 TString kine_config = "eta0",
1632 const double min_eff = 0.85)
1633 {
1634
1635 TCanvas *c1 = new TCanvas(
1636 "RejectionCurve_RejMethodComparison_AntiProton_" + kine_config,
1637 "RejectionCurve_RejMethodComparison_AntiProton_" + kine_config, 900, 900);
1638 c1->Divide(1, 1);
1639 int idx = 1;
1640 TPad * p;
1641
1642 p = (TPad *) c1->cd(idx++);
1643 c1->Update();
1644 p->SetLogy();
1645 p->SetGridx(0);
1646 p->SetGridy(0);
1647
1648 p->DrawFrame(min_eff, 1, 1, 1e3, ";Electron Efficiency;Hadron Rejection");
1649 TLine * l = new TLine(0.95, 1, 0.95, 1e3);
1650 l->SetLineColor(kGray);
1651 l->SetLineWidth(5);
1652 l->Draw();
1653
1654 TLatex * text = new TLatex(0.85, 1e3 * 1.2,
1655 "2-D Proj. SPACAL, e^{-}-#bar{p} separation @ 0 < #eta < 0.1");
1656 text->SetTextAlign(11);
1657 text->SetTextSize(0.044);
1658 text->SetTextFont(42);
1659 text->Draw();
1660
1661 TLegend * leg1 = new TLegend(0.12, 0.15, 0.65, 0.4);
1662 TLegend * leg2 = new TLegend(0.65, 0.15, 0.85, 0.4);
1663
1664 TGraphErrors *ge = new TGraphErrors();
1665 ge->SetLineWidth(3);
1666 leg1->AddEntry(ge, "EMCal+HCal Likelihood", "lx");
1667 TGraphErrors *ge = new TGraphErrors();
1668 ge->SetLineWidth(3);
1669 ge->SetLineStyle(kDashed);
1670 leg1->AddEntry(ge, "EMCal E/p Likelihood", "lx");
1671 TGraphErrors *ge = new TGraphErrors();
1672 ge->SetLineWidth(3);
1673 ge->SetLineStyle(kDotted);
1674 leg1->AddEntry(ge, "Cut on min. E/p", "lx");
1675
1676 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1677 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1678 ge->SetLineColor(kRed + 2);
1679 ge->SetMarkerColor(kRed + 2);
1680 ge->SetFillColor(kRed - 9);
1681 ge->SetLineWidth(3);
1682
1683 ge->Draw("lx");
1684 leg2->AddEntry(ge, "8 GeV/c", "lx");
1685 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1686 "EP_LL_Distribution_eval_sample", "hll_ep_diff", "e-", "anti_proton");
1687 ge->SetLineColor(kRed + 2);
1688 ge->SetMarkerColor(kRed + 2);
1689 ge->SetFillColor(kRed - 9);
1690 ge->SetLineWidth(3);
1691 ge->SetLineStyle(kDashed);
1692
1693 ge->Draw("lx");
1694 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1695 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep", "e-", "anti_proton");
1696 ge->SetLineColor(kRed + 2);
1697 ge->SetMarkerColor(kRed + 2);
1698 ge->SetFillColor(kRed - 9);
1699 ge->SetLineWidth(3);
1700 ge->SetLineStyle(kDotted);
1701
1702 ge->Draw("lx");
1703
1704 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1705 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1706 ge->SetLineColor(kBlue + 2);
1707 ge->SetMarkerColor(kBlue + 2);
1708 ge->SetFillColor(kBlue - 9);
1709 ge->SetLineWidth(3);
1710
1711 ge->Draw("lx");
1712 leg2->AddEntry(ge, "4 GeV/c", "lx");
1713 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1714 "EP_LL_Distribution_eval_sample", "hll_ep_diff", "e-", "anti_proton");
1715 ge->SetLineColor(kBlue + 2);
1716 ge->SetMarkerColor(kBlue + 2);
1717 ge->SetFillColor(kBlue - 9);
1718 ge->SetLineWidth(3);
1719 ge->SetLineStyle(kDashed);
1720
1721 ge->Draw("lx");
1722 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1723 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep", "e-", "anti_proton");
1724 ge->SetLineColor(kBlue + 2);
1725 ge->SetMarkerColor(kBlue + 2);
1726 ge->SetFillColor(kBlue - 9);
1727 ge->SetLineWidth(3);
1728 ge->SetLineStyle(kDotted);
1729
1730 ge->Draw("lx");
1731
1732 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1733 "Edep_LL_Distribution_eval_sample", "hll_edep_diff", "e-", "anti_proton");
1734 ge->SetLineColor(kGreen + 3);
1735 ge->SetMarkerColor(kGreen + 3);
1736 ge->SetFillColor(kGreen - 9);
1737 ge->SetLineWidth(3);
1738
1739 ge->Draw("lx");
1740 leg2->AddEntry(ge, "2 GeV/c", "lx");
1741 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1742 "EP_LL_Distribution_eval_sample", "hll_ep_diff", "e-", "anti_proton");
1743 ge->SetLineColor(kGreen + 3);
1744 ge->SetMarkerColor(kGreen + 3);
1745 ge->SetFillColor(kGreen - 9);
1746 ge->SetLineWidth(3);
1747 ge->SetLineStyle(kDashed);
1748
1749 ge->Draw("lx");
1750 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1751 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep", "e-", "anti_proton");
1752 ge->SetLineColor(kGreen + 3);
1753 ge->SetMarkerColor(kGreen + 3);
1754 ge->SetFillColor(kGreen - 9);
1755 ge->SetLineWidth(3);
1756 ge->SetLineStyle(kDotted);
1757
1758 ge->Draw("lx");
1759
1760 leg2->Draw();
1761 leg1->Draw();
1762
1763 SaveCanvas(c1,
1764 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
1765 }
1766
1767 void
1768 RejectionCurve_PIDComparison(
1769 TString base_dir =
1770 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
1771 TString kine_config = "eta0",
1772 const double min_eff = 0.85)
1773 {
1774
1775 TCanvas *c1 = new TCanvas("RejectionCurve_PIDComparison_" + kine_config,
1776 "RejectionCurve_PIDComparison_" + kine_config, 900, 900);
1777 c1->Divide(1, 1);
1778 int idx = 1;
1779 TPad * p;
1780
1781 p = (TPad *) c1->cd(idx++);
1782 c1->Update();
1783 p->SetLogy();
1784 p->SetGridx(0);
1785 p->SetGridy(0);
1786
1787 p->DrawFrame(min_eff, 10, 1, 1e3, ";Electron Efficiency;Hadron Rejection");
1788 TLine * l = new TLine(0.95, 10, 0.95, 1e3);
1789 l->SetLineColor(kGray);
1790 l->SetLineWidth(5);
1791 l->Draw();
1792
1793 TLatex * text = new TLatex(0.85, 1e3 * 1.1,
1794 "2-D Proj. SPACAL, e^{-}-#pi^{-} separation @ 0 < #eta < 0.1");
1795 text->SetTextAlign(11);
1796 text->SetTextSize(0.044);
1797 text->SetTextFont(42);
1798 text->Draw();
1799
1800 TLegend * leg1 = new TLegend(0.12, 0.15, 0.65, 0.4);
1801 TLegend * leg2 = new TLegend(0.65, 0.15, 0.85, 0.4);
1802
1803 TGraphErrors *ge = new TGraphErrors();
1804 ge->SetLineWidth(3);
1805 leg1->AddEntry(ge, "EMCal+HCal Likelihood", "lx");
1806 TGraphErrors *ge = new TGraphErrors();
1807 ge->SetLineWidth(3);
1808 ge->SetLineStyle(kDashed);
1809 leg1->AddEntry(ge, "EMCal E/p Likelihood", "lx");
1810 TGraphErrors *ge = new TGraphErrors();
1811 ge->SetLineWidth(3);
1812 ge->SetLineStyle(kDotted);
1813 leg1->AddEntry(ge, "Cut on min. E/p", "lx");
1814
1815 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1816 "Edep_LL_Distribution_eval_sample", "hll_edep_diff");
1817 ge->SetLineColor(kRed + 2);
1818 ge->SetMarkerColor(kRed + 2);
1819 ge->SetFillColor(kRed - 9);
1820 ge->SetLineWidth(3);
1821
1822 ge->Draw("lx");
1823 leg2->AddEntry(ge, "8 GeV/c", "lx");
1824 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1825 "EP_LL_Distribution_eval_sample", "hll_ep_diff");
1826 ge->SetLineColor(kRed + 2);
1827 ge->SetMarkerColor(kRed + 2);
1828 ge->SetFillColor(kRed - 9);
1829 ge->SetLineWidth(3);
1830 ge->SetLineStyle(kDashed);
1831
1832 ge->Draw("lx");
1833 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_8GeV",
1834 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep");
1835 ge->SetLineColor(kRed + 2);
1836 ge->SetMarkerColor(kRed + 2);
1837 ge->SetFillColor(kRed - 9);
1838 ge->SetLineWidth(3);
1839 ge->SetLineStyle(kDotted);
1840
1841 ge->Draw("lx");
1842
1843 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1844 "Edep_LL_Distribution_eval_sample", "hll_edep_diff");
1845 ge->SetLineColor(kBlue + 2);
1846 ge->SetMarkerColor(kBlue + 2);
1847 ge->SetFillColor(kBlue - 9);
1848 ge->SetLineWidth(3);
1849
1850 ge->Draw("lx");
1851 leg2->AddEntry(ge, "4 GeV/c", "lx");
1852 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1853 "EP_LL_Distribution_eval_sample", "hll_ep_diff");
1854 ge->SetLineColor(kBlue + 2);
1855 ge->SetMarkerColor(kBlue + 2);
1856 ge->SetFillColor(kBlue - 9);
1857 ge->SetLineWidth(3);
1858 ge->SetLineStyle(kDashed);
1859
1860 ge->Draw("lx");
1861 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_4GeV",
1862 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep");
1863 ge->SetLineColor(kBlue + 2);
1864 ge->SetMarkerColor(kBlue + 2);
1865 ge->SetFillColor(kBlue - 9);
1866 ge->SetLineWidth(3);
1867 ge->SetLineStyle(kDotted);
1868
1869 ge->Draw("lx");
1870
1871 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1872 "Edep_LL_Distribution_eval_sample", "hll_edep_diff");
1873 ge->SetLineColor(kGreen + 3);
1874 ge->SetMarkerColor(kGreen + 3);
1875 ge->SetFillColor(kGreen - 9);
1876 ge->SetLineWidth(3);
1877
1878 ge->Draw("lx");
1879 leg2->AddEntry(ge, "2 GeV/c", "lx");
1880 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1881 "EP_LL_Distribution_eval_sample", "hll_ep_diff");
1882 ge->SetLineColor(kGreen + 3);
1883 ge->SetMarkerColor(kGreen + 3);
1884 ge->SetFillColor(kGreen - 9);
1885 ge->SetLineWidth(3);
1886 ge->SetLineStyle(kDashed);
1887
1888 ge->Draw("lx");
1889 TGraphErrors *ge = ExtractRejCurve(base_dir, kine_config + "_2GeV",
1890 "Ep_Checks_eval_sample", "hEMCalTrk_get_ep");
1891 ge->SetLineColor(kGreen + 3);
1892 ge->SetMarkerColor(kGreen + 3);
1893 ge->SetFillColor(kGreen - 9);
1894 ge->SetLineWidth(3);
1895 ge->SetLineStyle(kDotted);
1896
1897 ge->Draw("lx");
1898
1899 leg2->Draw();
1900 leg1->Draw();
1901
1902 SaveCanvas(c1,
1903 base_dir + TString("DrawEcal_Likelihood_Sum_") + TString(c1->GetName()));
1904 }
1905
1906 TGraphErrors *
1907 ExtractRejCurve(
1908 TString base_dir =
1909 "../../sPHENIX_work/production_analysis_cemc2x2/emcstudies/pidstudies/spacal2d/fieldmap/",
1910 TString kine_config = "eta0_4GeV",
1911 TString ll_config = "EP_LL_Distribution_ll_sample",
1912 TString hist_name = "hll_ep_diff",
1913 TString signal = "e-", TString background = "pi-")
1914 {
1915 TH1F * hll_edep_diff_e = NULL;
1916 TH1F * hll_edep_diff_pi = NULL;
1917 {
1918 TFile * f =
1919 new TFile(
1920 base_dir + "G4Hits_sPHENIX_" + signal + "_" + kine_config
1921 + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
1922 + ll_config + ".root");
1923
1924 assert(f);
1925
1926 hll_edep_diff_e = (TH1F *) f->GetObjectChecked(hist_name, "TH1F");
1927
1928 assert(hll_edep_diff_e);
1929 }
1930
1931 {
1932 TFile * f =
1933 new TFile(
1934 base_dir + "/G4Hits_sPHENIX_" + background + "_" + kine_config
1935 + "-ALL.root_Ana.root.lst_EMCalLikelihood.root_DrawEcal_Likelihood_"
1936 + ll_config + ".root");
1937
1938 assert(f);
1939
1940 hll_edep_diff_pi = (TH1F *) f->GetObjectChecked(hist_name, "TH1F");
1941
1942 assert(hll_edep_diff_pi);
1943 }
1944 assert(hll_edep_diff_e->GetNbinsX() == hll_edep_diff_pi->GetNbinsX());
1945
1946 double threshold[10000] =
1947 { 0 };
1948 double eff_e[10000] =
1949 { 0 };
1950 double eff_err_e[10000] =
1951 { 0 };
1952 double rej_pi[10000] =
1953 { 0 };
1954 double rej_err_pi[10000] =
1955 { 0 };
1956
1957 const double n_e = hll_edep_diff_e->GetSum();
1958 double pass = 0;
1959 int cnt = 0;
1960
1961 for (int i = hll_edep_diff_e->GetNbinsX(); i >= 1; i--)
1962 {
1963 pass += hll_edep_diff_e->GetBinContent(i);
1964
1965 const double pp = pass / n_e;
1966
1967 const double z = 1.;
1968
1969 const double A = z
1970 * sqrt(1. / n_e * pp * (1 - pp) + z * z / 4 / n_e / n_e);
1971 const double B = 1 / (1 + z * z / n_e);
1972
1973 threshold[cnt] = hll_edep_diff_e->GetBinCenter(i);
1974 eff_e[cnt] = (pp + z * z / 2 / n_e) * B;
1975 eff_err_e[cnt] = A * B;
1976
1977 cnt++;
1978 }
1979
1980 const double n_pi = hll_edep_diff_pi->GetSum();
1981 double pass = 0;
1982 int cnt = 0;
1983
1984 for (int i = hll_edep_diff_pi->GetNbinsX(); i >= 1; i--)
1985 {
1986 pass += hll_edep_diff_pi->GetBinContent(i);
1987
1988 const double pp = pass / n_pi;
1989
1990 const double z = 1.;
1991
1992 const double A = z
1993 * sqrt(1. / n_pi * pp * (1 - pp) + z * z / 4 / n_pi / n_pi);
1994 const double B = 1 / (1 + z * z / n_pi);
1995
1996 assert(threshold[cnt] == hll_edep_diff_pi->GetBinCenter(i));
1997 rej_pi[cnt] = (pp + z * z / 2 / n_pi) * B;
1998 rej_err_pi[cnt] = A * B;
1999
2000
2001 rej_err_pi[cnt] = 1 / rej_pi[cnt] * (rej_err_pi[cnt] / rej_pi[cnt]);
2002 rej_pi[cnt] = 1 / rej_pi[cnt];
2003
2004 cnt++;
2005 }
2006
2007 TGraphErrors * ge = new TGraphErrors(cnt, eff_e, rej_pi, eff_err_e,
2008 rej_err_pi);
2009
2010 return ge;
2011
2012 }
2013
2014 TGraphErrors *
2015 MergeRejCurve(TGraphErrors * ge1, const double weight1, TGraphErrors * ge2,
2016 const double weight2, TGraphErrors * ge3 = NULL, const double weight3 = 0)
2017 {
2018 assert(ge1);
2019
2020 const double sum_weight = weight1 + weight2 + weight3;
2021 assert(sum_weight>0);
2022
2023 TGraphErrors * ge = (TGraphErrors *) ge1->Clone("MergeExtractRejCurve");
2024 assert(ge);
2025
2026 for (int i = 0; i < ge->GetN(); ++i)
2027 {
2028 double pass = 0;
2029
2030 double pass_err2 = 0;
2031
2032 if (weight1 != 0)
2033 {
2034 assert(ge1);
2035
2036
2037 const double rej = (ge1->GetY())[i];
2038 const double rej_err = (ge1->GetEY())[i];
2039
2040 pass += 1 / rej * weight1;
2041 pass_err2 += pow(rej_err / rej * (1 / rej * weight1), 2);
2042 }
2043
2044 if (weight2 != 0)
2045 {
2046 assert(ge2);
2047 assert(ge2 -> GetN() == ge1 -> GetN());
2048
2049 const double rej = (ge2->GetY())[i];
2050 const double rej_err = (ge2->GetEY())[i];
2051
2052 pass += 1 / rej * weight2;
2053 pass_err2 += pow(rej_err / rej * (1 / rej * weight2), 2);
2054 }
2055
2056 if (weight3 != 0)
2057 {
2058 assert(ge3);
2059 assert(ge3 -> GetN() == ge1 -> GetN());
2060
2061 const double rej = (ge3->GetY())[i];
2062 const double rej_err = (ge3->GetEY())[i];
2063
2064 pass += 1 / rej * weight3;
2065 pass_err2 += pow(rej_err / rej * (1 / rej * weight3), 2);
2066 }
2067
2068 pass /= sum_weight;
2069 pass_err2 /= sum_weight * sum_weight;
2070
2071 (ge->GetY())[i] = 1. / pass;
2072 (ge->GetEY())[i] = sqrt(pass_err2) / pass * 1. / pass;
2073
2074 }
2075
2076 return ge;
2077 }
2078
2079 double
2080 GetHPiRatio(const double pt, TString hadron, TString collision)
2081 {
2082
2083
2084
2085 double pt1 = 0;
2086 double pt2 = 1;
2087 double ratio1 = 0;
2088 double ratio2 = 0;
2089
2090 if (hadron == "kaon-" && collision == "pp")
2091 {
2092 pt1 = 1;
2093 ratio1 = 0.25;
2094 pt2 = 2;
2095 ratio2 = 0.39;
2096 }
2097 else if (hadron == "kaon-" && collision == "AuAu10%C")
2098 {
2099 pt1 = 1;
2100 ratio1 = 0.3;
2101 pt2 = 4;
2102 ratio2 = 0.7;
2103 }
2104 else if (hadron == "kaon+" && collision == "pp")
2105 {
2106 pt1 = 1;
2107 ratio1 = 0.25;
2108 pt2 = 2;
2109 ratio2 = 0.45;
2110 }
2111 else if (hadron == "kaon+" && collision == "AuAu10%C")
2112 {
2113 pt1 = 1;
2114 ratio1 = 0.32;
2115 pt2 = 4;
2116 ratio2 = 0.9;
2117 }
2118 else
2119
2120 if (hadron == "proton" && collision == "pp")
2121 {
2122 pt1 = 1.6;
2123 ratio1 = 0.25;
2124 pt2 = 3;
2125 ratio2 = 0.21;
2126 }
2127 else if (hadron == "proton" && collision == "AuAu10%C")
2128 {
2129 pt1 = 2.6;
2130 ratio1 = 0.77;
2131 pt2 = 6;
2132 ratio2 = 0.35;
2133 }
2134 else if (hadron == "anti_proton" && collision == "pp")
2135 {
2136 pt1 = 1.6;
2137 ratio1 = 0.21;
2138 pt2 = 3;
2139 ratio2 = 0.2;
2140 }
2141 else if (hadron == "anti_proton" && collision == "AuAu10%C")
2142 {
2143 pt1 = 2.6;
2144 ratio1 = 0.55;
2145 pt2 = 6;
2146 ratio2 = 0.3;
2147 }
2148 else
2149 {
2150 cout << "GetHPiRatio - invalid inputs!" << endl;
2151 assert(0);
2152 }
2153
2154 assert(pt>1);
2155 const double ratio = ratio2 * (pt - pt1) / (pt2 - pt1)
2156 + ratio1 * (pt2 - pt) / (pt2 - pt1);
2157 assert(ratio > 0);
2158
2159 return ratio;
2160 }
2161