364 double sqrts=
energy.Atof();
375 TFile *
f=
new TFile(fname);
384 TCanvas *
c2=
new TCanvas(
"c2",
"c2",20,20,1800,800);
385 c2->Divide(5,2,0.005,0.01);
390 TH1F *h_jpsi1=
new TH1F(
"h_jpsi1",
"J/#psi #rightarrow e^{+}e^{-}",
nbins,
low,
high);
391 TH1F *h_jpsi1sel=
new TH1F(
"h_jpsi1sel",
"J/psi",
nbins,
low,
high);
392 TH1F *h_jpsi1sig=
new TH1F(
"h_jpsi1sig",
"J/psi",
nbins,
low,
high);
393 h_jpsi1sig->SetLineColor(2);
397 TH1F *h_jpsi2=
new TH1F(
"h_jpsi2",
"J/#psi #rightarrow #mu^{+}#mu^{-}",
nbins,
low,
high);
398 TH1F *h_jpsi2sel=
new TH1F(
"h_jpsi2sel",
"J/psi",
nbins,
low,
high);
399 TH1F *h_jpsi2sig=
new TH1F(
"h_jpsi2sig",
"J/psi",
nbins,
low,
high);
400 h_jpsi2sig->SetLineColor(2);
404 TH1F *h_etac=
new TH1F(
"h_etac",
"#eta_{c} #rightarrow K_{S} K^{+} #pi^{-}",
nbins,
low,
high);
405 TH1F *h_etacsel=
new TH1F(
"h_etacsel",
"etac",
nbins,
low,
high);
406 TH1F *h_etacsig=
new TH1F(
"h_etacsig",
"etac",
nbins,
low,
high);
407 h_etacsig->SetLineColor(2);
411 TH1F *h_d0=
new TH1F(
"h_d0",
"D^{0} #rightarrow K^{-}#pi^{+}",
nbins,
low,
high);
414 h_d0sig->SetLineColor(2);
418 TH1F *h_dpm=
new TH1F(
"h_dpm",
"D^{+} #rightarrow K^{-}#pi^{+}#pi^{+}",
nbins,
low,
high);
419 TH1F *h_dpmsel=
new TH1F(
"h_dpmsel",
"D#pm",
nbins,
low,
high);
420 TH1F *h_dpmsig=
new TH1F(
"h_dpmsig",
"D#pm",
nbins,
low,
high);
421 h_dpmsig->SetLineColor(2);
425 TH1F *h_ds=
new TH1F(
"h_ds",
"D_{s}^{+} #rightarrow K^{+}K^{-}#pi^{+}",
nbins,
low,
high);
428 h_dssig->SetLineColor(2);
432 TH1F *h_phi=
new TH1F(
"h_phi",
"#phi #rightarrow K^{+}K^{-}",
nbins,low2,
high/2);
433 TH1F *h_phisel=
new TH1F(
"h_phisel",
"Phi",
nbins,low2,
high/2);
434 TH1F *h_phisig=
new TH1F(
"h_phisig",
"Phi",
nbins,low2,
high/2);
435 h_phisig->SetLineColor(2);
439 TH1F *h_lamc=
new TH1F(
"h_lamc",
"#Lambda_{c} #rightarrow pK^{-}#pi^{+}",
nbins,
low,
high);
440 TH1F *h_lamcsel=
new TH1F(
"h_lamcsel",
"Lam_c",
nbins,
low,
high);
441 TH1F *h_lamcsig=
new TH1F(
"h_lamcsig",
"Lam_c",
nbins,
low,
high);
442 h_lamcsig->SetLineColor(2);
446 TH1F *h_lam=
new TH1F(
"h_lam",
"#Lambda #rightarrow p#pi^{-}",
nbins,low2,
high/2);
447 TH1F *h_lamsel=
new TH1F(
"h_lamsel",
"Lam",
nbins,low2,
high/2);
448 TH1F *h_lamsig=
new TH1F(
"h_lamsig",
"Lam",
nbins,low2,
high/2);
449 h_lamsig->SetLineColor(2);
453 TH1F *h_ee=
new TH1F(
"h_ee",
"p#bar{p} #rightarrow e^{+}e^{-}",
nbins,
low,
high*1.2);
454 TH1F *h_eesel=
new TH1F(
"h_eesel",
"ee",
nbins,
low,
high*1.2);
455 TH1F *h_eesig=
new TH1F(
"h_eesig",
"ee",
nbins,
low,
high*1.2);
456 h_eesig->SetLineColor(2);
459 h_jpsi1->SetXTitle(
"m(e^{+}e^{-}) [GeV/c^{2}]");
460 h_jpsi2->SetXTitle(
"m(#mu^{+}#mu^{-}) [GeV/c^{2}]");
461 h_etac->SetXTitle(
"m(K_{S} K^{+}#pi^{-}) [GeV/c^{2}]");
463 h_d0->SetXTitle(
"m(K^{-}#pi^{+}) [GeV/c^{2}]");
465 h_dpm->SetXTitle(
"m(K^{-}#pi^{+}#pi^{+}) [GeV/c^{2}]");
467 h_ds->SetXTitle(
"m(K^{+}K^{-}#pi^{+}) [GeV/c^{2}]");
469 h_phi->SetXTitle(
"m(K^{+}K^{-}) [GeV/c^{2}]");
470 h_lamc->SetXTitle(
"m(pK^{-}#pi^{+}) [GeV/c^{2}]");
471 h_lam->SetXTitle(
"m(p#pi^{-}) [GeV/c^{2}]");
472 h_ee->SetXTitle(
"m(e^{+}e^{-}) [GeV/c^{2}]");
475 fillHistos(t[0],
"phim",
cuts[
"nphi"],
"h_phi",
"h_phisel",
"h_phisig");
476 fillHistos(t[1],
"lamm",
cuts[
"nlam"],
"h_lam",
"h_lamsel",
"h_lamsig");
477 fillHistos(t[2],
"eem",
cuts[
"nee"],
"h_ee",
"h_eesel",
"h_eesig");
481 fillHistos(t[3],
"jpsi1m",
cuts[
"njpsi1"],
"h_jpsi1",
"h_jpsi1sel",
"h_jpsi1sig");
482 fillHistos(t[4],
"jpsi2m",
cuts[
"njpsi2"],
"h_jpsi2",
"h_jpsi2sel",
"h_jpsi2sig");
483 fillHistos(t[5],
"etacm",
cuts[
"netac"],
"h_etac",
"h_etacsel",
"h_etacsig");
484 fillHistos(t[6],
"d0m",
cuts[
"nd0"],
"h_d0",
"h_d0sel",
"h_d0sig");
485 fillHistos(t[7],
"dm",
cuts[
"ndpm"],
"h_dpm",
"h_dpmsel",
"h_dpmsig");
489 fillHistos(t[8],
"dsm",
cuts[
"nds"],
"h_ds",
"h_dssel",
"h_dssig");
492 fillHistos(t[9],
"lamcm",
cuts[
"nlamc"],
"h_lamc",
"h_lamcsel",
"h_lamcsig");
496 double channelcount[10]={0,0,0,0,0,0,0,0,0,0};
497 double eff[10]={0,0,0,0,0,0,0,0,0,0};
503 cout <<i<<
" "<<channelcount[
i]<<endl;
510 cout <<i<<
" "<<channelcount[
i]<<endl;
516 cout <<i<<
" "<<channelcount[
i]<<endl;
522 cout <<i<<
" "<<channelcount[
i]<<endl;
525 double evCnt =
evcnt.size();
526 for (i=0;i<10;++
i) eff[i]=channelcount[i]/nev*100.;
528 cout <<
"all:"<<evCnt<<endl;
532 latex.SetTextSize(0.08);
535 double pos=3.3, pos2=1.85;
542 c2->cd(2); h_phi->Draw(); h_phisel->Draw(
"same"); h_phisig->Draw(
"same");
543 sprintf(tmp,
"#epsilon = %4.1f%%",eff[0]);
544 latex.DrawLatex(pos2,h_phi->GetMaximum()*hfac+
offset,tmp);
546 c2->cd(1); h_ee->Draw(); h_eesel->Draw(
"same"); h_eesig->Draw(
"same");
547 sprintf(tmp,
"#epsilon = %4.1f%%",eff[2]);
548 latex.DrawLatex(pos*1.2,h_ee->GetMaximum()*hfac+
offset,tmp);
550 c2->cd(9); h_lam->Draw(); h_lamsel->Draw(
"same"); h_lamsig->Draw(
"same");
551 sprintf(tmp,
"#epsilon = %4.1f%%",eff[1]);
552 latex.DrawLatex(pos2,h_lam->GetMaximum()*hfac+
offset,tmp);
554 c2->cd(3); h_etac->Draw(); h_etacsel->Draw(
"same"); h_etacsig->Draw(
"same");
555 sprintf(tmp,
"#epsilon = %4.1f%%",eff[5]);
556 latex.DrawLatex(pos,h_etac->GetMaximum()*hfac+
offset,tmp);
558 c2->cd(4); h_jpsi1->Draw(); h_jpsi1sel->Draw(
"same"); h_jpsi1sig->Draw(
"same");
559 sprintf(tmp,
"#epsilon = %4.1f%%",eff[3]);
560 latex.DrawLatex(pos,h_jpsi1->GetMaximum()*hfac+
offset,tmp);
562 c2->cd(5); h_jpsi2->Draw(); h_jpsi2sel->Draw(
"same"); h_jpsi2sig->Draw(
"same");
563 sprintf(tmp,
"#epsilon = %4.1f%%",eff[4]);
564 latex.DrawLatex(pos,h_jpsi2->GetMaximum()*hfac+
offset,tmp);
566 c2->cd(7); h_dpm->Draw(); h_dpmsel->Draw(
"same"); h_dpmsig->Draw(
"same");
567 sprintf(tmp,
"#epsilon = %4.1f%%",eff[7]);
568 latex.DrawLatex(pos,h_dpm->GetMaximum()*hfac+
offset,tmp);
570 c2->cd(6); h_d0->Draw(); h_d0sel->Draw(
"same"); h_d0sig->Draw(
"same");
571 sprintf(tmp,
"#epsilon = %4.1f%%",eff[6]);
572 latex.DrawLatex(pos,h_d0->GetMaximum()*hfac+
offset,tmp);
574 c2->cd(8); h_ds->Draw(); h_dssel->Draw(
"same"); h_dssig->Draw(
"same");
575 sprintf(tmp,
"#epsilon = %4.1f%%",eff[8]);
576 latex.DrawLatex(pos,h_ds->GetMaximum()*hfac+
offset,tmp);
578 c2->cd(10); h_lamc->Draw(); h_lamcsel->Draw(
"same"); h_lamcsig->Draw(
"same");
579 sprintf(tmp,
"#epsilon = %4.1f%%",eff[9]);
580 latex.DrawLatex(pos,h_lamc->GetMaximum()*hfac+
offset,tmp);
584 double posy = h_jpsi2->GetMaximum()*1.12;
585 if (posy==0) posy=1.12;
586 sprintf(tmp,
"(#epsilon_{t} = %4.1f%%)",
double(evCnt)/
double(nev)*100.);
587 latex.SetTextColor(kMagenta+2);
588 latex.DrawLatex(3.0,posy,tmp);
593 TString plot(fname(fname.Last(
'/')+5,5));
594 if (!tagonly) plot+=
"_opt_supr1000";
596 c2->SaveAs(
"figtoy_v2/toy_"+plot+
".gif");
597 c2->SaveAs(
"figtoy_v2/toy_"+plot+
".pdf");
602 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",
603 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);
int cnt_events(TTree *t, TString cut, bool globcnt=false)
void init_cuts_1000(TString energy)
std::map< TString, TString > cuts
std::map< int, int > evcnt
void fillHistos(TTree *t, TString var, TString cut, TString all, TString sel, TString sig)