11 std::vector<PID *> pidDetectors;
12 std::vector<int> fillStyle;
17 pidDetectors.push_back(aerogel);
18 fillStyle.push_back(3004);
23 pidDetectors.push_back(gas);
24 fillStyle.push_back(3004);
28 auto hNSigmaKpi_aerogel =
new TH1F(
"hNSigmaKpi_aerogel",
";p (GeV/c);", 2000, 0., 200.);
29 hNSigmaKpi_aerogel->SetLineColor(kAzure-3);
30 hNSigmaKpi_aerogel->SetLineStyle(kSolid);
31 hNSigmaKpi_aerogel->SetLineWidth(2);
33 auto hNSigmaKpi_gas =
new TH1F(
"hNSigmaKpi_gas",
";p (GeV/c);", 2000, 0., 200.);
34 hNSigmaKpi_gas->SetLineColor(kAzure-3);
35 hNSigmaKpi_gas->SetLineStyle(kDashed);
36 hNSigmaKpi_gas->SetLineWidth(2);
38 auto hNSigmaKp_aerogel =
new TH1F(
"hNSigmaKp_aerogel",
";p (GeV/c);", 2000, 0., 200.);
39 hNSigmaKp_aerogel->SetLineColor(kRed+1);
40 hNSigmaKp_aerogel->SetLineStyle(kSolid);
41 hNSigmaKp_aerogel->SetLineWidth(2);
43 auto hNSigmaKp_gas =
new TH1F(
"hNSigmaKp_gas",
";p (GeV/c);", 2000, 0., 200.);
44 hNSigmaKp_gas->SetLineColor(kRed+1);
45 hNSigmaKp_gas->SetLineStyle(kDashed);
46 hNSigmaKp_gas->SetLineWidth(2);
48 auto particleEta = -log(tan(
particleAngle * 0.017453293 * 0.5));
49 for (
int i = 0; i < hNSigmaKpi_aerogel->GetNbinsX(); ++i) {
50 auto p = hNSigmaKpi_aerogel->GetBinCenter(i + 1);
51 hNSigmaKpi_aerogel->SetBinContent(i + 1, aerogel->numSigma(particleEta,
p,
PID::pi_k));
52 hNSigmaKpi_gas->SetBinContent(i + 1, gas->numSigma(particleEta,
p,
PID::pi_k));
53 hNSigmaKp_aerogel->SetBinContent(i + 1, aerogel->numSigma(particleEta,
p,
PID::k_p));
54 hNSigmaKp_gas->SetBinContent(i + 1, gas->numSigma(particleEta,
p,
PID::k_p));
58 line.SetLineColor(kBlack);
64 latex.SetTextSize(0.05);
65 latex.SetTextAlign(31);
67 auto s =
new TCanvas(
"s",
"s", 1600, 800);
68 s->cd(1)->Divide(2, 1);
70 s->cd(1)->DrawFrame(0., 0.2, 100., 200.,
";#it{p} (GeV/#it{c});n#sigma_{K#pi}");
71 line.DrawLine(0.0, 3., 100., 3.);
73 hNSigmaKpi_aerogel->Draw(
"same,l");
74 hNSigmaKpi_gas->Draw(
"same,l");
75 latex.DrawLatex(0.88, 0.85, Form(
"#vartheta_{track} = %d#circ",
particleAngle));
77 s->cd(2)->DrawFrame(0., 0.2, 100., 200.,
";#it{p} (GeV/#it{c});n#sigma_{pK}");
78 line.DrawLine(0.0, 3., 100., 3.);
80 hNSigmaKp_aerogel->Draw(
"same,l");
81 hNSigmaKp_gas->Draw(
"same,l");
82 latex.DrawLatex(0.88, 0.85, Form(
"#vartheta_{track} = %d#circ",
particleAngle));
88 std::vector<double> etaf, etab;
89 for (
double eta = -6.;
eta <= 6.;
eta += 0.1)
94 auto c =
new TCanvas(
"c",
"c", 1600, 800);
97 c->cd(1)->DrawFrame(-2.0, 0.1, 5.0, 150.0,
";#eta;#it{p} (GeV/#it{c})");
99 auto kapi_legend =
new TLegend(0.2, 0.2, 0.5, 0.4);
100 kapi_legend->SetBorderSize(0);
101 for (
int idet = 0; idet < pidDetectors.size(); ++idet) {
103 auto poly =
new TPolyLine();
104 poly->SetLineColor(kAzure-3);
105 poly->SetLineStyle(kSolid);
106 poly->SetLineWidth(1);
107 poly->SetFillColor(kAzure-3);
108 poly->SetFillStyle(fillStyle[idet]);
110 for (
auto eta : etaf) {
111 if (!pidDetectors[idet]->
valid(
eta, 1.
e6))
continue;
114 for (
auto eta : etab) {
115 if (!pidDetectors[idet]->
valid(
eta, 1.
e6))
continue;
123 kapi_legend->AddEntry(
poly, pidDetectors[idet]->
name().c_str(),
"f");
125 kapi_legend->SetHeader(Form(
"K/#pi %.0f#sigma separation",
nsigma));
126 kapi_legend->Draw(
"same");
129 c->cd(2)->DrawFrame(-2.0, 0.1, 5.0, 150.0,
";#eta;#it{p} (GeV/#it{c})");
131 auto prka_legend =
new TLegend(0.2, 0.2, 0.5, 0.4);
132 prka_legend->SetBorderSize(0);
133 for (
int idet = 0; idet < pidDetectors.size(); ++idet) {
135 auto poly =
new TPolyLine();
136 poly->SetLineColor(kRed+1);
137 poly->SetLineStyle(kSolid);
138 poly->SetLineWidth(1);
139 poly->SetFillColor(kRed+1);
140 poly->SetFillStyle(fillStyle[idet]);
142 for (
auto eta : etaf) {
143 if (!pidDetectors[idet]->
valid(
eta, 1.
e6))
continue;
146 for (
auto eta : etab) {
147 if (!pidDetectors[idet]->
valid(
eta, 1.
e6))
continue;
155 prka_legend->AddEntry(
poly, pidDetectors[idet]->
name().c_str(),
"f");
157 prka_legend->SetHeader(Form(
"p/K %.0f#sigma separation",
nsigma));
158 prka_legend->Draw(
"same");
160 c->SaveAs(
"dRICH.png");