auto checkH1 = [](
TList *out) {
if (!out) {
std::cout << "checkH1 >>> Test failure: output list not found\n";
return -1;
}
if (!hdmd) {
std::cout << "checkH1 >>> Test failure: 'hdmd' histo not found\n";
return -1;
}
std::cout << "checkH1 >>> Test failure: 'hdmd' histo: wrong number"
" of entries ("
return -1;
}
std::cout <<
"checkH1 >>> Test failure: 'hdmd' histo: wrong mean (" << hdmd->
GetMean()
<< ": expected 0.15512023) \n";
return -1;
}
if (!h2) {
std::cout << "checkH1 >>> Test failure: 'h2' histo not found\n";
return -1;
}
std::cout << "checkH1 >>> Test failure: 'h2' histo: wrong number"
" of entries ("
return -1;
}
std::cout <<
"checkH1 >>> Test failure: 'h2' histo: wrong mean (" << h2->
GetMean() <<
": expected 0.15245688) \n";
return -1;
}
return 0;
};
auto doFit = [](
TList *out,
const char *lfn = 0) ->
Int_t {
if (lfn)
if (hdmd == 0 || h2 == 0) {
std::cout << "doFit: hdmd = " << hdmd << " , h2 = " << h2 << "\n";
return -1;
if (lfn)
}
TCanvas *c1 =
new TCanvas(
"c1",
"h1analysis analysis", 10, 10, 800, 600);
if (
gROOT->GetListOfFunctions()->FindObject(
"f5"))
delete gROOT->GetFunction(
"f5");
const Double_t dxbin = (0.17 - 0.13) / 40;
if (x <= 0.13957)
return 0;
Double_t xp3 = (x - par[3]) * (x - par[3]);
par[2] / 2.5066 / par[4] *
TMath::Exp(-xp3 / 2 / par[4] / par[4]));
return res;
};
auto f5 =
new TF1(
"f5",
fdm5, 0.139, 0.17, 5);
f5->SetParameters(1000000, .25, 2000, .1454, .001);
Double_t ref_f5[4] = {959915.0, 0.351114, 1185.03, 0.145569};
for (int i : {0, 1, 2, 3}) {
if ((
TMath::Abs((f5->GetParameters())[i] - ref_f5[i]) / ref_f5[i]) > 0.001) {
std::cout << "\n >>> Test failure: fit to 'f5': parameter '" << f5->GetParName(i) << "' has wrong value ("
<< (f5->GetParameters())[i] << ": expected" << ref_f5[i] << ") \n";
if (lfn)
return -1;
}
}
auto c2 =
new TCanvas(
"c2",
"tauD0", 100, 100, 800, 600);
if (
gROOT->GetListOfFunctions()->FindObject(
"f2"))
delete gROOT->GetFunction(
"f2");
const auto dxbin = (0.17 - 0.13) / 40;
const auto sigma = 0.0012;
auto x = xx[0];
if (x <= 0.13957)
return 0;
auto xp3 = (x - 0.1454) * (x - 0.1454);
auto res = dxbin * (par[0] *
TMath::Power(x - 0.13957, 0.25) +
par[1] / 2.5066 / sigma *
TMath::Exp(-xp3 / 2 / sigma / sigma));
return res;
};
auto f2 =
new TF1(
"f2",
fdm2, 0.139, 0.17, 2);
f2->SetParameters(10000, 10);
std::cout << "doFit: restricting fit to two bins only in this example...\n";
h2->FitSlicesX(f2, 10, 20, 10, "g5 l");
Double_t ref_f2[2] = {52432.2, 105.481};
for (int i : {0, 1}) {
if ((
TMath::Abs((f2->GetParameters())[i] - ref_f2[i]) / ref_f2[i]) > 0.001) {
std::cout << "\n >>> Test failure: fit to 'f2': parameter '" << f2->GetParName(i) << "' has wrong value ("
<< (f2->GetParameters())[i] << ": expected" << ref_f2[i] << ") \n";
if (lfn)
return -1;
}
}
h2_1->GetXaxis()->SetTitle("#tau[ps]");
h2_1->SetMarkerStyle(21);
h2_1->Draw();
psdmd->SetOptStat(1110);
if (lfn)
return 0;
};
auto hdmd =
new TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17);
auto h2 =
new TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6);
continue;
if (*fPtds_d <= 2.5)
continue;
continue;
(*fIk)--;
(*fIpi)--;
if (fNhitrp.At(*fIk) * fNhitrp.At(*fIpi) <= 1)
continue;
if (fRend.At(*fIk) - fRstart.At(*fIk) <= 22)
continue;
if (fRend.At(*fIpi) - fRstart.At(*fIpi) <= 22)
continue;
if (fNlhk.At(*fIk) <= 0.1)
continue;
if (fNlhpi.At(*fIpi) <= 0.1)
continue;
(*fIpis)--;
if (fNlhpi.At(*fIpis) <= 0.1)
continue;
if (*fNjets < 1)
continue;
h2->Fill(*fDm_d, *fRpd0_t / 0.029979 * 1.8646 / *fPtd0_d);
}
l->Add(hdmd);
l->Add(h2);
};
auto elist =
new TEntryList(
"elist",
"H1 selection from Cut");
continue;
if (*fPtds_d <= 2.5)
continue;
continue;
(*fIk)--;
(*fIpi)--;
if (fNhitrp.At(*fIk) * fNhitrp.At(*fIpi) <= 1)
continue;
if (fRend.At(*fIk) - fRstart.At(*fIk) <= 22)
continue;
if (fRend.At(*fIpi) - fRstart.At(*fIpi) <= 22)
continue;
if (fNlhk.At(*fIk) <= 0.1)
continue;
if (fNlhpi.At(*fIpi) <= 0.1)
continue;
(*fIpis)--;
if (fNlhpi.At(*fIpis) <= 0.1)
continue;
if (*fNjets < 1)
continue;
}
return elist;
};
auto hdmd =
new TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17);
auto h2 =
new TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6);
h2->Fill(*fDm_d, *fRpd0_t / 0.029979 * 1.8646 / *fPtd0_d);
}
l->Add(hdmd);
l->Add(h2);
};