Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PWGHF/Macros/computeFonllPlusPythiaPredictions.C
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
}
inputFile.close();

if (ptCent.size() < 2) {

Check failure on line 142 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGP(fatal, "Only one pT value in FONLL file {}, cannot deduce binning.", inFile);
}

Expand Down Expand Up @@ -193,10 +193,10 @@
hFonllPromptChad[431] = {nullptr, nullptr, nullptr};
hFonllPromptChad[4122] = {nullptr, nullptr, nullptr};
for (auto iChad{0}; iChad < NCharmHadrons; ++iChad) {
if (charmHadPdgs[iChad] == 431 || charmHadPdgs[iChad] == 4122) {

Check failure on line 196 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 196 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
}
for (auto iFonll{0}; iFonll < 3; ++iFonll) {

Check failure on line 199 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
hFonllPromptChad[charmHadPdgs[iChad]][iFonll]->Scale(charmFragFracEpEm[iChad]);
}
}
Expand All @@ -206,7 +206,7 @@
std::map<int, std::array<std::array<TH1D*, 3>, NBeautyHadrons + 1>> hFonllPythiaNonPromptChad{};
for (auto iChad{0}; iChad < NCharmHadrons; ++iChad) {
for (auto iBHad{0}; iBHad < NBeautyHadrons; ++iBHad) {
for (auto iFonll{0}; iFonll < 3; ++iFonll) {

Check failure on line 209 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll] = new TH1D(
Form("hFonll%sFrom%s%s", charmHadNames[iChad].data(), beautyHadNames[iBHad].data(), namesFonll[iFonll].data()),
";#it{p}_{T} (GeV/#it{c});d#sigma/d#it{p}_{T} (#it{c}/GeV)", 1000, 0., 100.);
Expand All @@ -223,17 +223,17 @@
} else if (fragFracOpt == PPbar) {
fragFracs = beautyFragFracPPbar;
} else { // LHCb
for (int iPar{0}; iPar < 15; ++iPar) {

Check failure on line 226 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
fragFracFuncs[0][iPar] = new TF1(Form("fracBz_%d", iPar), "1 / (2 * (([0] * ([1] + [2] * (x - [3]))) + ([4] * ([5] + exp([6] + [7] * x))) + 1) )", 0.f, 300.f); // B0
fragFracFuncs[1][iPar] = new TF1(Form("fracBp_%d", iPar), "1 / (2 * (([0] * ([1] + [2] * (x - [3]))) + ([4] * ([5] + exp([6] + [7] * x))) + 1) )", 0.f, 300.f); // B+
fragFracFuncs[2][iPar] = new TF1(Form("fracBs_%d", iPar), "([0] * ([1] + [2] * (x - [3]))) / (([0] * [1] + [2] * (x - [3])) + ([4] * ([5] + exp([6] + [7] * x))) + 1)", 0.f, 300.f); // Bs0
fragFracFuncs[3][iPar] = new TF1(Form("fracLb_%d", iPar), "([4] * ([5] + exp([6] + [7] * x))) / (([0] * ([1] + [2] * (x - [3]))) + ([4] * ([5] + exp([6] + [7] * x))) + 1)", 0.f, 300.f); // Lb

// parameters from https://arxiv.org/pdf/1902.06794.pdf
float sign = (iPar < 8) ? 1.f : -1.f;

Check failure on line 233 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
float parLbA = 1.f + ((iPar == 1 || iPar == 8) ? sign * 0.061f : 0.f);

Check failure on line 234 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
float parLbp1 = 0.0793f + ((iPar == 2 || iPar == 9) ? sign * 0.0141f : 0.f);

Check failure on line 235 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
float parLbp2 = -1.022f + ((iPar == 3 || iPar == 10) ? sign * 0.0047f : 0.f);

Check failure on line 236 in PWGHF/Macros/computeFonllPlusPythiaPredictions.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
float parLbp3 = -0.107f + ((iPar == 4 || iPar == 11) ? sign * 0.002f : 0.f);
float parBsA = 1.f + ((iPar == 5 || iPar == 12) ? sign * 0.043f : 0.f);
float parBsp1 = 0.119f + ((iPar == 6 || iPar == 13) ? sign * 0.001f : 0.f);
Expand Down Expand Up @@ -316,12 +316,12 @@

std::array<float, 3> normCrossSec{};
for (auto iFonll{0}; iFonll < 3; ++iFonll) {
normCrossSec[iFonll] = hFonllBhad[iFonll]->Integral();
normCrossSec[iFonll] = hFonllBhad[iFonll]->Integral(1, hFonllBhad[iFonll]->GetNbinsX() + 1, "width");
for (auto iChad{0}; iChad < NCharmHadrons; ++iChad) {
hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][NBeautyHadrons][iFonll] = reinterpret_cast<TH1D*>(hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][0][iFonll]->Clone(Form("hFonllNonPrompt%s%s", charmHadNames[iChad].data(), namesFonll[iFonll].data())));
hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][NBeautyHadrons][iFonll]->Reset();
for (auto iBHad{0}; iBHad < NBeautyHadrons; ++iBHad) {
hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll]->Scale(normCrossSec[iFonll] / nDecays);
hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll]->Scale(normCrossSec[iFonll] / nDecays, "width");
hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][NBeautyHadrons][iFonll]->Add(hFonllPythiaNonPromptChad[charmHadPdgs[iChad]][iBHad][iFonll]);
}
}
Expand Down
Loading