Skip to content
Merged
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
8 changes: 4 additions & 4 deletions PWGLF/DataModel/LFLambda1405Table.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
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

// Flow columns
DECLARE_SOA_COLUMN(ScalarProd, scalarProd, float); //! Scalar product of the candidate
DECLARE_SOA_COLUMN(Centrality, centrality, float); //! Centrality of the candidate
DECLARE_SOA_COLUMN(ScalarProd, scalarProd, float); //! Scalar product of the candidate
DECLARE_SOA_COLUMN(Centrality, centrality, float); //! Centrality of the candidate

// MC Columns
DECLARE_SOA_COLUMN(PtMC, ptMC, float); //! pT of the candidate in MC
Expand All @@ -73,8 +73,8 @@
lambda1405::NSigmaTPCPiDau, lambda1405::NSigmaTOFPiDau);

DECLARE_SOA_TABLE(Lambda1405Flow, "AOD", "LAMBDA1405FLOW",
o2::soa::Index<>,
lambda1405::Pt,
o2::soa::Index<>,
lambda1405::Pt,
lambda1405::Mass, lambda1405::SigmaMinusMass, lambda1405::SigmaPlusMass,
lambda1405::AlphaAPSigma, lambda1405::QtAPSigma,
lambda1405::NSigmaTPCPiKink, lambda1405::NSigmaTOFPiKink,
Expand Down
44 changes: 24 additions & 20 deletions PWGLF/TableProducer/Common/kinkBuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#include "PWGLF/DataModel/LFKinkDecayTables.h"
#include "PWGLF/Utils/svPoolCreator.h"

#include "Common/DataModel/Centrality.h"
#include "Common/Core/RecoDecay.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/Centrality.h"

#include <CCDB/BasicCCDBManager.h>
#include <CommonConstants/MathConstants.h>
Expand Down Expand Up @@ -322,7 +322,7 @@
hSelKinkedTrackQA->GetXaxis()->SetBinLabel(11, "MothLastLayerRadiusCheck");
hMothDaughSignsInit = qaRegistry.add<TH2>("hMothDaughSignsInit", "hMothDaughSignsInit; Sign Mother; Sign Daughter", {HistType::kTH2F, {{3, -1.5, 1.5}, {3, -1.5, 1.5}}});
hMothDaughSignsFinal = qaRegistry.add<TH2>("hMothDaughSignsFinal", "hMothDaughSignsFinal; Sign Mother; Sign Daughter", {HistType::kTH2F, {{3, -1.5, 1.5}, {3, -1.5, 1.5}}});
hZDiff = qaRegistry.add<TH2>("hZDiff", "hZDiff; #Delta z (#mu m);(Q_{Mother}, Q_{Daughter})", HistType::kTH2F, {zDiffBins, {4, -0.5, 3.5}});
hZDiff = qaRegistry.add<TH2>("hZDiff", "hZDiff; #Delta z (#mu m);(Q_{Mother}, Q_{Daughter})", HistType::kTH2F, {zDiffBins, {4, -0.5, 3.5}});
hZDiff->GetYaxis()->SetBinLabel(1, "(+,+)");
hZDiff->GetYaxis()->SetBinLabel(2, "(-,-)");
hZDiff->GetYaxis()->SetBinLabel(3, "(+,-)");
Expand All @@ -348,19 +348,19 @@
hMothDecRad2->GetYaxis()->SetBinLabel(3, "(+,-)");
hMothDecRad2->GetYaxis()->SetBinLabel(4, "(-,+)");

for (int i = 0; i < 5; i++) {

Check failure on line 351 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.
mBBparamsDaug[i] = cfgBetheBlochParams->get("Daughter", Form("p%i", i));
}
mBBparamsDaug[5] = cfgBetheBlochParams->get("Daughter", "resolution");

if (doprocessMc || doprocessMcWCent) {
if (skipBkgCands) {
hRecCandidates = qaRegistry.add<TH2>("hRecCandidates", "hRecCandidates;Counts;", {HistType::kTH2F, {{kNMatchedDecays, -0.5, static_cast<float>(kNMatchedDecays)-0.5}, absPtAxis}});
hRecCandidates = qaRegistry.add<TH2>("hRecCandidates", "hRecCandidates;Counts;", {HistType::kTH2F, {{kNMatchedDecays, -0.5, static_cast<float>(kNMatchedDecays) - 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}");
}
hGenCandidates = qaRegistry.add<TH2>("hGenCandidates", "hGenCandidates;Counts;", {HistType::kTH2F, {{kNMatchedDecays, -0.5, static_cast<float>(kNMatchedDecays)-0.5}, absPtAxis}});
hGenCandidates = qaRegistry.add<TH2>("hGenCandidates", "hGenCandidates;Counts;", {HistType::kTH2F, {{kNMatchedDecays, -0.5, static_cast<float>(kNMatchedDecays) - 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}");
Expand Down Expand Up @@ -396,15 +396,15 @@
hSelMotherQA->Fill(4.f, isPositive);

h2ItsClsMothBeforeSel->Fill(candidate.itsNCls(), candidate.itsNClsInnerBarrel());
if (candidate.itsNCls() >= 6)

Check failure on line 399 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;
hSelMotherQA->Fill(5.f, isPositive);

if (candidate.itsNClsInnerBarrel() != 3)

Check failure on line 403 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;
hSelMotherQA->Fill(6.f, isPositive);

if (candidate.itsChi2NCl() >= 36)

Check failure on line 407 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;
hSelMotherQA->Fill(7.f, isPositive);

Expand Down Expand Up @@ -437,15 +437,15 @@
if (candidate.itsNClsInnerBarrel() != 0)
return false;
hSelDaugQA->Fill(4.f, isPositive);

if (candidate.itsNCls() >= 4)

Check failure on line 441 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(5.f, isPositive);

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

Check failure on line 445 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);

if (candidate.tpcNClsFound() <= nTPCClusMinDaug)
return false;
hSelDaugQA->Fill(7.f, isPositive);
Expand All @@ -463,7 +463,7 @@
auto trackDaug = tracks.rawIteratorAt(svCand.tr1Idx);

// Fill Selections QA histo
int chargeCombSvCand = 2*unlikeSignBkg + (trackMoth.sign() == -1 ? 1 : 0);
int chargeCombSvCand = 2 * unlikeSignBkg + (trackMoth.sign() == -1 ? 1 : 0);
hSelKinkedTrackQA->Fill(0.f, chargeCombSvCand); // all candidates bin
hMothDaughSignsInit->Fill(trackMoth.sign(), trackDaug.sign());

Expand Down Expand Up @@ -553,13 +553,13 @@

// get last layer hitted by the mother and the first layer hitted by the daughter
int lastLayerMoth = 0, firstLayerDaug = 0;
for (int i = 0; i < 7; i++) {

Check failure on line 556 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.
if (trackMoth.itsClusterMap() & (1 << i)) {
lastLayerMoth = i;
}
}

for (int i = 0; i < 7; i++) {

Check failure on line 562 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.
if (trackDaug.itsClusterMap() & (1 << i)) {
firstLayerDaug = i;
break;
Expand All @@ -576,7 +576,7 @@
}
hSelKinkedTrackQA->Fill(10.f, chargeCombSvCand); // MothLastLayerRadiusCheck cut bin

for (int i = 0; i < 3; i++) {

Check failure on line 579 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.
kinkCand.decVtx[i] -= kinkCand.primVtx[i];
}

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

template<typename TColls, typename TTracks, typename TAmbiTracks>
void buildSvPool(const TColls& collisions, const TTracks& tracks, const TAmbiTracks& ambiguousTracks, const aod::BCs& bcs) {
template <typename TColls, typename TTracks, typename TAmbiTracks>
void buildSvPool(const TColls& collisions, const TTracks& tracks, const TAmbiTracks& ambiguousTracks, const aod::BCs& bcs)
{
svCreator.clearPools();
svCreator.fillBC2Coll(collisions, bcs);

Expand All @@ -661,8 +662,9 @@
}
}

template<typename TColls, typename TTracks>
void fillOutputsData(const TColls& collisions, const TTracks& tracks, const aod::AmbiguousTracks& ambiTracks, const aod::BCs& bcs) {
template <typename TColls, typename TTracks>
void fillOutputsData(const TColls& collisions, const TTracks& tracks, const aod::AmbiguousTracks& ambiTracks, const aod::BCs& bcs)
{
kinkCandidates.clear();

buildSvPool(collisions, tracks, ambiTracks, bcs);
Expand Down Expand Up @@ -703,15 +705,16 @@
}
PROCESS_SWITCH(kinkBuilder, processDataWCentSel, "Data processing with centrality selection", false);

template<bool checkKinkDaugPdg, typename TMother>
int matchKinkDecay(const TMother& motherPart, const aod::McParticles& mcParticles) {
template <bool checkKinkDaugPdg, typename TMother>
int matchKinkDecay(const TMother& motherPart, const aod::McParticles& mcParticles)
{
int pdgMother = motherPart.pdgCode();
int8_t sign = 0;
int pdgCodeNeutralDaug{-1}, pdgCodeChargedDaug{-1};
std::array<int, 2> finState = {-1, -1};
switch (std::abs(pdgMother)) {
case PDG_t::kSigmaMinus: {
// Swap the sign of the neutral decay products in case of anti-particles
// Swap the sign of the neutral decay products in case of anti-particles
pdgCodeNeutralDaug = (pdgMother > 0) ? +PDG_t::kNeutron : -PDG_t::kNeutron;
pdgCodeChargedDaug = (pdgMother > 0) ? +PDG_t::kPiMinus : +PDG_t::kPiPlus;
finState = {pdgCodeChargedDaug, pdgCodeNeutralDaug}; // Both decay channels have the same neutral daughter
Expand All @@ -723,7 +726,7 @@
case PDG_t::kSigmaPlus: {
// Swap the sign of the neutral decay products in case of anti-particles
pdgCodeNeutralDaug = (pdgMother > 0) ? +PDG_t::kNeutron : -PDG_t::kNeutron;
pdgCodeChargedDaug = (pdgMother > 0) ? +PDG_t::kPiPlus : +PDG_t::kPiMinus;
pdgCodeChargedDaug = (pdgMother > 0) ? +PDG_t::kPiPlus : +PDG_t::kPiMinus;
finState = {pdgCodeChargedDaug, pdgCodeNeutralDaug};
if (RecoDecay::isMatchedMCGen<false, true>(mcParticles, motherPart, pdgMother, finState, true, &sign, DepthMcMatchMax)) {
return kSigmaPlusToPiPlusNeutron;
Expand All @@ -746,8 +749,9 @@
return -1;
}

template<typename TColls, typename TTracks>
void fillOutputsMc(const TColls& mcRecoCollisions, const TTracks& tracksMc, const aod::AmbiguousTracks& ambiTracksMc, const aod::BCs& bcs, const aod::McParticles& mcParticles) {
template <typename TColls, typename TTracks>
void fillOutputsMc(const TColls& mcRecoCollisions, const TTracks& tracksMc, const aod::AmbiguousTracks& ambiTracksMc, const aod::BCs& bcs, const aod::McParticles& mcParticles)
{
kinkCandidates.clear();

buildSvPool(mcRecoCollisions, tracksMc, ambiTracksMc, bcs);
Expand Down Expand Up @@ -828,7 +832,7 @@
McRecoCollisions const& mcRecoCollisions,
aod::McParticles const& mcParticles,
TracksFullMc const& tracksMc,
aod::AmbiguousTracks const& ambiTracksMc,
aod::AmbiguousTracks const& ambiTracksMc,
aod::BCs const& bcs)
{
fillOutputsMc(mcRecoCollisions, tracksMc, ambiTracksMc, bcs, mcParticles);
Expand All @@ -839,7 +843,7 @@
McRecoCollisionsCentSel const& mcRecoCollisions,
aod::McParticles const& mcParticles,
TracksFullMc const& tracksMc,
aod::AmbiguousTracks const& ambiTracksMc,
aod::AmbiguousTracks const& ambiTracksMc,
aod::BCs const& bcs)
{
fillOutputsMc(mcRecoCollisions, tracksMc, ambiTracksMc, bcs, mcParticles);
Expand Down
Loading
Loading