auto ret =
dataFrame.Filter([](
float md0_d) {
return TMath::Abs(md0_d - 1.8646) < 0.04; }, {
"md0_d"})
.Filter([](float ptds_d) { return ptds_d > 2.5; }, {"ptds_d"})
.Filter([](
float etads_d) {
return TMath::Abs(etads_d) < 1.5; }, {
"etads_d"})
.Filter([](int ik, int ipi, std::array_view<int> nhitrp) { return nhitrp[ik - 1] * nhitrp[ipi - 1] > 1; },
{"ik", "ipi", "nhitrp"})
.Filter([](int ik, std::array_view<float> rstart,
std::array_view<float> rend) { return rend[ik - 1] - rstart[ik - 1] > 22; },
{"ik", "rstart", "rend"})
.Filter([](int ipi, std::array_view<float> rstart,
std::array_view<float> rend) { return rend[ipi - 1] - rstart[ipi - 1] > 22; },
{"ipi", "rstart", "rend"})
.Filter([](int ik, std::array_view<float> nlhk) { return nlhk[ik - 1] > 0.1; }, {"ik", "nlhk"})
.Filter([](int ipi, std::array_view<float> nlhpi) { return nlhpi[ipi - 1] > 0.1; }, {"ipi", "nlhpi"})
.Filter([](int ipis, std::array_view<float> nlhpi) { return nlhpi[ipis - 1] > 0.1; }, {"ipis", "nlhpi"})
.Filter([](int njets) { return njets >= 1; }, {"njets"});
return ret;
};
{
if (x <= 0.13957) return 0;
Double_t xp3 = (x - par[3]) * (x - par[3]);
dxbin * (par[0] *
pow(x - 0.13957, par[1]) + par[2] / 2.5066 / par[4] *
exp(-xp3 / 2 / par[4] / par[4]));
return res;
}
{
if (x <= 0.13957) return 0;
Double_t xp3 = (x - 0.1454) * (x - 0.1454);
Double_t res = dxbin * (par[0] *
pow(x - 0.13957, 0.25) + par[1] / 2.5066 / sigma *
exp(-xp3 / 2 / sigma / sigma));
return res;
}
void FitAndPlotHdmd(
TH1 &hdmd)
{
TCanvas *c1 =
new TCanvas(
"c1",
"h1analysis analysis", 10, 10, 800, 600);
if (
gROOT->GetListOfFunctions()->FindObject(
"f5"))
delete gROOT->GetFunction(
"f5");
}
void FitAndPlotH2(
TH2 &h2)
{
if (
gROOT->GetListOfFunctions()->FindObject(
"f2"))
delete gROOT->GetFunction(
"f2");
}
void tdf101_h1Analysis()
{
chain.Add("http://root.cern.ch/files/h1/dstarmb.root");
chain.Add("http://root.cern.ch/files/h1/dstarp1a.root");
chain.Add("http://root.cern.ch/files/h1/dstarp1b.root");
chain.Add("http://root.cern.ch/files/h1/dstarp2.root");
auto selected = Select(dataFrame);
auto hdmdARP = selected.Histo1D(
TH1F(
"hdmd",
"Dm_d", 40, 0.13, 0.17),
"dm_d");
auto selectedAddedBranch = selected.Define(
"h2_y", [](float rpd0_t, float ptd0_d) { return rpd0_t / 0.029979f * 1.8646f / ptd0_d; }, {"rpd0_t", "ptd0_d"});
auto h2ARP = selectedAddedBranch.Histo2D<float,
float>(
TH2F(
"h2",
"ptD0 vs Dm_d", 30, 0.135, 0.165, 30, -3, 6),
"dm_d", "h2_y");
FitAndPlotHdmd(*hdmdARP);
FitAndPlotH2(*h2ARP);
}