12345678910111213141516171819202122232425262728 |
- void cf_simple(const char *fname) {
- TFile *file = new TFile(fname, "READ");
-
- TH1D *num = new TH1D("num", "", 40, 0., 0.4);
- TH1D *den = new TH1D("den", "", 40, 0., 0.4);
- for (int iKt = 0; iKt < 24; iKt++) {
- TH1D *bufNum = (TH1D *)file->Get(Form("hKaonQinvMixKt_1_2_9_Num_bin_%i", iKt));
- TH1D *bufDen = (TH1D *)file->Get(Form("hKaonQinvMixKt_1_2_9_Den_bin_%i", iKt));
- num->Add(bufNum);
- den->Add(bufDen);
- }
- num->Sumw2();
- den->Sumw2();
- float numInt = num->Integral(25, 40);
- float denInt = den->Integral(25, 40);
- float norm = denInt/numInt;
- TH1D *rat = new TH1D("rat", "like sign #pi#pi correlation function (MuDST)", 40, 0., 0.4);
- rat->GetXaxis()->SetTitle("q_{inv} (GeV/c)");
- rat->GetYaxis()->SetTitle("CF(#pi#pi)");
- rat->Divide(num, den, norm);
- TF1 *constFunc = new TF1("constFunc", "1", 0., 0.4);
- rat->Draw();
- constFunc->Draw("SAME");
- }
|