Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions PWGLF/DataModel/LFLambda1405Table.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
DECLARE_SOA_COLUMN(NSigmaTOFPiKink, nSigmaTOFPiKink, float); //! Number of sigmas for the pion candidate from Sigma kink in TOF
DECLARE_SOA_COLUMN(NSigmaTPCPrKink, nSigmaTPCPrKink, float); //! Number of sigmas for the proton candidate from Sigma kink in TPC
DECLARE_SOA_COLUMN(NSigmaTOFPrKink, nSigmaTOFPrKink, float); //! Number of sigmas for the proton candidate from Sigma kink in TOF
DECLARE_SOA_COLUMN(DCAKinkDauToPV, dcaKinkDauToPV, float); //! DCA of the kink daughter to the primary vertex

Check failure on line 47 in PWGLF/DataModel/LFLambda1405Table.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(NSigmaTPCPiDau, nSigmaTPCPiDau, float); //! Number of sigmas for the lambda1405 pion daughter in TPC
DECLARE_SOA_COLUMN(NSigmaTOFPiDau, nSigmaTOFPiDau, float); //! Number of sigmas for the lambda1405 pion daughter in TOF

Expand Down Expand Up @@ -74,8 +74,9 @@

DECLARE_SOA_TABLE(Lambda1405Flow, "AOD", "LAMBDA1405FLOW",
o2::soa::Index<>,
lambda1405::Pt,
lambda1405::Mass, lambda1405::SigmaMinusMass, lambda1405::SigmaPlusMass,
lambda1405::Pt, lambda1405::Mass,
lambda1405::PtSigma,
lambda1405::SigmaMinusMass, lambda1405::SigmaPlusMass,
lambda1405::AlphaAPSigma, lambda1405::QtAPSigma,
lambda1405::NSigmaTPCPiKink, lambda1405::NSigmaTOFPiKink,
lambda1405::NSigmaTPCPrKink, lambda1405::NSigmaTOFPrKink,
Expand Down
97 changes: 74 additions & 23 deletions PWGLF/TableProducer/Common/kinkBuilder.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/TableProducer/Common/kinkBuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -96,7 +96,10 @@
std::shared_ptr<TH2> hDCADaugToPV;
std::shared_ptr<TH2> hMothDecRad2;
std::shared_ptr<TH2> hGenCandidates;
std::shared_ptr<TH2> hRecCandidates;
std::shared_ptr<TH2> hGenDecayRadius;
std::shared_ptr<TH2> hRecCandidatesRecoPt;
std::shared_ptr<TH2> hRecCandidatesGenPt;
std::shared_ptr<TH2> hRecCandidatesDeltaPt;
std::array<std::shared_ptr<TH2>, NMatchedDecays> hGenPtKinkAngle;
std::array<std::shared_ptr<TH2>, NMatchedDecays> hRecPtKinkAngle;
} // namespace
Expand Down Expand Up @@ -362,21 +365,27 @@

if (doprocessMc || doprocessMcWCent) {
if (skipBkgCands) {
hRecCandidates = qaRegistry.add<TH2>("hRecCandidates", "hRecCandidates;Counts;", {HistType::kTH2F, {{NMatchedDecays, -0.5, static_cast<float>(NMatchedDecays) - 0.5}, absPtAxis}});
hRecCandidates->GetXaxis()->SetBinLabel(1, "#Sigma^{-} #rightarrow n#pi^{-}");
hRecCandidates->GetXaxis()->SetBinLabel(2, "#Sigma^{+} #rightarrow n#pi^{+}");
hRecCandidates->GetXaxis()->SetBinLabel(3, "#Sigma^{+} #rightarrow p#pi^{0}");
hRecCandidatesRecoPt = qaRegistry.add<TH2>("hRecCandidatesRecoPt", "hRecCandidates;Counts;Reco #it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{NMatchedDecays, -0.5, static_cast<float>(NMatchedDecays) - 0.5}, absPtAxis}});
hRecCandidatesRecoPt->GetXaxis()->SetBinLabel(1, "#Sigma^{-} #rightarrow n#pi^{-}");
hRecCandidatesRecoPt->GetXaxis()->SetBinLabel(2, "#Sigma^{+} #rightarrow n#pi^{+}");
hRecCandidatesRecoPt->GetXaxis()->SetBinLabel(3, "#Sigma^{+} #rightarrow p#pi^{0}");
hRecCandidatesGenPt = qaRegistry.add<TH2>("hRecCandidatesGenPt", "hRecCandidatesGenPt;Counts;Gen #it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{NMatchedDecays, -0.5, static_cast<float>(NMatchedDecays) - 0.5}, absPtAxis}});
hRecCandidatesGenPt->GetXaxis()->SetBinLabel(1, "#Sigma^{-} #rightarrow n#pi^{-}");
hRecCandidatesGenPt->GetXaxis()->SetBinLabel(2, "#Sigma^{+} #rightarrow n#pi^{+}");
hRecCandidatesGenPt->GetXaxis()->SetBinLabel(3, "#Sigma^{+} #rightarrow p#pi^{0}");
hRecCandidatesDeltaPt = qaRegistry.add<TH2>("hRecCandidatesDeltaPt", "hRecCandidatesDeltaPt;Counts;#Delta p_{T} (GeV/c)", {HistType::kTH2F, {{400, -0.5, 0.5}, absPtAxis}});
}
hGenCandidates = qaRegistry.add<TH2>("hGenCandidates", "hGenCandidates;Counts;", {HistType::kTH2F, {{NMatchedDecays, -0.5, static_cast<float>(NMatchedDecays) - 0.5}, absPtAxis}});
hGenDecayRadius = qaRegistry.add<TH2>("hGenDecayRadius", "hGenDecayRadius;Radius (cm); #it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{300, 0, 30}, absPtAxis}});
hGenCandidates = qaRegistry.add<TH2>("hGenCandidates", "hGenCandidates;Counts;Gen #it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{NMatchedDecays, -0.5, static_cast<float>(NMatchedDecays) - 0.5}, absPtAxis}});
hGenCandidates->GetXaxis()->SetBinLabel(1, "#Sigma^{-} #rightarrow n#pi^{-}");
hGenCandidates->GetXaxis()->SetBinLabel(2, "#Sigma^{+} #rightarrow n#pi^{+}");
hGenCandidates->GetXaxis()->SetBinLabel(3, "#Sigma^{+} #rightarrow p#pi^{0}");
hRecPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add<TH2>("hRecPtKinkAngleSigmaMinusToPiMinusNeutron", "Rec Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hRecPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add<TH2>("hRecPtKinkAngleSigmaPlusToPiPlusNeutron", "Rec Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hRecPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add<TH2>("hRecPtKinkAngleSigmaPlusToProtonPi0", "Rec Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hGenPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add<TH2>("hGenPtKinkAngleSigmaMinusToPiMinusNeutron", "Gen Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hGenPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add<TH2>("hGenPtKinkAngleSigmaPlusToPiPlusNeutron", "Gen Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hGenPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add<TH2>("hGenPtKinkAngleSigmaPlusToProtonPi0", "Gen Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hRecPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add<TH2>("hRecPtKinkAngleSigmaMinusToPi", "Rec Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hRecPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add<TH2>("hRecPtKinkAngleSigmaPlusToPi", "Rec Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hRecPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add<TH2>("hRecPtKinkAngleSigmaPlusToPr", "Rec Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hGenPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add<TH2>("hGenPtKinkAngleSigmaMinusToPi", "Gen Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hGenPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add<TH2>("hGenPtKinkAngleSigmaPlusToPi", "Gen Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
hGenPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add<TH2>("hGenPtKinkAngleSigmaPlusToPr", "Gen Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;", {HistType::kTH2F, {absPtAxis, kinkAngleAxis}});
}
}

Expand All @@ -402,12 +411,14 @@
return false;
hSelMotherQA->Fill(4.f, isPositive);

h2ItsClsMothBeforeSel->Fill(candidate.itsNCls(), candidate.itsNClsInnerBarrel());
if (candidate.itsNCls() >= nItsTotalLayers - 1)
int itsTotCls = static_cast<int>(candidate.itsNCls());
int itsIBCls = static_cast<int>(candidate.itsNClsInnerBarrel());
h2ItsClsMothBeforeSel->Fill(itsTotCls, itsIBCls);
if (itsTotCls >= nItsTotalLayers - 1)
return false;
hSelMotherQA->Fill(5.f, isPositive);

if (candidate.itsNClsInnerBarrel() != nItsInnerBarrelLayers)
if (itsIBCls != nItsInnerBarrelLayers)
return false;
hSelMotherQA->Fill(6.f, isPositive);

Expand Down Expand Up @@ -440,8 +451,10 @@
return false;
hSelDaugQA->Fill(3.f, isPositive);

h2ItsClsDaugBeforeSel->Fill(candidate.itsNCls(), candidate.itsNClsInnerBarrel());
if (candidate.itsNClsInnerBarrel() != 0)
int itsTotCls = static_cast<int>(candidate.itsNCls());
int itsIBCls = static_cast<int>(candidate.itsNClsInnerBarrel());
h2ItsClsDaugBeforeSel->Fill(itsTotCls, itsIBCls);
if (itsIBCls != 0)
return false;
hSelDaugQA->Fill(4.f, isPositive);

Expand All @@ -449,7 +462,7 @@
return false;
hSelDaugQA->Fill(5.f, isPositive);

if (candidate.tpcNClsCrossedRows() <= 0.8 * candidate.tpcNClsFindable())

Check failure on line 465 in PWGLF/TableProducer/Common/kinkBuilder.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.
return false;
hSelDaugQA->Fill(6.f, isPositive);

Expand Down Expand Up @@ -649,7 +662,7 @@
LOG(info) << "Task initialized for run " << mRunNumber << " with magnetic field " << mBz << " kZG";
}

template <typename TColls, typename TTracks, typename TAmbiTracks>
template <bool isMC, typename TColls, typename TTracks, typename TAmbiTracks>
void buildSvPool(const TColls& collisions, const TTracks& tracks, const TAmbiTracks& ambiguousTracks, const aod::BCs& bcs)
{
svCreator.clearPools();
Expand All @@ -660,8 +673,38 @@
continue;
}

bool isDaug = selectDaugTrack(track);
bool isMoth = selectMothTrack(track);
bool canBeMoth = true;
bool canBeDaug = true;

if constexpr (isMC) {
if (!track.has_mcParticle()) {
LOG(debug) << "Track has no MC particle";
canBeMoth = false;
canBeDaug = false;
continue;
}
auto genPart = track.template mcParticle_as<aod::McParticles>();

canBeMoth = std::find(
mothMatchPdgCodes.begin(),
mothMatchPdgCodes.end(),
std::abs(genPart.pdgCode())) != mothMatchPdgCodes.end();

canBeDaug = false;
for (auto mother : genPart.template mothers_as<aod::McParticles>()) {

Check failure on line 694 in PWGLF/TableProducer/Common/kinkBuilder.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::find(
mothMatchPdgCodes.begin(),
mothMatchPdgCodes.end(),
std::abs(mother.pdgCode())) != mothMatchPdgCodes.end()) {
canBeDaug = true;
break;
}
}
}

bool isMoth = canBeMoth && selectMothTrack(track);
bool isDaug = canBeDaug && selectDaugTrack(track);

if (!isDaug && !isMoth) {
continue;
}
Expand All @@ -675,7 +718,7 @@
{
kinkCandidates.clear();

buildSvPool(collisions, tracks, ambiTracks, bcs);
buildSvPool<false>(collisions, tracks, ambiTracks, bcs);
auto& kinkPool = svCreator.getSVCandPool(collisions, !unlikeSignBkg);
bool isAccepted = false;
for (const auto& svCand : kinkPool) {
Expand Down Expand Up @@ -762,7 +805,12 @@
{
kinkCandidates.clear();

buildSvPool(mcRecoCollisions, tracksMc, ambiTracksMc, bcs);
if (skipBkgCands) {
buildSvPool<true>(mcRecoCollisions, tracksMc, ambiTracksMc, bcs);
} else {
buildSvPool<false>(mcRecoCollisions, tracksMc, ambiTracksMc, bcs);
}

auto& kinkPool = svCreator.getSVCandPool(mcRecoCollisions, !unlikeSignBkg);
for (const auto& svCand : kinkPool) {
// Perform matching of the kink candidate
Expand All @@ -787,7 +835,9 @@
if (decayChannel < 0) {
continue; // Skip candidates that do not match the decay channels of interest
}
hRecCandidates->Fill(decayChannel, trackMoth.pt()); // Decay channel match bin
hRecCandidatesRecoPt->Fill(decayChannel, trackMoth.pt()); // Decay channel match bin
hRecCandidatesGenPt->Fill(decayChannel, genMothPart.pt()); // Decay channel match bin
hRecCandidatesDeltaPt->Fill((trackMoth.pt() - genMothPart.pt()) / genMothPart.pt(), genMothPart.pt()); // Decay channel match bin
}
bool isAccepted = false;
buildKinkCand(svCand, tracksMc, isAccepted, mcRecoCollisions);
Expand Down Expand Up @@ -831,6 +881,7 @@
auto daughI = mcParticles.rawIteratorAt(arrDaughIdxs[iProng]);
if (std::abs(daughI.pdgCode()) == PDG_t::kPiPlus || std::abs(daughI.pdgCode()) == PDG_t::kProton) {
hGenPtKinkAngle[decayChannel]->Fill(mcPart.pt(), std::abs(mcPart.phi() - daughI.phi()) * radToDeg);
hGenDecayRadius->Fill(std::hypot(daughI.vx(), daughI.vy()), mcPart.pt());
}
}
}
Expand Down
Loading
Loading