cf_simple.C 891 B

12345678910111213141516171819202122232425262728
  1. void cf_simple(const char *fname) {
  2. TFile *file = new TFile(fname, "READ");
  3. TH1D *num = new TH1D("num", "", 40, 0., 0.4);
  4. TH1D *den = new TH1D("den", "", 40, 0., 0.4);
  5. for (int iKt = 0; iKt < 24; iKt++) {
  6. TH1D *bufNum = (TH1D *)file->Get(Form("hKaonQinvMixKt_1_2_9_Num_bin_%i", iKt));
  7. TH1D *bufDen = (TH1D *)file->Get(Form("hKaonQinvMixKt_1_2_9_Den_bin_%i", iKt));
  8. num->Add(bufNum);
  9. den->Add(bufDen);
  10. }
  11. num->Sumw2();
  12. den->Sumw2();
  13. float numInt = num->Integral(25, 40);
  14. float denInt = den->Integral(25, 40);
  15. float norm = denInt/numInt;
  16. TH1D *rat = new TH1D("rat", "like sign #pi#pi correlation function (MuDST)", 40, 0., 0.4);
  17. rat->GetXaxis()->SetTitle("q_{inv} (GeV/c)");
  18. rat->GetYaxis()->SetTitle("CF(#pi#pi)");
  19. rat->Divide(num, den, norm);
  20. TF1 *constFunc = new TF1("constFunc", "1", 0., 0.4);
  21. rat->Draw();
  22. constFunc->Draw("SAME");
  23. }