Skip to content
Draft
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
8 changes: 7 additions & 1 deletion PWGHF/HFL/Tasks/taskSingleMuonSource.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <Framework/runDataProcessing.h>

#include <Math/Vector4D.h>
#include <TDatabasePDG.h>

Check failure on line 31 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include <TPDGCode.h>
#include <TString.h>

Expand Down Expand Up @@ -125,9 +125,11 @@
registry.add("h1MuBeforeCuts", "", h1Pt);
registry.add("h1MuonMass", "", h1Mass);
registry.add("h1BeautyMass", "", h1Mass);
registry.add("h1CorrBeautyMass", "", h1Mass);
registry.add("h1OtherMass", "", h1Mass);
registry.add("h1MuonMassGen", "", h1Mass);
registry.add("h1BeautyMassGen", "", h1Mass);
registry.add("h1CorrBeautyMassGen", "", h1Mass);
registry.add("h1OtherMassGen", "", h1Mass);
for (const auto& src : muonSources) {
registry.add(Form("h1%sPt", src.Data()), "", h1Pt);
Expand Down Expand Up @@ -159,7 +161,7 @@
mcPart = *(mcPart.mothers_first_as<aod::McParticles>());

const auto pdgAbs(std::abs(mcPart.pdgCode()));
if (pdgAbs < 10 || pdgAbs == 21) {

Check failure on line 164 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

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.
break; // Quark and gluon
}

Expand All @@ -183,7 +185,7 @@
if ((pdgRem < 100) || (pdgRem >= 10000)) {
continue;
}
if ((pdgRem % 100 == 1 || pdgRem % 100 == 3) && pdgRem > 1000) { // diquarks

Check failure on line 188 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

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;
}
// compute the flavor of constituent quark
Expand All @@ -198,7 +200,7 @@
continue;
}

auto* pdgData(TDatabasePDG::Instance()->GetParticle(mcPart.pdgCode()));

Check failure on line 203 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
if ((pdgData != nullptr) && (pdgData->AntiParticle() == nullptr)) {
SETBIT(mask, HasQuarkoniumParent);
} else if (flv == 4) {
Expand Down Expand Up @@ -359,20 +361,20 @@
mcPart = mother;
}
int flv = mcPart.pdgCode() / std::pow(10, static_cast<int>(std::log10(std::abs(mcPart.pdgCode()))));
if (abs(flv) == 5 && mcPart.pdgCode() < 1000)

Check failure on line 364 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
flv = -flv;
for (int i = (mcPart.mothers_first_as<aod::McParticles>()).globalIndex(); i <= (mcPart.mothers_last_as<aod::McParticles>()).globalIndex(); i++) { // loop over the lund string
for (auto mctrack : mctracks) {

Check failure on line 367 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (mctrack.globalIndex() != i) {
continue;
}
if ((mctrack.pdgCode() != flv) && (abs(mctrack.pdgCode()) < abs(flv) * 1000)) {

Check failure on line 371 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;
}
while (mctrack.has_mothers()) {
int motherflv = (mctrack.mothers_first_as<aod::McParticles>()).pdgCode() / std::pow(10, static_cast<int>(std::log10(abs((mctrack.mothers_first_as<aod::McParticles>()).pdgCode())))); // find the mother with same flavor

Check failure on line 375 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
auto mother = (abs(motherflv) == abs(flv)) ? (mctrack.mothers_first_as<aod::McParticles>()) : (mctrack.mothers_last_as<aod::McParticles>());

Check failure on line 376 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if ((mother.pdgCode() != mctrack.pdgCode()) && (abs(mctrack.pdgCode()) < 10)) { // both mother is not the the quark with same flavor

Check failure on line 377 in PWGHF/HFL/Tasks/taskSingleMuonSource.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
mcNum = mctrack.globalIndex();
return mcNum;
}
Expand Down Expand Up @@ -436,9 +438,13 @@
registry.fill(HIST("h1MuonMass"), InvM);
registry.fill(HIST("h1MuonMassGen"), InvMGen);
}
if (Corr(muon, muon2, mcParts) && isBeautyMu(mask1) && isBeautyMu(mask2)) {
if (isBeautyMu(mask1) && isBeautyMu(mask2)) {
registry.fill(HIST("h1BeautyMass"), InvM);
registry.fill(HIST("h1BeautyMassGen"), InvMGen);
if (Corr(muon, muon2, mcParts)) {
registry.fill(HIST("h1CorrBeautyMass"), InvM);
registry.fill(HIST("h1CorrBeautyMassGen"), InvMGen);
}
} else {
registry.fill(HIST("h1OtherMass"), InvM);
registry.fill(HIST("h1OtherMassGen"), InvMGen);
Expand Down
Loading