10 #include "TDatabasePDG.h"
11 #include "TParticlePDG.h"
16 #include "TParticle.h"
17 #include "TClonesArray.h"
23 #include "TEventList.h"
39 std::map<TString, TString>
cuts;
40 std::map<TString, TString>
modes;
43 TString ntpname[10] = {
"nphi",
"nlam",
"n2e",
"njpsi1",
"njpsi2",
"netac2",
"nd01",
"ndpm1",
"nds1",
"nlamc"};
44 TString plotname[10] = {
"phim",
"lamm",
"eem",
"jpsim",
"jpsim",
"etacm",
"d0m",
"dpmm",
"dsm",
"lamcm"};
49 gStyle->SetPadTopMargin(0.13);
50 gStyle->SetPadBottomMargin(0.18);
51 gStyle->SetPadLeftMargin(0.2);
52 gStyle->SetPadRightMargin(0.016);
54 gStyle->SetLabelSize(0.076,
"X");
55 gStyle->SetLabelSize(0.07,
"Y");
57 gStyle->SetStatY(0.87);
58 gStyle->SetStatX(0.986);
59 gStyle->SetStatW(0.4);
60 gStyle->SetStatH(0.12);
61 gStyle->SetOptStat(
"e");
63 gStyle->SetTitleH(0.1);
64 gStyle->SetTitleX(0.08);
65 gStyle->SetTitleOffset(1.1,
"x");
66 gStyle->SetTitleXSize(0.076);
68 gStyle->SetNdivisions(505);
73 return (h->GetBinCenter(h->GetNbinsX())-h->GetBinCenter(1))*0.05+h->GetBinCenter(1);
78 h->SetFillStyle(3001);
88 modes[
"nphi"] =
"000";
89 modes[
"nlam"] =
"400";
91 modes[
"njpsi1"] =
"200";
92 modes[
"njpsi2"] =
"201";
93 modes[
"netac2"] =
"221";
94 modes[
"nd01"] =
"100";
95 modes[
"ndpm1"] =
"120";
96 modes[
"nds1"] =
"140";
97 modes[
"nlamc"] =
"420";
117 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>0.5&&phipcm<0.75";
118 cuts[
"nlam"] =
"lampcm>0.38&&lampcm<0.48&&eslnpidp>0&&lamp>0.6";
119 cuts[
"n2e"] =
"eslnpide>1";
122 else if (energy==
"38")
124 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>1.4";
125 cuts[
"nlam"] =
"eslnpidp>0&&lampcm>1.25&&esthr>0.93&&lampt>0.75";
126 cuts[
"n2e"] =
"eslnpide>1";
127 cuts[
"njpsi1"] =
"eslnpide>1&&jpsipcm<0.9";
128 cuts[
"njpsi2"] =
"eslnpidmu>1&&jpsipcm<0.9";
129 cuts[
"netac2"] =
"eslnpidk>0&&eslnpidpi>2";
130 cuts[
"nd01"] =
"eslnpidk>0&&d0pcm<0.4&&d0d0pt>0.4";
131 cuts[
"ndpm1"] =
"eslnpidk>0&&dpmpcm<0.3";
134 else if (energy==
"45")
136 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>1.55&&esthr>0.85";
137 cuts[
"nlam"] =
"esl1npidp>0&&esthr>0.93&&lampt>1";
138 cuts[
"n2e"] =
"eslnpide>1&&mmiss>-1";
139 cuts[
"njpsi1"] =
"eslnpide>1&&jpsipcm<1.8&&detemcmax>2.5";
140 cuts[
"njpsi2"] =
"eslnpidmu>1&&jpsipcm<1.5";
141 cuts[
"netac2"] =
"eslnpidk>0&&eslnpidpi>2&&etacd1pt>0.35&&etacd0pt>0.35";
142 cuts[
"nd01"] =
"eslnpidk>0&&d0pt>1&&mmiss>1.5&&d0d0pidk>0.25";
143 cuts[
"ndpm1"] =
"eslnpidk>0&&dpmpcm>1.1&&dpmpcm<1.5&&dpmpt>0.9&&dpmd0pidk>0.3";
144 cuts[
"nds1"] =
"eslnpidk>1&&dspcm>1&&dspcm<1.17&&dspt>0.5";
147 else if (energy==
"55")
149 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>1.5&&esthr>0.89";
150 cuts[
"nlam"] =
"eslnpidp>0&&esthr>0.97&&lampcm>2.1&&lampt>1";
151 cuts[
"n2e"] =
"eslnpide>1&&mmiss>-1";
152 cuts[
"njpsi1"] =
"eslnpide>1&&jpsipcm<2.2&&detemcmax>4&&jpsid1tht>0.07";
153 cuts[
"njpsi2"] =
"eslnpidmu>1&&jpsipcm<2";
154 cuts[
"netac2"] =
"eslnpidk>0&&eslnpidpi>2&&esptmax>1.1&&esnpart<15";
155 cuts[
"nd01"] =
"eslnpidk>0&&d0pcm>1.9&&mmiss>1.5&&d0pt>1.6&&d0pcm<2.15";
156 cuts[
"ndpm1"] =
"eslnpidk>0&&dpmpcm>1.95&&dpmpcm<2.15&&dpmpt>0.8&&dpmd0pt>0.4";
157 cuts[
"nds1"] =
"eslnpidk>1&&dspcm>1.85&&dspcm<2.1&&dspt>1.3";
158 cuts[
"nlamc"] =
"eslnpidk>0&&eslnpidp>0&&lamcpt>.9&&lamcd0pidp>0.21&&lamcd0thtcm<2";
166 cuts[
"njpsi1"] =
"1";
167 cuts[
"njpsi2"] =
"1";
168 cuts[
"netac2"] =
"1";
226 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>0.45&&phipcm<0.78";
227 cuts[
"nlam"] =
"eslnpidp>0&&lampcm<0.55&&lampcm>0.25&&mmiss<1.2";
228 cuts[
"n2e"] =
"eslnpide>1&&mmiss>-1";
231 else if (energy==
"38")
233 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>1.2";
234 cuts[
"nlam"] =
"esthr>0.85&&lampcm>1.15&&lampt>0.2&&eslnpidp>0";
235 cuts[
"n2e"] =
"eslnpide>1&&mmiss>-1";
236 cuts[
"njpsi1"] =
"eslnpide>1&&jpsipcm<1";
237 cuts[
"njpsi2"] =
"eslnpidmu>1&&jpsipcm<1";
238 cuts[
"netac2"] =
"etacpcm<1.25&&essumptc>1.75";
239 cuts[
"nd01"] =
"eslnpidk>0&&d0pcm<0.4&&d0d0pt>0.25";
240 cuts[
"ndpm1"] =
"eslnpidk>0";
243 else if (energy==
"45")
245 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>1.55";
246 cuts[
"nlam"] =
"esthr>0.87&&eslnpidp>0&&lampcm>1.5";
247 cuts[
"n2e"] =
"eslnpide>1&&mmiss>-1";
248 cuts[
"njpsi1"] =
"eslnpide>1&&jpsipcm<1.8&&detemcmax>2.5";
249 cuts[
"njpsi2"] =
"eslnpidmu>1&&jpsipcm<1.5";
250 cuts[
"netac2"] =
"etacpcm<1.25&&etacd1p>0.25";
251 cuts[
"nd01"] =
"eslnpidk>0&&d0pcm<1.6&&d0pcm>0.8&&d0d1p<6";
252 cuts[
"ndpm1"] =
"eslnpidk>0";
253 cuts[
"nds1"] =
"eslnpidk>0&&dspcm>0.4&&dsp<8&&dsthtcm>0.5";
256 else if (energy==
"55")
258 cuts[
"nphi"] =
"eslnpidk>1&&phipcm>1.75&&phipt>0.5";
259 cuts[
"nlam"] =
"esthr>0.9&&lampcm>1&&mmiss<2.4";
260 cuts[
"n2e"] =
"eslnpide>0&&mmiss>-1";
261 cuts[
"njpsi1"] =
"eslnpide>1&&jpsipcm<1.9&&detemcmax>3.5";
262 cuts[
"njpsi2"] =
"eslnpidmu>1&&jpsipcm<2.5";
263 cuts[
"netac2"] =
"etacpcm<2&&etacd1p>0.4&&etacecm>2.85&&eslnpide<1";
264 cuts[
"nd01"] =
"eslnpidk>0&&d0pcm<2.3&&d0pcm>0.95";
265 cuts[
"ndpm1"] =
"eslnpidk>0";
266 cuts[
"nds1"] =
"eslnpidk>0&&dspcm>0.5&&dsthtcm>0.5";
267 cuts[
"nlamc"] =
"mmiss>2";
275 cuts[
"njpsi1"] =
"1";
276 cuts[
"njpsi2"] =
"1";
277 cuts[
"netac2"] =
"1";
291 TEventList *el=(TEventList*)gDirectory->Get(
"el");
293 t->SetBranchStatus(
"*",0);
294 t->SetBranchStatus(
"ev",1);
295 t->SetBranchAddress(
"ev",&ev);
297 std::map<int, int> sigcnt;
298 for (
int j=0;j<el->GetN();++j)
300 t->GetEntry(el->GetEntry(j));
301 int tidx = t->GetTreeNumber();
302 sigcnt[(int)ev+tidx*1000]+=1;
303 if (globcnt)
evcnt[(int)ev+tidx*1000]+=1;
305 t->SetBranchStatus(
"*",1);
306 return sigcnt.size();
311 t->Project(all,var,cut);
312 t->Project(sel,var,cut+
" && tag");
313 t->Project(sig,var,cut+
" && "+
mctvar[t->GetName()]+
"mct");
318 TDatabasePDG *fPdg = TDatabasePDG::Instance();
319 if (fPdg->GetParticle(name))
return fPdg->GetParticle(name)->Mass();
333 double sqrts=energy.Atof();
354 TCanvas *
c2=
new TCanvas(
"c2",
"c2",20,20,1800,800);
355 c2->Divide(5,2,0.005,0.01);
358 double PhiMass =
DbMass(
"phi");
360 double D0Mass =
DbMass(
"D0");
361 double DpmMass =
DbMass(
"D+");
362 double DsMass =
DbMass(
"D_s+");
364 double JpsiMass =
DbMass(
"J/psi");
365 double EtacMass =
DbMass(
"eta_c");
366 double Chic0Mass =
DbMass(
"chi_0c");
368 double LamMass =
DbMass(
"Lambda0");
369 double LamcMass =
DbMass(
"Lambda_c+");
372 double fPhiQaMin = PhiMass - 0.1;
373 double fPhiQaMax = PhiMass + 0.1;
376 double fD0QaMin = D0Mass - 0.3;
377 double fD0QaMax = D0Mass + 0.3;
379 double fDpmQaMin = DpmMass - 0.3;
380 double fDpmQaMax = DpmMass + 0.3;
382 double fDsQaMin = DsMass - 0.25;
383 double fDsQaMax = DsMass + 0.25;
386 double fLamcQaMin = LamcMass - 0.2;
387 double fLamcQaMax = LamcMass + 0.2;
389 double fLamQaMin = LamMass - 0.15;
390 double fLamQaMax = LamMass + 0.15;
393 double fEtacQaMin = EtacMass - 0.65;
394 double fEtacQaMax = EtacMass + 0.65;
396 double fJpsiQaMin = JpsiMass - 1.00;
397 double fJpsiQaMax = JpsiMass + 0.75;
401 double fEcm = sqrts/10.;
402 double f2eQaMin = fEcm - 1.5;
403 double f2eQaMax = fEcm + 1.0;
408 TH1F *h_jpsi1=
new TH1F(
"h_jpsi1",
"J/#psi #rightarrow e^{+}e^{-}",
nbins,fJpsiQaMin,fJpsiQaMax);
409 TH1F *h_jpsi1sel=
new TH1F(
"h_jpsi1sel",
"J/psi",
nbins,fJpsiQaMin,fJpsiQaMax);
410 TH1F *h_jpsi1sig=
new TH1F(
"h_jpsi1sig",
"J/psi",
nbins,fJpsiQaMin,fJpsiQaMax);
411 h_jpsi1sig->SetLineColor(2);
415 TH1F *h_jpsi2=
new TH1F(
"h_jpsi2",
"J/#psi #rightarrow #mu^{+}#mu^{-}",
nbins,fJpsiQaMin,fJpsiQaMax);
416 TH1F *h_jpsi2sel=
new TH1F(
"h_jpsi2sel",
"J/psi",
nbins,fJpsiQaMin,fJpsiQaMax);
417 TH1F *h_jpsi2sig=
new TH1F(
"h_jpsi2sig",
"J/psi",
nbins,fJpsiQaMin,fJpsiQaMax);
418 h_jpsi2sig->SetLineColor(2);
422 TH1F *h_etac=
new TH1F(
"h_etac",
"#eta_{c} #rightarrow K_{S} K^{+} #pi^{-}",
nbins,fEtacQaMin,fEtacQaMax);
423 TH1F *h_etacsel=
new TH1F(
"h_etacsel",
"etac",
nbins,fEtacQaMin,fEtacQaMax);
424 TH1F *h_etacsig=
new TH1F(
"h_etacsig",
"etac",
nbins,fEtacQaMin,fEtacQaMax);
425 h_etacsig->SetLineColor(2);
429 TH1F *h_d0=
new TH1F(
"h_d0",
"D^{0} #rightarrow K^{-}#pi^{+}",
nbins,fD0QaMin,fD0QaMax);
430 TH1F *h_d0sel=
new TH1F(
"h_d0sel",
"D0",
nbins,fD0QaMin,fD0QaMax);
431 TH1F *h_d0sig=
new TH1F(
"h_d0sig",
"D0",
nbins,fD0QaMin,fD0QaMax);;
432 h_d0sig->SetLineColor(2);
436 TH1F *h_dpm=
new TH1F(
"h_dpm",
"D^{+} #rightarrow K^{-}#pi^{+}#pi^{+}",
nbins,fDpmQaMin,fDpmQaMax);
437 TH1F *h_dpmsel=
new TH1F(
"h_dpmsel",
"D#pm",
nbins,fDpmQaMin,fDpmQaMax);
438 TH1F *h_dpmsig=
new TH1F(
"h_dpmsig",
"D#pm",
nbins,fDpmQaMin,fDpmQaMax);
439 h_dpmsig->SetLineColor(2);
443 TH1F *h_ds=
new TH1F(
"h_ds",
"D_{s}^{+} #rightarrow K^{+}K^{-}#pi^{+}",
nbins,fDsQaMin,fDsQaMax);
444 TH1F *h_dssel=
new TH1F(
"h_dssel",
"Ds",
nbins,fDsQaMin,fDsQaMax);
445 TH1F *h_dssig=
new TH1F(
"h_dssig",
"Ds",
nbins,fDsQaMin,fDsQaMax);
446 h_dssig->SetLineColor(2);
450 TH1F *h_phi=
new TH1F(
"h_phi",
"#phi #rightarrow K^{+}K^{-}",
nbins,fPhiQaMin,fPhiQaMax);
451 TH1F *h_phisel=
new TH1F(
"h_phisel",
"Phi",
nbins,fPhiQaMin,fPhiQaMax);
452 TH1F *h_phisig=
new TH1F(
"h_phisig",
"Phi",
nbins,fPhiQaMin,fPhiQaMax);
453 h_phisig->SetLineColor(2);
457 TH1F *h_lamc=
new TH1F(
"h_lamc",
"#Lambda_{c} #rightarrow pK^{-}#pi^{+}",
nbins,fLamcQaMin,fLamcQaMax);
458 TH1F *h_lamcsel=
new TH1F(
"h_lamcsel",
"Lam_c",
nbins,fLamcQaMin,fLamcQaMax);
459 TH1F *h_lamcsig=
new TH1F(
"h_lamcsig",
"Lam_c",
nbins,fLamcQaMin,fLamcQaMax);
460 h_lamcsig->SetLineColor(2);
464 TH1F *h_lam=
new TH1F(
"h_lam",
"#Lambda #rightarrow p#pi^{-}",
nbins,fLamQaMin,fLamQaMax);
465 TH1F *h_lamsel=
new TH1F(
"h_lamsel",
"Lam",
nbins,fLamQaMin,fLamQaMax);
466 TH1F *h_lamsig=
new TH1F(
"h_lamsig",
"Lam",
nbins,fLamQaMin,fLamQaMax);
467 h_lamsig->SetLineColor(2);
471 TH1F *h_ee=
new TH1F(
"h_ee",
"p#bar{p} #rightarrow e^{+}e^{-}",
nbins,f2eQaMin,f2eQaMax);
472 TH1F *h_eesel=
new TH1F(
"h_eesel",
"ee",
nbins,f2eQaMin,f2eQaMax);
473 TH1F *h_eesig=
new TH1F(
"h_eesig",
"ee",
nbins,f2eQaMin,f2eQaMax);
474 h_eesig->SetLineColor(2);
477 h_jpsi1->SetXTitle(
"m(e^{+}e^{-}) [GeV/c^{2}]");
478 h_jpsi2->SetXTitle(
"m(#mu^{+}#mu^{-}) [GeV/c^{2}]");
479 h_etac->SetXTitle(
"m(K_{S} K^{+}#pi^{-}) [GeV/c^{2}]");
481 h_d0->SetXTitle(
"m(K^{-}#pi^{+}) [GeV/c^{2}]");
483 h_dpm->SetXTitle(
"m(K^{-}#pi^{+}#pi^{+}) [GeV/c^{2}]");
485 h_ds->SetXTitle(
"m(K^{+}K^{-}#pi^{+}) [GeV/c^{2}]");
487 h_phi->SetXTitle(
"m(K^{+}K^{-}) [GeV/c^{2}]");
488 h_lamc->SetXTitle(
"m(pK^{-}#pi^{+}) [GeV/c^{2}]");
489 h_lam->SetXTitle(
"m(p#pi^{-}) [GeV/c^{2}]");
490 h_ee->SetXTitle(
"m(e^{+}e^{-}) [GeV/c^{2}]");
493 fillHistos(t[0],
"phim",
cuts[
"nphi"],
"h_phi",
"h_phisel",
"h_phisig");
494 fillHistos(t[1],
"lamm",
cuts[
"nlam"],
"h_lam",
"h_lamsel",
"h_lamsig");
495 fillHistos(t[2],
"eem",
cuts[
"n2e"],
"h_ee",
"h_eesel",
"h_eesig");
499 fillHistos(t[3],
"jpsim",
cuts[
"njpsi1"],
"h_jpsi1",
"h_jpsi1sel",
"h_jpsi1sig");
500 fillHistos(t[4],
"jpsim",
cuts[
"njpsi2"],
"h_jpsi2",
"h_jpsi2sel",
"h_jpsi2sig");
501 fillHistos(t[5],
"etacm",
cuts[
"netac2"],
"h_etac",
"h_etacsel",
"h_etacsig");
502 fillHistos(t[6],
"d0m",
cuts[
"nd01"],
"h_d0",
"h_d0sel",
"h_d0sig");
503 fillHistos(t[7],
"dpmm",
cuts[
"ndpm1"],
"h_dpm",
"h_dpmsel",
"h_dpmsig");
507 fillHistos(t[8],
"dsm",
cuts[
"nds1"],
"h_ds",
"h_dssel",
"h_dssig");
510 fillHistos(t[9],
"lamcm",
cuts[
"nlamc"],
"h_lamc",
"h_lamcsel",
"h_lamcsig");
514 double channelcount[10]={0,0,0,0,0,0,0,0,0,0};
515 double eff[10]={0,0,0,0,0,0,0,0,0,0};
521 cout <<i<<
" "<<channelcount[
i]<<endl;
528 cout <<i<<
" "<<channelcount[
i]<<endl;
534 cout <<i<<
" "<<channelcount[
i]<<endl;
540 cout <<i<<
" "<<channelcount[
i]<<endl;
543 double evCnt =
evcnt.size();
544 for (i=0;i<10;++
i) eff[i]=channelcount[i]/nev*100.;
546 cout <<
"all:"<<evCnt<<endl;
550 latex.SetTextSize(0.08);
560 c2->cd(2); h_phi->Draw(); h_phisel->Draw(
"same"); h_phisig->Draw(
"same");
561 sprintf(tmp,
"#epsilon = %4.1f%%",eff[0]);
562 latex.DrawLatexNDC(posx,posy,tmp);
564 c2->cd(1); h_ee->Draw(); h_eesel->Draw(
"same"); h_eesig->Draw(
"same");
565 sprintf(tmp,
"#epsilon = %4.1f%%",eff[2]);
566 latex.DrawLatexNDC(posx,posy,tmp);
568 c2->cd(9); h_lam->Draw(); h_lamsel->Draw(
"same"); h_lamsig->Draw(
"same");
569 sprintf(tmp,
"#epsilon = %4.1f%%",eff[1]);
570 latex.DrawLatexNDC(posx,posy,tmp);
572 c2->cd(3); h_etac->Draw(); h_etacsel->Draw(
"same"); h_etacsig->Draw(
"same");
573 sprintf(tmp,
"#epsilon = %4.1f%%",eff[5]);
574 latex.DrawLatexNDC(posx,posy,tmp);
576 c2->cd(4); h_jpsi1->Draw(); h_jpsi1sel->Draw(
"same"); h_jpsi1sig->Draw(
"same");
577 sprintf(tmp,
"#epsilon = %4.1f%%",eff[3]);
578 latex.DrawLatexNDC(posx,posy,tmp);
580 c2->cd(5); h_jpsi2->Draw(); h_jpsi2sel->Draw(
"same"); h_jpsi2sig->Draw(
"same");
581 sprintf(tmp,
"#epsilon = %4.1f%%",eff[4]);
582 latex.DrawLatexNDC(posx,posy,tmp);
584 c2->cd(7); h_dpm->Draw(); h_dpmsel->Draw(
"same"); h_dpmsig->Draw(
"same");
585 sprintf(tmp,
"#epsilon = %4.1f%%",eff[7]);
586 latex.DrawLatexNDC(posx,posy,tmp);
588 c2->cd(6); h_d0->Draw(); h_d0sel->Draw(
"same"); h_d0sig->Draw(
"same");
589 sprintf(tmp,
"#epsilon = %4.1f%%",eff[6]);
590 latex.DrawLatexNDC(posx,posy,tmp);
592 c2->cd(8); h_ds->Draw(); h_dssel->Draw(
"same"); h_dssig->Draw(
"same");
593 sprintf(tmp,
"#epsilon = %4.1f%%",eff[8]);
594 latex.DrawLatexNDC(posx,posy,tmp);
596 c2->cd(10); h_lamc->Draw(); h_lamcsel->Draw(
"same"); h_lamcsig->Draw(
"same");
597 sprintf(tmp,
"#epsilon = %4.1f%%",eff[9]);
598 latex.DrawLatexNDC(posx,posy,tmp);
602 posy = h_jpsi2->GetMaximum()*1.12;
603 if (posy==0) posy=1.12;
604 sprintf(tmp,
"(#epsilon_{t} = %4.1f%%)",
double(evCnt)/
double(nev)*100.);
605 latex.SetTextColor(kMagenta+2);
606 latex.DrawLatex(3.0,posy,tmp);
612 TString plot(fname(fname.Last(
'/')+1,6));
613 if (!tagonly) plot+=
"_opt_supr";
618 c2->SaveAs(
"figfull_v2/full_"+plot+
".gif");
619 c2->SaveAs(
"figfull_v2/full_"+plot+
".pdf");
624 TString result=TString::Format(
"%s & %3.1f & %6.2f & %6.2f & %6.2f & %6.2f & %6.2f & %6.2f & %6.2f & %6.2f & %6.2f & %6.2f & %6.2f \\\\\n",
625 mode.Data(), sqrts/10., eff[2], eff[0], eff[5], eff[3], eff[4], eff[6], eff[7], eff[8], eff[1], eff[9], evCnt/nev*100);
void init_cuts_1000(TString energy)
std::map< TString, TString > mctvar
double DbMass(TString name)
std::map< TString, TString > cuts
int full_core_ntp(TString fname, int nev=50, bool tagonly=false)
int cnt_events(TChain *t, TString cut, bool globcnt=false)
std::map< int, int > treeidx
std::map< int, int > evcnt
std::map< TString, TString > modes
void fillHistos(TChain *t, TString var, TString cut, TString all, TString sel, TString sig)
void init_cuts_95(TString energy)