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
13 changes: 8 additions & 5 deletions DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,25 @@
///
/// \author Fabrizio Grosa <fabrizio.grosa@cern.ch>, CERN

#include "CCDB/BasicCCDBManager.h"
#include "CommonConstants/PhysicsConstants.h"
#include "PWGHF/Utils/utilsAnalysis.h"

#include "Common/Core/RecoDecay.h"
#include "Common/Core/TrackSelection.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/CollisionAssociationTables.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Tools/ML/MlResponse.h"

#include "CCDB/BasicCCDBManager.h"
#include "CommonConstants/PhysicsConstants.h"
#include "DCAFitter/DCAFitterN.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DCAFitter/DCAFitterN.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "PWGHF/Utils/utilsAnalysis.h"
#include "Tools/ML/MlResponse.h"

#include <TPDGCode.h>

#include <algorithm>
Expand Down Expand Up @@ -245,8 +248,8 @@
using CollisionsWithEvSel = soa::Join<aod::Collisions, aod::EvSels>;

Filter evSelFilter = aod::evsel::sel8 == true; // simple event selection
Filter collisionFilter = nabs(aod::collision::posZ) < 10.f; // simple event selection

Check failure on line 251 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx

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.
Filter trackFilter = requireGlobalTrackWoDCAInFilter() && aod::track::pt > trackPtMin && (nabs(aod::track::dcaXY) > trackDcaXyMin || aod::track::pt > 2.f); // for the tag, we only consider global tracks with large dcaXY (low pT only)

Check failure on line 252 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx

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.
using TracksWithSelAndDcaFiltered = soa::Filtered<TracksWithSelAndDca>;
using TracksWithSelAndDcaMcFiltered = soa::Filtered<TracksWithSelAndDcaMc>;
using CollisionsFiltered = soa::Filtered<CollisionsWithEvSel>;
Expand Down Expand Up @@ -413,13 +416,13 @@

if (channel == aod::tagandprobe::TagChannels::DplusToKPiPi) {
pdgTagMother = constants::physics::Pdg::kDPlus;
pdgProbeParticle = 321; // Ka

Check failure on line 419 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.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.
} else if (channel == aod::tagandprobe::TagChannels::DsOrDplusToKKPi) {
pdgTagMother = constants::physics::Pdg::kPhi;
pdgProbeParticle = 211; // Pi

Check failure on line 422 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.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.
} else {
pdgTagMother = constants::physics::Pdg::kD0;
pdgProbeParticle = 211; // Pi

Check failure on line 425 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.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.
}

if (!firsTrack.has_mcParticle() || !secondTrack.has_mcParticle()) {
Expand All @@ -442,8 +445,8 @@
auto daughters = particleMother.template daughters_as<PParticles>();

// Check if the probe is within the mother's particle daughters
if (daughters.size() == 3) { // non-resonant decay

Check failure on line 448 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx

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.
for (auto& daughter : daughters) {

Check failure on line 449 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.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 (std::abs(daughter.pdgCode()) == pdgProbeParticle) {
isTaggedAsSignal = true;
motherIdx = firstTrackMotherId;
Expand All @@ -451,7 +454,7 @@
}
}
} else if (daughters.size() == 2) { // resonant decay
for (auto& daughter : daughters) {

Check failure on line 457 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.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.
auto absPdg = std::abs(daughter.pdgCode());
if (std::find(pdgResonances.begin(), pdgResonances.end(), absPdg) != pdgResonances.end()) {
isTaggedAsSignal = true;
Expand All @@ -464,14 +467,14 @@
} else {
/// K∓K± for φ from Ds± or D± → φπ± decays
/// K∓π± for D0 from D±* → D0π± decays
for (auto pdgGrandMother : pdgDecayMothers) {

Check failure on line 470 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.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.
auto grandMotherId = RecoDecay::getMother(mcParticles, particleMother, pdgGrandMother, true);
if (grandMotherId != -1) {
auto particleGrandMother = mcParticles.rawIteratorAt(grandMotherId);
auto daughters = particleGrandMother.template daughters_as<PParticles>();
// Check if the probe is within the GrandMother's particle daughters
if (daughters.size() == 2) { // exclude undesired decays, such as Ds± → φπ±π±π∓
for (auto& daughter : daughters) {

Check failure on line 477 in DPG/Tasks/AOTTrack/tagAndProbeDmesons.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 (std::abs(daughter.pdgCode()) == pdgProbeParticle) {
isTaggedAsSignal = true;
motherIdx = grandMotherId;
Expand Down
Loading