Skip to content
Closed
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
99 changes: 51 additions & 48 deletions PWGHF/TableProducer/treeCreatorOmegacSt.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 PWGHF/TableProducer/treeCreatorOmegacSt.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -13,7 +13,7 @@
/// \brief Task to reconstruct Ωc from strangeness-tracked Ω and pion/kaon
///
/// \author Jochen Klein
/// \author Tiantian Cheng

Check failure on line 16 in PWGHF/TableProducer/treeCreatorOmegacSt.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include <map>
#include <memory>
Expand Down Expand Up @@ -118,7 +118,7 @@
DECLARE_SOA_COLUMN(PyPionOrKaon, pyPionOrKaon, float);
DECLARE_SOA_COLUMN(PzPionOrKaon, pzPionOrKaon, float);
DECLARE_SOA_COLUMN(IsPositivePionOrKaon, isPositivePionOrKaon, bool);
DECLARE_SOA_COLUMN(ITSClusterMapPionOrKaon, itsClusterMapPionOrKaon, uint8_t);

Check failure on line 121 in PWGHF/TableProducer/treeCreatorOmegacSt.cxx

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(CpaCharmedBaryon, cpaCharmedBaryon, float);
DECLARE_SOA_COLUMN(CpaXYCharmedBaryon, cpaXYCharmedBaryon, float);
DECLARE_SOA_COLUMN(CpaCasc, cpaCasc, float);
Expand Down Expand Up @@ -256,7 +256,7 @@
using TracksExtMc = soa::Join<TracksExt, aod::McTrackLabels>;

Filter collisionFilter = (filterCollisions.node() == 0) ||
(filterCollisions.node() == 8 && o2::aod::evsel::sel8 == true);

Check failure on line 259 in PWGHF/TableProducer/treeCreatorOmegacSt.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.

// Preslice<aod::Tracks> perCol = aod::track::collisionId;
PresliceUnsorted<aod::TrackAssoc> trackIndicesPerCollision = aod::track_association::collisionId;
Expand Down Expand Up @@ -331,8 +331,8 @@
int8_t nPiToMuV0{0}, nPiToMuCasc{0}, nPiToMuOmegac0{0};
int8_t nKaToPiCasc{0}, nKaToPiOmegac0{0};
std::vector<int> idxBhadMothers{};
int decayChannel = -1; // flag for different decay channels
int decayChannel = -1; // flag for different decay channels

void processMc(aod::McCollisions const&,
aod::McParticles const& mcParticles)
{
Expand All @@ -342,7 +342,7 @@
const bool isXiC = std::abs(mcParticle.pdgCode()) == constants::physics::Pdg::kXiC0;
if (isOmegaC || isXiC) {
const auto daughters = mcParticle.daughters_as<aod::McParticles>();
if (daughters.size() == 2) {

Check failure on line 345 in PWGHF/TableProducer/treeCreatorOmegacSt.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.
int idxPionDaughter = -1;
int idxCascDaughter = -1;
int idxKaonDaughter = -1;
Expand All @@ -359,11 +359,11 @@
}
}
if (idxPionDaughter >= 0 && idxCascDaughter >= 0) {
decayChannel = hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi; // OmegaC -> Omega + Pi
decayChannel = hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi; // OmegaC -> Omega + Pi
} else if (idxKaonDaughter >= 0 && idxCascDaughter >= 0) {
decayChannel = hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK; // OmegaC -> Omega + K
decayChannel = hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK; // OmegaC -> Omega + K
} else {
LOG(warning) << "Decay channel not recognized!";
LOG(warning) << "Decay channel not recognized!";
}
if (decayChannel != -1) {
int idxDaughter = (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) ? idxPionDaughter : idxKaonDaughter;
Expand Down Expand Up @@ -551,7 +551,7 @@
if (((std::abs(bachelor.tpcNSigmaKa()) < maxNSigmaBachelor) || (std::abs(bachelor.tpcNSigmaPi()) < maxNSigmaBachelor)) &&
(std::abs(v0TrackPr.tpcNSigmaPr()) < maxNSigmaV0Pr) &&
(std::abs(v0TrackPi.tpcNSigmaPi()) < maxNSigmaV0Pi)) {

std::array<double, 2> massesOmegacToOmegaPi{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassPiPlus};
std::array<double, 2> massesOmegacToOmegaK{o2::constants::physics::MassOmegaMinus, o2::constants::physics::MassKPlus};
std::array<double, 2> massesXicDaughters{o2::constants::physics::MassXiMinus, o2::constants::physics::MassPiPlus};
Expand All @@ -573,19 +573,19 @@
o2::base::Propagator::Instance()->propagateToDCABxByBz(primaryVertex, trackParCovPi, 2.f, matCorr, &impactParameterPi);
}

for (auto trackId : groupedTrackIds) {

Check failure on line 576 in PWGHF/TableProducer/treeCreatorOmegacSt.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.
const auto track = trackId.template track_as<TracksType>();
if (track.globalIndex() == v0TrackPr.globalIndex() ||
track.globalIndex() == v0TrackPi.globalIndex() ||
track.globalIndex() == bachelor.globalIndex()) {
continue;
}
if ((track.itsNCls() >= 4) &&

Check failure on line 583 in PWGHF/TableProducer/treeCreatorOmegacSt.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.
(track.tpcNClsFound() >= minNoClsTrackedPionOrKaon) &&
(track.tpcNClsCrossedRows() >= minNoClsTrackedPionOrKaon) &&
(track.tpcNClsCrossedRows() >= 0.8 * track.tpcNClsFindable()) &&

Check failure on line 586 in PWGHF/TableProducer/treeCreatorOmegacSt.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.
(track.tpcChi2NCl() <= 4.f) &&

Check failure on line 587 in PWGHF/TableProducer/treeCreatorOmegacSt.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.
(track.itsChi2NCl() <= 36.f) &&

Check failure on line 588 in PWGHF/TableProducer/treeCreatorOmegacSt.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.
(std::abs(track.tpcNSigmaPi()) < maxNSigmaPion || std::abs(track.tpcNSigmaKa()) < maxNSigmaKaon)) {
LOGF(debug, " .. combining with pion/kaon candidate %d", track.globalIndex());
int trackMotherId = -1;
Expand Down Expand Up @@ -633,56 +633,59 @@
registry.fill(HIST("hMassOmegaPiVsPt"), massOmegaPi, RecoDecay::pt(momenta[0], momenta[1]));
registry.fill(HIST("hMassOmegaK"), massOmegaK);
registry.fill(HIST("hMassOmegaKVsPt"), massOmegaK, RecoDecay::pt(momenta[0], momenta[1]));

//--- do the MC Rec match
auto arrayDaughters = std::array{trackId.template track_as<TracksExtMc>, // bachelor <- charm baryon
casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade
V0.posTrack_as<TracksExtMc>(), // p <- lambda
V0.negTrack_as<TracksExtMc> // pi <- lambda
};
auto arrayDaughtersCasc = std::array{casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade
V0.posTrack_as<TracksExtMc>(), // p <- lambda
V0.negTrack_as<TracksExtMc> // pi <- lambda
};
auto arrayDaughtersV0 = std::array{V0.posTrack_as<TracksExtMc>(), // p <- lambda
V0.negTrack_as<TracksExtMc> // pi <- lambda
};

auto arrayDaughters = std::array{
trackId.template track_as<TracksExtMc>, // bachelor <- charm baryon
casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade
V0.posTrack_as<TracksExtMc>(), // p <- lambda
V0.negTrack_as<TracksExtMc> // pi <- lambda
};
auto arrayDaughtersCasc = std::array{
casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade
V0.posTrack_as<TracksExtMc>(), // p <- lambda
V0.negTrack_as<TracksExtMc> // pi <- lambda
};
auto arrayDaughtersV0 = std::array{
V0.posTrack_as<TracksExtMc>(), // p <- lambda
V0.negTrack_as<TracksExtMc> // pi <- lambda
};

if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) {
// Match Omegac0 → Omega- + Pi+
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles,arrayDaughters,+kOmegaC0,
std::array{+kPiPlus, +kKMinus, +kProton, +kPiMinus},true,&sign,3,&nPiToMuOmegac0,&nKaToPiOmegac0);
// Match Omegac0 → Omega- + Pi+
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles, arrayDaughters, +kOmegaC0,
std::array{+kPiPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0);
} else if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) {
// Match Omegac0 → Omega- + K+
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles,arrayDaughters,+kOmegaC0,
std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus},true,&sign,3,&nPiToMuOmegac0,&nKaToPiOmegac0);
// Match Omegac0 → Omega- + K+
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles, arrayDaughters, +kOmegaC0,
std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0);
}

indexRecCharmBaryon = indexRec;
if(indexRec -> -1){
// Omega- → K pi p (Cascade match)
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles, arrayDaughtersCasc, +kOmegaMinus, std::array{+kKMinus, +kProton, +kPiMinus}, true, &signCasc, 2, &nPiToMuCasc, &nKaToPiCasc);
if(indexRec -> -1 ){
// Lambda → p pi (Lambda match)
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles, arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1, &nPiToMuV0);
if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) {
if (nPiToMuOmegac0 >= 1 && nKaToPiOmegac0 == 0) {
isMatched = true;
} else if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) {
isMatched = true;
}
} else if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) {
if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) {
isMatched = true;
}
}
if (indexRec->- 1) {
// Omega- → K pi p (Cascade match)
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles, arrayDaughtersCasc, +kOmegaMinus, std::array{+kKMinus, +kProton, +kPiMinus}, true, &signCasc, 2, &nPiToMuCasc, &nKaToPiCasc);
if (indexRec->- 1) {
// Lambda → p pi (Lambda match)
indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles, arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1, &nPiToMuV0);
if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) {
if (nPiToMuOmegac0 >= 1 && nKaToPiOmegac0 == 0) {
isMatched = true;
} else if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) {
isMatched = true;
}
} else if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) {
if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) {
isMatched = true;
}
}
}
if (isMatched) {
auto particle = mcParticles.rawIteratorAt(indexRecCharmBaryon);
origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers);
}

}
if (isMatched) {
auto particle = mcParticles.rawIteratorAt(indexRecCharmBaryon);
origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers);
}

if ((std::abs(massOmegaC - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) ||
(std::abs(massXiC - o2::constants::physics::MassXiC0) < massWindowXiC)) {
registry.fill(HIST("hDecayLength"), decayLength * 1e4);
Expand Down
Loading