diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 4d0f758d548..53300ba88f9 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -169,7 +169,7 @@ struct HfFilter { // Main struct for HF triggers o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - void init(o2::framework::InitContext&) + void init(InitContext&) { cutsSingleTrack = {cutsTrackBeauty3Prong, cutsTrackBeauty4Prong, cutsTrackCharmBaryonBachelor}; diff --git a/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx b/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx index a3bb035fba7..1227a02171f 100644 --- a/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx +++ b/EventFiltering/PWGHF/HFFilterPrepareMLSamples.cxx @@ -57,7 +57,7 @@ struct HfFilterPrepareMlSamples { // Main struct o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; int currentRun = 0; // needed to detect if the run changed and trigger update of calibrations etc. - void init(o2::framework::InitContext&) + void init(InitContext&) { ccdb->setURL(url.value); ccdb->setCaching(true); @@ -70,7 +70,7 @@ struct HfFilterPrepareMlSamples { // Main struct void process(aod::Hf2Prongs const& cand2Prongs, aod::Hf3Prongs const& cand3Prongs, - aod::McParticles const& particlesMC, + aod::McParticles const& mcParticles, soa::Join const& collisions, BigTracksMCPID const&, aod::BCsWithTimestamps const&) @@ -116,10 +116,10 @@ struct HfFilterPrepareMlSamples { // Main struct // D0(bar) → π± K∓ bool isInCorrectColl{false}; - auto indexRec = RecoDecay::getMatchedMCRec(particlesMC, std::array{trackPos, trackNeg}, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); + auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, std::array{trackPos, trackNeg}, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); if (indexRec > -1) { - auto particle = particlesMC.rawIteratorAt(indexRec); - flag = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + flag = RecoDecay::getCharmHadronOrigin(mcParticles, particle); isInCorrectColl = (collision.mcCollisionId() == particle.mcCollisionId()); if (flag < RecoDecay::OriginType::Prompt) { continue; @@ -197,27 +197,27 @@ struct HfFilterPrepareMlSamples { // Main struct int8_t channel = -1; // D± → π± K∓ π± - auto indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + auto indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kDplus; } if (indexRec < 0) { // Ds± → K± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kDs; } } if (indexRec < 0) { // Λc± → p± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kLc; } } if (indexRec < 0) { // Ξc± → p± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec >= 0) { channel = kXic; } @@ -225,8 +225,8 @@ struct HfFilterPrepareMlSamples { // Main struct bool isInCorrectColl{false}; if (indexRec > -1) { - auto particle = particlesMC.rawIteratorAt(indexRec); - flag = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + flag = RecoDecay::getCharmHadronOrigin(mcParticles, particle); isInCorrectColl = (collision.mcCollisionId() == particle.mcCollisionId()); if (flag < RecoDecay::OriginType::Prompt) { continue; diff --git a/EventFiltering/PWGHF/HFFilterQC.cxx b/EventFiltering/PWGHF/HFFilterQC.cxx index 42775cb6ce4..87ac4997934 100644 --- a/EventFiltering/PWGHF/HFFilterQC.cxx +++ b/EventFiltering/PWGHF/HFFilterQC.cxx @@ -44,7 +44,7 @@ struct HfFilterQc { // Main struct for HF trigger QC HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - void init(o2::framework::InitContext&) + void init(InitContext&) { // Initialize the histograms hPartPerEvent[0] = registry.add("hPartPerEventAll", "All events;;number of particles", HistType::kTH2F, {{kNCharmParticles, -0.5, kNCharmParticles - 0.5}, {11, -0.5, 10.5}}); @@ -65,13 +65,13 @@ struct HfFilterQc { // Main struct for HF trigger QC /// Loops over particle species and checks whether the analysed particle is the correct one /// \param pdgDau tuple with PDG daughter codes for the desired decay - /// \param particlesMC table with MC particles + /// \param mcParticles table with MC particles /// \param particle MC particle /// \param nParticles array with number of particles found for each particle species /// \param triggerDecision array with trigger decision template constexpr void checkParticleDecay(std::tuple pdgDau, - const T& particlesMC, + const T& mcParticles, const U& particle, A& nParticles, const std::array& triggerDecision) @@ -83,7 +83,7 @@ struct HfFilterQc { // Main struct for HF trigger QC return; } else { int8_t sign = 0; - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdgCodesCharm[I], std::get(pdgDau), true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodesCharm[I], std::get(pdgDau), true, &sign, 2)) { nParticles[I]++; hPtDistr[0]->Fill(static_cast(I), static_cast(particle.pt())); for (auto iTrig = 0; iTrig < kNtriggersHF; ++iTrig) { @@ -94,12 +94,12 @@ struct HfFilterQc { // Main struct for HF trigger QC } // Going for next element. - checkParticleDecay(pdgDau, particlesMC, particle, nParticles, triggerDecision); + checkParticleDecay(pdgDau, mcParticles, particle, nParticles, triggerDecision); } } void process(HfFilter const& filterDecision, - McParticles const& particlesMC) + McParticles const& mcParticles) { bool hasHighPt2P = filterDecision.hasHfHighPt2P(); bool hasHighPt3P = filterDecision.hasHfHighPt3P(); @@ -118,9 +118,9 @@ struct HfFilterQc { // Main struct for HF trigger QC std::array nPart{0}; // Loop over the MC particles - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Check if the particle is of interest - checkParticleDecay(pdgCharmDaughters, particlesMC, particle, nPart, triggerDecision); + checkParticleDecay(pdgCharmDaughters, mcParticles, particle, nPart, triggerDecision); } for (auto iPart = 0; iPart < kNCharmParticles; ++iPart) { diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx index 04992ba820b..c473d14c7d0 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx @@ -216,7 +216,7 @@ struct HfCandidateCreatorChicMc { void process(aod::HfCandChic const& candidates, aod::HfCand2Prong const&, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC, + aod::McParticles const& mcParticles, aod::ECALs const& ecals) { int indexRec = -1; @@ -236,14 +236,14 @@ struct HfCandidateCreatorChicMc { auto arrayJpsiDaughters = std::array{daughterPosJpsi, daughterNegJpsi}; // chi_c → J/ψ gamma - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); if (indexRec > -1) { hMassJpsiToMuMuMatched->Fill(invMassJpsiToMuMu(candidate.prong0())); - int indexMother = RecoDecay::getMother(particlesMC, particlesMC.rawIteratorAt(indexRec), pdg::Code::kChiC1); - int indexMotherGamma = RecoDecay::getMother(particlesMC, particlesMC.rawIteratorAt(candidate.prong1().mcparticleId()), pdg::Code::kChiC1); + int indexMother = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(indexRec), pdg::Code::kChiC1); + int indexMotherGamma = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(candidate.prong1().mcparticleId()), pdg::Code::kChiC1); if (indexMother > -1 && indexMotherGamma == indexMother && candidate.prong1().mcparticle().pdgCode() == kGamma) { - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto particleMother = mcParticles.rawIteratorAt(indexMother); hEphotonMatched->Fill(candidate.prong1().e()); hMassEMatched->Fill(sqrt(candidate.prong1().px() * candidate.prong1().px() + candidate.prong1().py() * candidate.prong1().py() + candidate.prong1().pz() * candidate.prong1().pz())); if (particleMother.has_daughters()) { @@ -257,31 +257,31 @@ struct HfCandidateCreatorChicMc { } } if (flag != 0) { - auto particle = particlesMC.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchRec(flag, origin, channel); } // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; channel = 0; // chi_c → J/ψ gamma - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kChiC1, std::array{static_cast(pdg::Code::kJPsi), static_cast(kGamma)}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kChiC1, std::array{static_cast(pdg::Code::kJPsi), static_cast(kGamma)}, true)) { // Match J/psi --> e+e- std::vector arrDaughter; RecoDecay::getDaughters(particle, &arrDaughter, std::array{static_cast(pdg::Code::kJPsi)}, 1); - auto jpsiCandMC = particlesMC.rawIteratorAt(arrDaughter[0]); - if (RecoDecay::isMatchedMCGen(particlesMC, jpsiCandMC, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true)) { + auto jpsiCandMC = mcParticles.rawIteratorAt(arrDaughter[0]); + if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true)) { flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToEEGamma; } if (flag == 0) { - if (RecoDecay::isMatchedMCGen(particlesMC, jpsiCandMC, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { flag = 1 << hf_cand_chic::DecayType::ChicToJpsiToMuMuGamma; } } diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx index 402d8fac22a..985cd423f66 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx @@ -265,7 +265,7 @@ struct HfCandidateCreatorXMc { void process(aod::HfCandX const& candidates, aod::HfCand2Prong const&, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { int indexRec = -1; int pdgCodeX = pdg::Code::kX3872; @@ -292,18 +292,18 @@ struct HfCandidateCreatorXMc { // X → J/ψ π+ π- // Printf("Checking X → J/ψ π+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true); if (indexRec > -1) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kElectron, -kElectron}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kElectron, -kElectron}, true, &sign, 2); if (indexRec > -1) { flag = 1 << hf_cand_x::DecayType::XToJpsiToEEPiPi; } } if (flag == 0) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); if (indexRec > -1) { - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kMuonPlus, -kMuonPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kMuonPlus, -kMuonPlus}, true, &sign, 2); if (indexRec > -1) { flag = 1 << hf_cand_x::DecayType::XToJpsiToMuMuPiPi; } @@ -312,15 +312,15 @@ struct HfCandidateCreatorXMc { // Check whether the particle is non-prompt (from a b quark). if (flag != 0) { - auto particle = particlesMC.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchRec(flag, origin, channel); } // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; @@ -328,17 +328,17 @@ struct HfCandidateCreatorXMc { // X → J/ψ π+ π- // Printf("Checking X → J/ψ π+ π-"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdgCodeX, std::array{pdgCodeJpsi, +kPiPlus, -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeX, std::array{pdgCodeJpsi, +kPiPlus, -kPiPlus}, true)) { // Match J/psi --> e+e- std::vector arrDaughter; RecoDecay::getDaughters(particle, &arrDaughter, std::array{pdgCodeJpsi}, 1); - auto jpsiCandMC = particlesMC.rawIteratorAt(arrDaughter[0]); - if (RecoDecay::isMatchedMCGen(particlesMC, jpsiCandMC, pdgCodeJpsi, std::array{+kElectron, -kElectron}, true)) { + auto jpsiCandMC = mcParticles.rawIteratorAt(arrDaughter[0]); + if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdgCodeJpsi, std::array{+kElectron, -kElectron}, true)) { flag = 1 << hf_cand_x::DecayType::XToJpsiToEEPiPi; } if (flag == 0) { - if (RecoDecay::isMatchedMCGen(particlesMC, jpsiCandMC, pdgCodeJpsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdgCodeJpsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { flag = 1 << hf_cand_x::DecayType::XToJpsiToMuMuPiPi; } } @@ -346,7 +346,7 @@ struct HfCandidateCreatorXMc { // Check whether the particle is non-prompt (from a b quark). if (flag != 0) { - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchGen(flag, origin, channel); diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx index 0bcfabf2b06..55dbed961b4 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx @@ -76,7 +76,7 @@ struct HfCandidateSelectorChicToJpsiGamma { } auto mchic = RecoDecay::getMassPDG(20443); // chi_c1(1p) - if (TMath::Abs(invMassChicToJpsiGamma(hfCandChic) - mchic) > cuts->get(pTBin, "m")) { + if (std::abs(invMassChicToJpsiGamma(hfCandChic) - mchic) > cuts->get(pTBin, "m")) { // Printf("Chic topol selection failed at mass diff check"); return false; // check that mass difference is within bounds } @@ -93,7 +93,7 @@ struct HfCandidateSelectorChicToJpsiGamma { return false; // CPA check } - if ((TMath::Abs(hfCandChic.impactParameter0()) > cuts->get(pTBin, "d0 Jpsi"))) { // adf: Warning: no cut on photon + if ((std::abs(hfCandChic.impactParameter0()) > cuts->get(pTBin, "d0 Jpsi"))) { // adf: Warning: no cut on photon return false; // DCA check on daughters } @@ -109,7 +109,7 @@ struct HfCandidateSelectorChicToJpsiGamma { template bool validTPCPID(const T& track) { - if (TMath::Abs(track.pt()) < ptPidTpcMin || TMath::Abs(track.pt()) >= ptPidTpcMax) { + if (std::abs(track.pt()) < ptPidTpcMin || std::abs(track.pt()) >= ptPidTpcMax) { return false; } // if (track.TPCNClsFindable() < TPCNClsFindableMin) return false; @@ -123,7 +123,7 @@ struct HfCandidateSelectorChicToJpsiGamma { template bool validTofPid(const T& track) { - if (TMath::Abs(track.pt()) < ptPidTofMin || TMath::Abs(track.pt()) >= ptPidTofMax) { + if (std::abs(track.pt()) < ptPidTofMin || std::abs(track.pt()) >= ptPidTofMax) { return false; } return true; diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx index 7ddeb9fa4ea..3fd342c29b8 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx @@ -43,7 +43,7 @@ DECLARE_SOA_INDEX_TABLE_USER(RICHTracksIndex, Tracks, "RICHTRK", indices::TrackI struct HfCandidateSelectorD0Alice3BarrelRichIndexBuilder { // Builder of the RICH-track index linkage Builds indB; - void init(o2::framework::InitContext&) {} + void init(InitContext&) {} }; /// Struct for applying D0 selection cuts diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx index 57440483931..f11f75a571a 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx @@ -43,7 +43,7 @@ DECLARE_SOA_INDEX_TABLE_USER(FRICHTracksIndex, Tracks, "FRICHTRK", indices::Trac struct HfCandidateSelectorD0Alice3ForwardRichIndexBuilder { // Builder of the RICH-track index linkage Builds indF; - void init(o2::framework::InitContext&) {} + void init(InitContext&) {} }; /// Struct for applying D0 selection cuts diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx index 454a027311e..8f549a411d9 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx @@ -42,7 +42,7 @@ DECLARE_SOA_INDEX_TABLE_USER(RICHTracksIndex, Tracks, "RICHTRK", indices::TrackI struct HfCandidateSelectorD0ParametrizedPidRichIndexBuilder { // Builder of the RICH-track index linkage Builds indB; - void init(o2::framework::InitContext&) {} + void init(InitContext&) {} }; /// Struct for applying D0 selection cuts diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx index ef70929b68c..2d3514c9295 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx @@ -47,7 +47,7 @@ DECLARE_SOA_INDEX_TABLE_USER(HfTrackIndexALICE3PID, Tracks, "HFTRKIDXA3PID", //! struct HfCandidateSelectorJpsiAlice3PidIndexBuilder { Builds index; - void init(o2::framework::InitContext&) {} + void init(InitContext&) {} }; void customize(std::vector& workflowOptions) diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx index 03dc0e4dd9e..e1a2b228953 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx @@ -44,7 +44,7 @@ DECLARE_SOA_INDEX_TABLE_USER(RICHTracksIndex, Tracks, "RICHTRK", indices::TrackI struct HfCandidateSelectorLcAlice3RichIndexBuilder { // Builder of the RICH-track index linkage Builds indB; - void init(o2::framework::InitContext&) {} + void init(InitContext&) {} }; /// Struct for applying Lc selection cuts diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx index d7b09bca7f3..a4774bf423c 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx @@ -44,7 +44,7 @@ DECLARE_SOA_INDEX_TABLE_USER(RICHTracksIndex, Tracks, "RICHTRK", indices::TrackI struct HfCandidateSelectorLcParametrizedPidRichIndexBuilder { // Builder of the RICH-track index linkage Builds indB; - void init(o2::framework::InitContext&) {} + void init(InitContext&) {} }; /// Struct for applying Lc selection cuts diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx index 3b7ae7f8f6d..3413b29714a 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx @@ -83,7 +83,7 @@ struct HfCandidateSelectorXToJpsiPiPi { } // TODO: replace hardcoded mass with "RecoDecay::getMassPDG(9920443)" - if (TMath::Abs(invMassXToJpsiPiPi(hfCandX) - 3.87168) > cuts->get(pTBin, "m")) { + if (std::abs(invMassXToJpsiPiPi(hfCandX) - 3.87168) > cuts->get(pTBin, "m")) { // Printf("X topol selection failed at mass diff check"); return false; // check that mass difference is within bounds } @@ -97,9 +97,9 @@ struct HfCandidateSelectorXToJpsiPiPi { return false; // CPA check } - if ((TMath::Abs(hfCandX.impactParameter0()) > cuts->get(pTBin, "d0 Jpsi")) || - (TMath::Abs(hfCandX.impactParameter1()) > cuts->get(pTBin, "d0 Pi")) || - (TMath::Abs(hfCandX.impactParameter2()) > cuts->get(pTBin, "d0 Pi"))) { + if ((std::abs(hfCandX.impactParameter0()) > cuts->get(pTBin, "d0 Jpsi")) || + (std::abs(hfCandX.impactParameter1()) > cuts->get(pTBin, "d0 Pi")) || + (std::abs(hfCandX.impactParameter2()) > cuts->get(pTBin, "d0 Pi"))) { return false; // DCA check on daughters } @@ -115,7 +115,7 @@ struct HfCandidateSelectorXToJpsiPiPi { template bool validTPCPID(const T& track) { - if (TMath::Abs(track.pt()) < ptPidTpcMin || TMath::Abs(track.pt()) >= ptPidTpcMax) { + if (std::abs(track.pt()) < ptPidTpcMin || std::abs(track.pt()) >= ptPidTpcMax) { return false; } // if (track.TPCNClsFindable() < TPCNClsFindableMin) return false; @@ -129,7 +129,7 @@ struct HfCandidateSelectorXToJpsiPiPi { template bool validTofPid(const T& track) { - if (TMath::Abs(track.pt()) < ptPidTofMin || TMath::Abs(track.pt()) >= ptPidTofMax) { + if (std::abs(track.pt()) < ptPidTofMin || std::abs(track.pt()) >= ptPidTofMax) { return false; } return true; diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx index 2aa0923cb38..2237c15c002 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx @@ -126,7 +126,7 @@ struct HfTreeCreatorChicToJpsiGamma { } void process(aod::Collisions const& collisions, - aod::McCollisions const& mccollisions, + aod::McCollisions const& mcCollisions, soa::Join const& candidates, soa::Join const& particles, aod::Tracks const& tracks, diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx index 2b69060a306..14444dd6587 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx @@ -151,7 +151,7 @@ struct HfTreeCreatorXToJpsiPiPi { } void process(aod::Collisions const& collisions, - aod::McCollisions const& mccollisions, + aod::McCollisions const& mcCollisions, soa::Join const& candidates, soa::Join const& particles, TracksWPid const& tracks) diff --git a/PWGHF/ALICE3/Tasks/taskChic.cxx b/PWGHF/ALICE3/Tasks/taskChic.cxx index 5fd8eb6b28f..76b00488a80 100644 --- a/PWGHF/ALICE3/Tasks/taskChic.cxx +++ b/PWGHF/ALICE3/Tasks/taskChic.cxx @@ -54,7 +54,7 @@ struct HfTaskChic { {"hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, {"hPtCand", "2-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{150, 0., 15.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { registry.add("hMass", "2-prong candidates;inv. mass (J/#psi #gamma) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{200, 3., 4.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDeltaMass", "2-prong candidates;inv. mass (J/#psi #gamma) - inv. mass (J/#psi) + mass^{PDG} (J/#psi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{200, 3., 4.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -116,7 +116,7 @@ struct HfTaskChicMc { {"hPtGen", "2-prong candidates (gen. matched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{150, 0., 15.}}}}, {"hPtGenSig", "2-prong candidates (rec. matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{150, 0., 15.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { registry.add("hCPARecSig", "2-prong candidates (rec. matched);cosine of pointing angle;entries", {HistType::kTH2F, {{500, 0.9, 1.0}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCPARecBg", "2-prong candidates (rec. unmatched);cosine of pointing angle;entries", {HistType::kTH2F, {{500, 0.9, 1.0}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -151,7 +151,7 @@ struct HfTaskChicMc { } void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // MC rec. @@ -166,8 +166,8 @@ struct HfTaskChicMc { } if (candidate.flagMcMatchRec() == 1 << decayMode) { // FIXME the access to the MC particle gen not yet functional - // int indexMother = RecoDecay::getMother(particlesMC, particlesMC.rawIteratorAt(candidate.prong1().mcParticle_as().globalIndex()), 20443); - // auto particleMother = particlesMC.rawIteratorAt(indexMother); + // int indexMother = RecoDecay::getMother(mcParticles, mcParticles.rawIteratorAt(candidate.prong1().mcParticle_as().globalIndex()), 20443); + // auto particleMother = mcParticles.rawIteratorAt(indexMother); // registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), candidate.pt()); registry.fill(HIST("hCPARecSig"), candidate.cpa(), candidate.pt()); @@ -199,8 +199,8 @@ struct HfTaskChicMc { } } // rec // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (particle.flagMcMatchGen() == 1 << decayMode) { auto mchic = RecoDecay::getMassPDG(pdg::Code::kChiC1); // chi_c1(1p) if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, mchic)) > yCandMax) { diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx index a0d6f62c72d..8b5720f7c86 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx @@ -59,9 +59,9 @@ struct HfTaskD0Alice3Barrel { {"hMassSigD0PerfectPid", "2-prong candidates (matched);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{120, 1.5848, 2.1848}, {150, 0., 30.}, {8, 0., 4.}}}}, {"hMassBkgD0PerfectPid", "2-prong candidates (checked);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{120, 1.5848, 2.1848}, {150, 0., 30.}, {8, 0., 4.}}}}}}; - // void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join const& particlesMc, aod::TracksWMc const& tracks) + // void process(soa::Join::iterator const& collision, soa::Filtered> const& candidates, soa::Join const& mcParticles, aod::TracksWMc const& tracks) void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // float centrality = collision.centV0M(); @@ -139,7 +139,7 @@ struct HfTaskD0Alice3Barrel { } } - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::D0ToPiK) { if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > 4.0) { continue; diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx index 542843196db..ee5edb9ce17 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx @@ -41,7 +41,7 @@ struct HfTaskD0Alice3Forward { {"hMassBkgD0ForwardRICHPID", "2-prong candidates (checked);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{120, 1.5848, 2.1848}, {150, 0., 30.}, {8, 0., 4.}}}}}}; void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { for (const auto& candidate : candidates) { @@ -67,7 +67,7 @@ struct HfTaskD0Alice3Forward { } } - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::D0ToPiK) { if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > 4.0) { continue; diff --git a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx index 94e97c2033b..a0a7cb526b0 100644 --- a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx @@ -58,9 +58,9 @@ struct HfTaskD0ParametrizedPid { {"hMassBkgD0PerfectPid", "2-prong candidates (checked);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{120, 1.5848, 2.1848}, {150, 0., 30.}, {8, 0., 4.}}}}}}; void process(soa::Filtered> const& candidates, - McParticlesHf const& particlesMC, + McParticlesHf const& mcParticles, aod::TracksWMc const& tracks) - // void process(const o2::aod::Collision& collision, soa::Filtered> const& candidates, soa::Join const& particlesMc, aod::TracksWMc const& tracks) + // void process(const o2::aod::Collision& collision, soa::Filtered> const& candidates, soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // float ncontributor = collision.numContrib(); for (const auto& candidate : candidates) { @@ -110,7 +110,7 @@ struct HfTaskD0ParametrizedPid { } } - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // if (ncontributor<=centralitySelectionMin && ncontributor>centralitySelectionMax) { // continue; // } diff --git a/PWGHF/ALICE3/Tasks/taskJpsi.cxx b/PWGHF/ALICE3/Tasks/taskJpsi.cxx index 276df4484e3..6090172e8de 100644 --- a/PWGHF/ALICE3/Tasks/taskJpsi.cxx +++ b/PWGHF/ALICE3/Tasks/taskJpsi.cxx @@ -55,7 +55,7 @@ struct HfTaskJpsi { {"hPtProng0", "2-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 20.}}}}, {"hPtProng1", "2-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 20.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { if (modeJpsiToMuMu) { registry.add("hMass", "2-prong candidates;inv. mass (#mu^{#plus} #mu^{#minus}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{200, 2., 4.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -160,7 +160,7 @@ struct HfTaskJpsiMc { {"hEtaRecBg", "2-prong candidates (rec. unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, {"hEtaGen", "2-prong candidates (gen. matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { if (modeJpsiToMuMu) { registry.add("hMassSig", "2-prong candidates (rec matched);inv. mass (#mu^{#plus} #mu^{#minus}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{200, 2., 4.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -192,7 +192,7 @@ struct HfTaskJpsiMc { } void process(soa::Filtered> const& candidates, - McParticlesHf const& particlesMC, + McParticlesHf const& mcParticles, aod::TracksWMc const& tracks) { // MC rec. @@ -233,8 +233,8 @@ struct HfTaskJpsiMc { } if (candidate.flagMcMatchRec() == 1 << decayMode) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong0_as().mcParticle_as(), pdg::Code::kJPsi, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as(), pdg::Code::kJPsi, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT registry.fill(HIST("hPtRecSig"), candidate.pt()); // rec. level pT registry.fill(HIST("hCPARecSig"), candidate.cpa()); @@ -274,8 +274,8 @@ struct HfTaskJpsiMc { } } // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (particle.flagMcMatchGen() == 1 << decayMode) { if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > yCandMax) { continue; diff --git a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx index caf042846f2..7aa14c49038 100644 --- a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx @@ -50,7 +50,7 @@ struct HfTaskLcAlice3 { {"hMassBkgLcPerfectPid", "3-prong candidates (checked);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{500, 1.6, 3.1}, {150, 0., 30.}, {8, 0., 4.}}}}}}; void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { for (const auto& candidate : candidates) { @@ -135,7 +135,7 @@ struct HfTaskLcAlice3 { } } - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::LcToPKPi) { if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > 4.0) { continue; diff --git a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx index 108f1bf19bf..060e046dc79 100644 --- a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx @@ -47,7 +47,7 @@ struct HfTaskLcParametrizedPid { {"hMassBkgLcPerfectPid", "3-prong candidates (checked);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{500, 1.6, 3.1}, {150, 0., 30.}, {8, 0., 4.}}}}}}; void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { for (const auto& candidate : candidates) { @@ -115,7 +115,7 @@ struct HfTaskLcParametrizedPid { } } - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::LcToPKPi) { if (std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > 4.0) { continue; diff --git a/PWGHF/ALICE3/Tasks/taskX.cxx b/PWGHF/ALICE3/Tasks/taskX.cxx index 9866d70e330..f44400d0af7 100644 --- a/PWGHF/ALICE3/Tasks/taskX.cxx +++ b/PWGHF/ALICE3/Tasks/taskX.cxx @@ -56,7 +56,7 @@ struct HfTaskX { {"hPtProng2", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, {"hPtCand", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{150, 0., 15.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { registry.add("hMass", "3-prong candidates;inv. mass (J/#psi #pi+ #pi-) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{200, 3., 4.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDecLength", "3-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{100, 0., 0.01}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -117,7 +117,7 @@ struct HfTaskXMc { {"hPtGen", "3-prong candidates (gen. matched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{150, 0., 15.}}}}, {"hPtGenSig", "3-prong candidates (rec. matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{150, 0., 15.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { registry.add("hCPARecSig", "3-prong candidates (rec. matched);cosine of pointing angle;entries", {HistType::kTH2F, {{500, 0.9, 1.0}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCPARecBg", "3-prong candidates (rec. unmatched);cosine of pointing angle;entries", {HistType::kTH2F, {{500, 0.9, 1.0}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -155,7 +155,7 @@ struct HfTaskXMc { } void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // MC rec. @@ -169,8 +169,8 @@ struct HfTaskXMc { continue; } if (candidate.flagMcMatchRec() == 1 << decayMode) { - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong1_as().mcParticle_as>(), 9920443, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), 9920443, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), candidate.pt()); registry.fill(HIST("hCPARecSig"), candidate.cpa(), candidate.pt()); @@ -206,8 +206,8 @@ struct HfTaskXMc { } } // rec // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (particle.flagMcMatchGen() == 1 << decayMode) { // TODO: add X(3872) mass such that we can use the getMassPDG function instead of hardcoded mass if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, 3.87168)) > yCandMax) { diff --git a/PWGHF/D2H/Macros/HFInvMassFitter.h b/PWGHF/D2H/Macros/HFInvMassFitter.h index 07dbca26971..6ac9357c5c2 100644 --- a/PWGHF/D2H/Macros/HFInvMassFitter.h +++ b/PWGHF/D2H/Macros/HFInvMassFitter.h @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/PWGHF/D2H/Macros/runMassFitter.C b/PWGHF/D2H/Macros/runMassFitter.C index 8985854fe60..0c4c44f9ff7 100644 --- a/PWGHF/D2H/Macros/runMassFitter.C +++ b/PWGHF/D2H/Macros/runMassFitter.C @@ -540,7 +540,7 @@ int runMassFitter(TString configFileName) hRawYieldsSignificance->SetBinContent(iPt + 1, significance); hRawYieldsSignificance->SetBinError(iPt + 1, significanceErr); hRawYieldsSgnOverBkg->SetBinContent(iPt + 1, rawYield / bkg); - hRawYieldsSgnOverBkg->SetBinError(iPt + 1, rawYield / bkg * TMath::Sqrt(rawYieldErr / rawYield * rawYieldErr / rawYield + bkgErr / bkg * bkgErr / bkg)); + hRawYieldsSgnOverBkg->SetBinError(iPt + 1, rawYield / bkg * std::sqrt(rawYieldErr / rawYield * rawYieldErr / rawYield + bkgErr / bkg * bkgErr / bkg)); hRawYieldsSignal->SetBinContent(iPt + 1, rawYield); hRawYieldsSignal->SetBinError(iPt + 1, rawYieldErr); hRawYieldsBkg->SetBinContent(iPt + 1, bkg); diff --git a/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx index d7c18ec6fc2..3032181b3a8 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx @@ -377,7 +377,7 @@ struct HfDataCreatorD0PiReducedMc { void processMc(aod::HfCand2ProngReduced const& candsD0, aod::HfTracksReduced const& tracksPion, aod::TracksWMc const&, - aod::McParticles const& particlesMc) + aod::McParticles const& mcParticles) { int indexRec = -1; int8_t sign = 0; @@ -398,35 +398,35 @@ struct HfDataCreatorD0PiReducedMc { trackPion.track_as()}; // B+ → D0(bar) π+ → (K+ π-) π+ // Printf("Checking B+ → D0bar π+"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersBplus, pdg::Code::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBplus, pdg::Code::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { // D0bar → K+ π- // Printf("Checking D0bar → K+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD0, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD0, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1); if (indexRec > -1) { flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi); } else { LOGF(info, "WARNING: B+ decays in the expected final state but the condition on the intermediate state is not fulfilled"); } } - auto indexMother = RecoDecay::getMother(particlesMc, trackPion.track_as().mcParticle_as(), pdg::Code::kBPlus, true); - auto particleMother = particlesMc.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, trackPion.track_as().mcParticle_as(), pdg::Code::kBPlus, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); rowHfD0PiMcRecReduced(candD0.globalIndex(), trackPion.globalIndex(), flag, origin, particleMother.pt()); } } // rec // Match generated particles. - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; // B+ → D0bar π+ - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kBPlus, std::array{static_cast(pdg::Code::kD0), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kBPlus, std::array{static_cast(pdg::Code::kD0), +kPiPlus}, true)) { // Match D0bar -> π- K+ - auto candD0MC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); + auto candD0MC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking D0bar -> π- K+"); - if (RecoDecay::isMatchedMCGen(particlesMc, candD0MC, static_cast(pdg::Code::kD0), std::array{+kPiPlus, -kKPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, candD0MC, static_cast(pdg::Code::kD0), std::array{+kPiPlus, -kKPlus}, true, &sign)) { flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi); } } diff --git a/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx index c110de26e43..77ef4798395 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx @@ -382,7 +382,7 @@ struct HfDataCreatorDplusPiReducedMc { void processMc(aod::HfCand3ProngReduced const& candsD, aod::HfTracksReduced const& tracksPion, aod::TracksWMc const&, - aod::McParticles const& particlesMc) + aod::McParticles const& mcParticles) { int indexRec = -1; int8_t sign = 0; @@ -406,11 +406,11 @@ struct HfDataCreatorDplusPiReducedMc { trackPion.track_as()}; // B0 → D- π+ → (π- K+ π-) π+ // Printf("Checking B0 → D- π+"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersB0, pdg::Code::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, pdg::Code::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { // D- → π- K+ π- // Printf("Checking D- → π- K+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD, pdg::Code::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, pdg::Code::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi); } else { @@ -418,24 +418,24 @@ struct HfDataCreatorDplusPiReducedMc { LOGF(info, "WARNING: B0 decays in the expected final state but the condition on the intermediate state is not fulfilled"); } } - auto indexMother = RecoDecay::getMother(particlesMc, trackPion.track_as().mcParticle_as(), pdg::Code::kB0, true); - auto particleMother = particlesMc.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, trackPion.track_as().mcParticle_as(), pdg::Code::kB0, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); rowHfDPiMcRecReduced(candD.globalIndex(), trackPion.globalIndex(), flag, origin, debug, particleMother.pt()); } } // rec // Match generated particles. - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; // B0 → D- π+ - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kB0, std::array{-static_cast(pdg::Code::kDPlus), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kB0, std::array{-static_cast(pdg::Code::kDPlus), +kPiPlus}, true)) { // Match D- -> π- K+ π- - auto candDMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); + auto candDMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking D- -> π- K+ π-"); - if (RecoDecay::isMatchedMCGen(particlesMc, candDMC, -static_cast(pdg::Code::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, candDMC, -static_cast(pdg::Code::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi); } } diff --git a/PWGHF/D2H/Tasks/taskB0.cxx b/PWGHF/D2H/Tasks/taskB0.cxx index 05555d64948..446478edf01 100644 --- a/PWGHF/D2H/Tasks/taskB0.cxx +++ b/PWGHF/D2H/Tasks/taskB0.cxx @@ -188,7 +188,7 @@ struct HfTaskB0 { /// B0 MC analysis and fill histograms void processMc(soa::Filtered> const& candidates, - soa::Join const& particlesMc, + soa::Join const& mcParticles, aod::TracksWMc const&, soa::Join const&) { @@ -207,8 +207,8 @@ struct HfTaskB0 { int flagMcMatchRecB0 = std::abs(candidate.flagMcMatchRec()); if (TESTBIT(flagMcMatchRecB0, hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi)) { - auto indexMother = RecoDecay::getMother(particlesMc, candidate.prong1_as().mcParticle_as>(), pdg::Code::kB0, true); - auto particleMother = particlesMc.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kB0, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), ptCandB0); @@ -264,8 +264,8 @@ struct HfTaskB0 { } // rec // MC gen. level - // Printf("MC Particles: %d", particlesMc.size()); - for (const auto& particle : particlesMc) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_b0::DecayType::B0ToDPi)) { auto ptParticle = particle.pt(); diff --git a/PWGHF/D2H/Tasks/taskB0Reduced.cxx b/PWGHF/D2H/Tasks/taskB0Reduced.cxx index 32793b59182..1b4fa92865d 100644 --- a/PWGHF/D2H/Tasks/taskB0Reduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0Reduced.cxx @@ -47,7 +47,7 @@ struct HfTaskB0Reduced { {"hPtProng1", "B0 candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{200, 0., 10.}}}}, {"hPtCand", "B0 candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { registry.add("hMass", "B^{0} candidates;inv. mass D^{#minus}#pi^{#plus} (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{300, 4.5, 6.0}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hDecLength", "B^{0} candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -162,7 +162,7 @@ struct HfTaskB0Reduced { /// B0 MC analysis and fill histograms void processMc(soa::Join const& candidates, - aod::HfB0McGenReduced const& particlesMc, + aod::HfB0McGenReduced const& mcParticles, aod::HfCand3ProngReduced const&) { // MC rec @@ -218,8 +218,8 @@ struct HfTaskB0Reduced { } // rec // MC gen. level - // Printf("MC Particles: %d", particlesMc.size()); - for (const auto& particle : particlesMc) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { auto ptParticle = particle.ptTrack(); auto yParticle = particle.yTrack(); auto etaParticle = particle.etaTrack(); diff --git a/PWGHF/D2H/Tasks/taskBplus.cxx b/PWGHF/D2H/Tasks/taskBplus.cxx index 55db5d575d5..8d5ea3c20d3 100644 --- a/PWGHF/D2H/Tasks/taskBplus.cxx +++ b/PWGHF/D2H/Tasks/taskBplus.cxx @@ -66,7 +66,7 @@ struct HfTaskBplus { {"hPtGenSig", bPlusCandMatch + "candidate #it{p}_{T}^{gen.} (GeV/#it{c});" + entries, {HistType::kTH1F, {{300, 0., 30.}}}}, {"hPtGen", mcParticleMatched + "candidate #it{p}_{T} (GeV/#it{c});" + entries, {HistType::kTH1F, {{300, 0., 30.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { const AxisSpec axisMass{150, 4.5, 6.0}; const AxisSpec axisCPA{120, -1.1, 1.1}; @@ -198,7 +198,7 @@ struct HfTaskBplus { } // process void processMc(soa::Join const&, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks, aod::HfCand2Prong const&) { @@ -214,8 +214,8 @@ struct HfTaskBplus { // auto candD0 = candidate.prong0_as(); if (TESTBIT(std::abs(candidate.flagMcMatchRec()), hf_cand_bplus::DecayType::BplusToD0Pi)) { - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong1_as().mcParticle_as>(), pdg::Code::kBPlus, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kBPlus, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), ptCandBplus); registry.fill(HIST("hCPARecSig"), candidate.cpa(), ptCandBplus); @@ -254,8 +254,8 @@ struct HfTaskBplus { } // rec // MC gen. level - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_bplus::DecayType::BplusToD0Pi)) { auto ptParticle = particle.pt(); diff --git a/PWGHF/D2H/Tasks/taskBplusReduced.cxx b/PWGHF/D2H/Tasks/taskBplusReduced.cxx index 91462e6e22c..333e98155a9 100644 --- a/PWGHF/D2H/Tasks/taskBplusReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusReduced.cxx @@ -61,7 +61,7 @@ struct HfTaskBplusReduced { {"hPtGenSig", bPlusCandMatch + "candidate #it{p}_{T}^{gen.} (GeV/#it{c});" + entries, {HistType::kTH1F, {{300, 0., 30.}}}}, {"hPtGen", mcParticleMatched + "candidate #it{p}_{T} (GeV/#it{c});" + entries, {HistType::kTH1F, {{300, 0., 30.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { const AxisSpec axisMass{150, 4.5, 6.0}; const AxisSpec axisCPA{120, -1.1, 1.1}; @@ -197,7 +197,7 @@ struct HfTaskBplusReduced { /// B+ MC analysis and fill histograms void processMc(soa::Join const& candidates, - aod::HfBpMcGenReduced const& particlesMc, + aod::HfBpMcGenReduced const& mcParticles, aod::HfCand2ProngReduced const&) { // MC rec @@ -256,8 +256,8 @@ struct HfTaskBplusReduced { } // rec // MC gen. level - // Printf("MC Particles: %d", particlesMc.size()); - for (const auto& particle : particlesMc) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { auto ptParticle = particle.ptTrack(); auto yParticle = particle.yTrack(); auto etaParticle = particle.etaTrack(); diff --git a/PWGHF/D2H/Tasks/taskBs.cxx b/PWGHF/D2H/Tasks/taskBs.cxx index b91e420746c..8df6ef7c92d 100644 --- a/PWGHF/D2H/Tasks/taskBs.cxx +++ b/PWGHF/D2H/Tasks/taskBs.cxx @@ -186,7 +186,7 @@ struct HfTaskBs { /// Bs MC analysis and fill histograms void processMc(soa::Filtered> const& candidates, - soa::Join const& particlesMc, + soa::Join const& mcParticles, aod::TracksWMc const&, soa::Join const&) { @@ -205,8 +205,8 @@ struct HfTaskBs { int flagMcMatchRecBs = std::abs(candidate.flagMcMatchRec()); if (TESTBIT(flagMcMatchRecBs, hf_cand_bs::DecayTypeMc::BsToDsPiToKKPiPi)) { - auto indexMother = RecoDecay::getMother(particlesMc, candidate.prong1_as().mcParticle_as>(), pdg::Code::kBS, true); - auto particleMother = particlesMc.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kBS, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), ptCandBs); @@ -262,7 +262,7 @@ struct HfTaskBs { } // rec // MC gen. level - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_bs::DecayTypeMc::BsToDsPiToKKPiPi)) { auto ptParticle = particle.pt(); diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index 84e8b0b36c7..90c3d33d371 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -119,7 +119,7 @@ struct HfTaskD0 { {"hMassReflBkgD0bar", "2-prong candidates (matched);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{120, 1.5848, 2.1848}, {150, 0., 30.}, {20, -5., 5.}}}}, {"hMassSigBkgD0bar", "2-prong candidates (not checked);#it{m}_{inv} (GeV/#it{c}^{2}); #it{p}_{T}; #it{y}", {HistType::kTH3F, {{120, 1.5848, 2.1848}, {150, 0., 30.}, {20, -5., 5.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -217,7 +217,7 @@ struct HfTaskD0 { } void processMc(soa::Join const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // MC rec. @@ -233,8 +233,8 @@ struct HfTaskD0 { auto massD0bar = invMassD0barToKPi(candidate); if (std::abs(candidate.flagMcMatchRec()) == 1 << DecayType::D0ToPiK) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong0_as().mcParticle_as>(), pdg::Code::kD0, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), pdg::Code::kD0, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); auto ptGen = particleMother.pt(); // gen. level pT auto yGen = RecoDecay::y(std::array{particleMother.px(), particleMother.py(), particleMother.pz()}, RecoDecay::getMassPDG(particleMother.pdgCode())); // gen. level y registry.fill(HIST("hPtGenSig"), ptGen); // gen. level pT @@ -380,8 +380,8 @@ struct HfTaskD0 { } } // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::D0ToPiK) { if (yCandGenMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > yCandGenMax) { continue; diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index 592705080c6..d680b12a271 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -50,7 +50,7 @@ struct HfTaskDplus { {"hEtaRecBg", "3-prong candidates (unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, {"hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMass", "3-prong candidates;inv. mass (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{350, 1.7, 2.05}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -129,7 +129,7 @@ struct HfTaskDplus { } void processMc(soa::Join const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // MC rec. @@ -144,8 +144,8 @@ struct HfTaskDplus { } if (std::abs(candidate.flagMcMatchRec()) == 1 << DecayType::DplusToPiKPi) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong0_as().mcParticle_as>(), pdg::Code::kDPlus, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), pdg::Code::kDPlus, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT auto ptRec = candidate.pt(); auto yRec = yDplus(candidate); @@ -191,8 +191,8 @@ struct HfTaskDplus { } } // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::DplusToPiKPi) { auto ptGen = particle.pt(); auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())); diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index 628b8910908..95c9cc5a1f7 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -36,17 +36,17 @@ struct HfTaskDs { Configurable yCandRecoMax{"yCandRecoMax", 0.8, "max. cand. rapidity"}; Configurable> binsPt{"binsPt", std::vector{hf_cuts_ds_to_k_k_pi::vecBinsPt}, "pT bin limits"}; - using candDsData = soa::Filtered>; - using candDsMcReco = soa::Filtered>; - using candDsMcGen = soa::Join; + using CandDsData = soa::Filtered>; + using CandDsMcReco = soa::Filtered>; + using CandDsMcGen = soa::Join; Filter filterDsFlag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DsToKKPi))) != static_cast(0); - Partition selectedDsToKKPiCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs; - Partition selectedDsToPiKKCand = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; + Partition selectedDsToKKPiCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs; + Partition selectedDsToPiKKCand = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel; - Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(DecayType::DsToKKPi)); + Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel; + Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(DecayType::DsToKKPi)); HistogramRegistry registry{ "registry", @@ -60,7 +60,7 @@ struct HfTaskDs { {"hEtaRecBkg", "3-prong candidates (unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, {"hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; AxisSpec ybins = {100, -5., 5, "#it{y}"}; @@ -210,7 +210,7 @@ struct HfTaskDs { return; } - void process(candDsData const& candidates) + void process(CandDsData const& candidates) { for (const auto& candidate : selectedDsToKKPiCand) { if (yCandRecoMax >= 0. && std::abs(yDs(candidate)) > yCandRecoMax) { @@ -229,8 +229,8 @@ struct HfTaskDs { } } - void processMc(candDsMcReco const& candidates, - candDsMcGen const& particlesMC, + void processMc(CandDsMcReco const& candidates, + CandDsMcGen const& mcParticles, aod::TracksWMc const&) { // MC rec. @@ -239,9 +239,9 @@ struct HfTaskDs { continue; } - auto prong0McPart = candidate.prong0_as().mcParticle_as(); - auto indexMother = RecoDecay::getMother(particlesMC, prong0McPart, pdg::Code::kDS, true); - auto particleMother = particlesMC.iteratorAt(indexMother); + auto prong0McPart = candidate.prong0_as().mcParticle_as(); + auto indexMother = RecoDecay::getMother(mcParticles, prong0McPart, pdg::Code::kDS, true); + auto particleMother = mcParticles.iteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT // KKPi @@ -267,7 +267,7 @@ struct HfTaskDs { // TODO: add histograms for reflections // MC gen. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::DsToKKPi) { if (particle.flagMcDecayChanGen() != decayChannel) { continue; diff --git a/PWGHF/D2H/Tasks/taskLb.cxx b/PWGHF/D2H/Tasks/taskLb.cxx index d91ded32af8..79722c9b450 100644 --- a/PWGHF/D2H/Tasks/taskLb.cxx +++ b/PWGHF/D2H/Tasks/taskLb.cxx @@ -57,7 +57,7 @@ struct HfTaskLb { {"hPtCand", "Lb candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{1000, 0., 50.}}}}, {"hCentrality", "centrality;centrality percentile;entries", {HistType::kTH1F, {{100, 0., 100.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { registry.add("hMass", "#Lambda_{b}^{0} candidates;inv. mass #Lambda_{c}^{#plus}#pi^{#minus} (GeV/#it{c}^{2});#it{p}_{T} (GeV/#it{c}); centrality", {HistType::kTH3F, {{500, 0., 10.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}, {100, 0., 100.}}}); registry.add("hDecLength", "#Lambda_{b}^{0} candidates;decay length (cm);entries", {HistType::kTH2F, {{200, 0., 0.4}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -132,7 +132,7 @@ struct HfTaskLbMc { {"hPtGenSig", "Lb candidates (matched);candidate #it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 10.}}}}, {"hPtGen", "MC particles (matched);candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { registry.add("hEtaGen", "MC particles (matched);#Lambda_{b}^{0} candidate #it{#eta}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hYGen", "MC particles (matched);#Lambda_{b}^{0} candidate #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -181,7 +181,7 @@ struct HfTaskLbMc { } void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks, aod::HfCand3Prong const&) { @@ -197,8 +197,8 @@ struct HfTaskLbMc { auto candLc = candidate.prong0_as(); if (std::abs(candidate.flagMcMatchRec()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong1_as().mcParticle_as>(), pdg::Code::kLambdaB0, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), pdg::Code::kLambdaB0, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); registry.fill(HIST("hPtRecSig"), candidate.pt()); registry.fill(HIST("hCPARecSig"), candidate.cpa(), candidate.pt()); @@ -241,8 +241,8 @@ struct HfTaskLbMc { } // rec // MC gen. level - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << hf_cand_lb::DecayType::LbToLcPi) { auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(pdg::Code::kLambdaB0)); diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 81d4542216f..06acb0b5d4e 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -131,7 +131,7 @@ struct HfTaskLc { {"MC/generated/prompt/hPhiGenPrompt", "MC particles (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}, {"MC/generated/nonprompt/hPhiGenNonPrompt", "MC particles (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; /// mass candidate @@ -235,7 +235,7 @@ struct HfTaskLc { } void process(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Filtered> const& candidates) { int nTracks = 0; @@ -307,7 +307,7 @@ struct HfTaskLc { /// Fills MC histograms. void processMc(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const&) { for (const auto& candidate : candidates) { @@ -324,8 +324,8 @@ struct HfTaskLc { // Get the corresponding MC particle. auto mcParticleProng0 = candidate.prong0_as().mcParticle_as>(); auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); - auto indexMother = RecoDecay::getMother(particlesMC, mcParticleProng0, pdg::Code::kLambdaCPlus, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, mcParticleProng0, pdg::Code::kLambdaCPlus, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("MC/generated/signal/hPtGenSig"), particleMother.pt()); // gen. level pT auto pt = candidate.pt(); /// MC reconstructed signal @@ -452,8 +452,8 @@ struct HfTaskLc { } } // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::LcToPKPi) { auto yGen = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())); if (yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) { diff --git a/PWGHF/D2H/Tasks/taskLcToK0sP.cxx b/PWGHF/D2H/Tasks/taskLcToK0sP.cxx index af2f6255f39..1dab01cdee2 100644 --- a/PWGHF/D2H/Tasks/taskLcToK0sP.cxx +++ b/PWGHF/D2H/Tasks/taskLcToK0sP.cxx @@ -351,7 +351,7 @@ struct HfTaskLcToK0sP { } void processMc(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks, TracksWPid const&) { @@ -515,8 +515,8 @@ struct HfTaskLcToK0sP { } } // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (etaCandMax >= 0. && std::abs(particle.eta()) > etaCandMax) { // Printf("MC Gen.: eta rejection: %g", particle.eta()); continue; diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index 9ece91b7e31..2ec3096ad78 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -350,18 +350,18 @@ struct HfTaskSigmac { /// @brief process function to fill the histograms needed in analysis (MC) /// @param candidatesSc are the reconstructed candidate Σc0,++ with MC info - /// @param particlesMc are the generated particles with flags wheter they are Σc0,++ or not + /// @param mcParticles are the generated particles with flags wheter they are Σc0,++ or not /// @param void processMc(soa::Join const& candidatesSc, - aod::McParticles const& particlesMc, - soa::Join const& particlesMcSc, - soa::Join const& particlesMcLc, + aod::McParticles const& mcParticles, + soa::Join const& mcParticlesSc, + soa::Join const& mcParticlesLc, soa::Join const&, aod::TracksWMc const&) { /// MC generated particles - for (const auto& particle : particlesMcSc) { + for (const auto& particle : mcParticlesSc) { /// reject immediately particles different from Σc0,++ bool isSc0Gen = (std::abs(particle.flagMcMatchGen()) == (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi)); @@ -401,8 +401,8 @@ struct HfTaskSigmac { int8_t channel = -1; if (std::abs(arrayDaughtersIds[0]) == pdg::Code::kLambdaCPlus) { /// daughter 0 is the Λc+, daughter 1 the soft π - auto daugLc = particlesMcLc.rawIteratorAt(arrayDaughtersIds[0]); - auto daugSoftPi = particlesMc.rawIteratorAt(arrayDaughtersIds[1]); + auto daugLc = mcParticlesLc.rawIteratorAt(arrayDaughtersIds[0]); + auto daugSoftPi = mcParticles.rawIteratorAt(arrayDaughtersIds[1]); ptGenLc = daugLc.pt(); etaGenLc = daugLc.eta(); phiGenLc = daugLc.phi(); @@ -413,8 +413,8 @@ struct HfTaskSigmac { phiGenSoftPi = daugSoftPi.phi(); } else if (std::abs(arrayDaughtersIds[0]) == kPiPlus) { /// daughter 0 is the soft π, daughter 1 the Λc+ - auto daugLc = particlesMcLc.rawIteratorAt(arrayDaughtersIds[1]); - auto daugSoftPi = particlesMc.rawIteratorAt(arrayDaughtersIds[0]); + auto daugLc = mcParticlesLc.rawIteratorAt(arrayDaughtersIds[1]); + auto daugSoftPi = mcParticles.rawIteratorAt(arrayDaughtersIds[0]); ptGenLc = daugLc.pt(); etaGenLc = daugLc.eta(); phiGenLc = daugLc.phi(); @@ -497,13 +497,13 @@ struct HfTaskSigmac { /// Reconstructed Σc0 signal if (std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi && (chargeSc == 0)) { // Get the corresponding MC particle for Sc, found as the mother of the soft pion - auto indexMcScRec = RecoDecay::getMother(particlesMc, candSc.prong1_as().mcParticle(), pdg::Code::kSigmaC0, true); - auto particleSc = particlesMc.rawIteratorAt(indexMcScRec); + auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), pdg::Code::kSigmaC0, true); + auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.prong0_as(), candidateLc.prong1_as(), candidateLc.prong2_as()}; int8_t sign = 0; - int indexMcLcRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); - auto particleLc = particlesMc.rawIteratorAt(indexMcLcRec); + int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + auto particleLc = mcParticles.rawIteratorAt(indexMcLcRec); // Get the corresponding MC particle for soft pion auto particleSoftPi = candSc.prong1_as().mcParticle(); @@ -616,13 +616,13 @@ struct HfTaskSigmac { } else if (std::abs(candSc.flagMcMatchRec()) == 1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi && (std::abs(chargeSc) == 2)) { /// Reconstructed Σc++ signal // Get the corresponding MC particle for Sc, found as the mother of the soft pion - auto indexMcScRec = RecoDecay::getMother(particlesMc, candSc.prong1_as().mcParticle(), pdg::Code::kSigmaCPlusPlus, true); - auto particleSc = particlesMc.rawIteratorAt(indexMcScRec); + auto indexMcScRec = RecoDecay::getMother(mcParticles, candSc.prong1_as().mcParticle(), pdg::Code::kSigmaCPlusPlus, true); + auto particleSc = mcParticles.rawIteratorAt(indexMcScRec); // Get the corresponding MC particle for Lc auto arrayDaughtersLc = std::array{candidateLc.prong0_as(), candidateLc.prong1_as(), candidateLc.prong2_as()}; int8_t sign = 0; - int indexMcLcRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); - auto particleLc = particlesMc.rawIteratorAt(indexMcLcRec); + int indexMcLcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + auto particleLc = mcParticles.rawIteratorAt(indexMcLcRec); // Get the corresponding MC particle for soft pion auto particleSoftPi = candSc.prong1_as().mcParticle(); diff --git a/PWGHF/D2H/Tasks/taskXic.cxx b/PWGHF/D2H/Tasks/taskXic.cxx index 437b108453e..166211bcd56 100644 --- a/PWGHF/D2H/Tasks/taskXic.cxx +++ b/PWGHF/D2H/Tasks/taskXic.cxx @@ -46,7 +46,7 @@ struct HfTaskXic { float etaMaxAcceptance = 0.8; float ptMinAcceptance = 0.1; - using TracksWPid = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToPKPi >= selectionFlagXic || aod::hf_sel_candidate_xic::isSelXicToPiKP >= selectionFlagXic); @@ -72,9 +72,8 @@ struct HfTaskXic { }}; - void init(o2::framework::InitContext&) + void init(InitContext&) { - AxisSpec axisPPid = {100, 0.f, 10.0f, "#it{p} (GeV/#it{c})"}; AxisSpec axisNSigmaPr = {100, -6.f, 6.f, "n#it{#sigma}_{p}"}; AxisSpec axisNSigmaPi = {100, -6.f, 6.f, "n#it{#sigma}_{#pi}"}; @@ -185,7 +184,7 @@ struct HfTaskXic { } void process(aod::Collision const& collision, - soa::Join const& tracks, + TracksWPid const& tracks, soa::Filtered> const& candidates) { int nTracks = 0; @@ -283,7 +282,7 @@ struct HfTaskXic { } // Fill MC histograms void processMc(soa::Filtered> const& candidates, - soa::Join const& particlesMC) + soa::Join const& mcParticles) { // MC rec. @@ -366,7 +365,7 @@ struct HfTaskXic { } } // MC gen. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::XicToPKPi) { auto yParticle = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { @@ -397,7 +396,6 @@ struct HfTaskXic { } } } - PROCESS_SWITCH(HfTaskXic, processMc, "Process MC", false); }; diff --git a/PWGHF/D2H/Tasks/taskXicc.cxx b/PWGHF/D2H/Tasks/taskXicc.cxx index 87fee54d888..fc7f52890b5 100644 --- a/PWGHF/D2H/Tasks/taskXicc.cxx +++ b/PWGHF/D2H/Tasks/taskXicc.cxx @@ -50,7 +50,7 @@ struct HfTaskXicc { {"hPtProng0", "#Xi^{++}_{cc}-candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, {"hPtProng1", "#Xi^{++}_{cc}-candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMass", "#Xi^{++}_{cc} candidates;inv. mass (p K #pi #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{400, 3.2, 4.0}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -121,7 +121,7 @@ struct HfTaskXiccMc { {"hYGen", "#Xi^{++}_{cc} MC particles (matched);#it{y};entries", {HistType::kTH1F, {{250, -5., 5.}}}}, {"hPtvsEtavsYGen", "#Xi^{++}_{cc} MC particles (matched);#it{p}_{T} (GeV/#it{c});#it{#eta};#it{y}", {HistType::kTH3F, {{360, 0., 36.}, {250, -5., 5.}, {20, -5., 5.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMassVsPtRecSig", "#Xi^{++}_{cc} (rec. matched) candidates;inv. mass (p K #pi #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{400, 3.2, 4.0}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -173,7 +173,7 @@ struct HfTaskXiccMc { } void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // MC rec. @@ -187,14 +187,14 @@ struct HfTaskXiccMc { } if (std::abs(candidate.flagMcMatchRec()) == 1 << DecayType::XiccToXicPi) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong1_as().mcParticle_as>(), 4422, true); - auto particleXicc = particlesMC.rawIteratorAt(indexMother); - auto particleXic = particlesMC.rawIteratorAt(particleXicc.daughtersIds().front()); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as().mcParticle_as>(), 4422, true); + auto particleXicc = mcParticles.rawIteratorAt(indexMother); + auto particleXic = mcParticles.rawIteratorAt(particleXicc.daughtersIds().front()); /* - auto daughter1 = particlesMC.rawIteratorAt(particleXicc.daughtersIds().back()); - auto p0xic = particlesMC.rawIteratorAt(particleXic.daughtersIds().front()); - auto p1xic = particlesMC.rawIteratorAt(particleXic.daughtersIds().front()+1); - auto p2xic = particlesMC.rawIteratorAt(particleXic.daughterIds().back()); + auto daughter1 = mcParticles.rawIteratorAt(particleXicc.daughtersIds().back()); + auto p0xic = mcParticles.rawIteratorAt(particleXic.daughtersIds().front()); + auto p1xic = mcParticles.rawIteratorAt(particleXic.daughtersIds().front()+1); + auto p2xic = mcParticles.rawIteratorAt(particleXic.daughterIds().back()); LOGF(info, "mother pdg %d", particleXicc.pdgCode()); LOGF(info, "Xic pdg %d", particleXic.pdgCode()); LOGF(info, "Xic prong 0 pdg %d", p0xic.pdgCode()); @@ -258,8 +258,8 @@ struct HfTaskXiccMc { } } // end of loop over reconstructed candidates // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::XiccToXicPi) { if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > yCandMax) { continue; diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx index 3354c39fbaa..feaea447aae 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx @@ -116,7 +116,7 @@ struct HfCorrelatorD0D0bar { {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hCountCCbarPerEventBeforeEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -134,7 +134,7 @@ struct HfCorrelatorD0D0bar { /// D0-D0bar correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { int nTracks = 0; @@ -245,7 +245,7 @@ struct HfCorrelatorD0D0bar { /// D0-D0bar correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) void processMcRec(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { int nTracks = 0; @@ -388,12 +388,12 @@ struct HfCorrelatorD0D0bar { /// D0-D0bar correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) void processMcGen(aod::McCollision const&, - MCParticlesPlus const& particlesMC) + MCParticlesPlus const& mcParticles) { int counterD0D0bar = 0; registry.fill(HIST("hMCEvtCount"), 0); // MC gen level - for (const auto& particle1 : particlesMC) { + for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { continue; @@ -417,7 +417,7 @@ struct HfCorrelatorD0D0bar { continue; } registry.fill(HIST("hCountD0triggersMCGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) - for (const auto& particle2 : particlesMC) { + for (const auto& particle2 : mcParticles) { if (particle2.pdgCode() != pdg::Code::kD0Bar) { // check that inner particle is D0bar continue; } @@ -480,13 +480,13 @@ struct HfCorrelatorD0D0bar { /// c-cbar correlator table builder - for MC gen-level analysis void processCCbar(aod::McCollision const&, - MCParticlesPlus const& particlesMC) + MCParticlesPlus const& mcParticles) { registry.fill(HIST("hMCEvtCount"), 0); int counterCCbar = 0, counterCCbarBeforeEtasel = 0; // loop over particles at MC gen level - for (const auto& particle1 : particlesMC) { + for (const auto& particle1 : mcParticles) { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } @@ -516,7 +516,7 @@ struct HfCorrelatorD0D0bar { } registry.fill(HIST("hCountCtriggersMCGen"), 0, particle1.pt()); // to count trigger c quark (for normalisation) - for (const auto& particle2 : particlesMC) { + for (const auto& particle2 : mcParticles) { if (particle2.pdgCode() != PDG_t::kCharmBar) { // check that inner particle is a cbar continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx index c02b588952e..a943d4059b5 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx @@ -117,7 +117,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hCountCCbarPerEventBeforeEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -135,7 +135,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { /// D0-D0bar correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { int nTracks = 0; @@ -246,7 +246,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { /// D0-D0bar correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) void processMcRec(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { int nTracks = 0; @@ -389,12 +389,12 @@ struct HfCorrelatorD0D0barBarrelFullPid { /// D0-D0bar correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) void processMcGen(aod::McCollision const&, - MCParticlesPlus const& particlesMC) + MCParticlesPlus const& mcParticles) { int counterD0D0bar = 0; registry.fill(HIST("hMCEvtCount"), 0); // MC gen level - for (const auto& particle1 : particlesMC) { + for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { continue; @@ -418,7 +418,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { continue; } registry.fill(HIST("hCountD0triggersMCGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) - for (const auto& particle2 : particlesMC) { + for (const auto& particle2 : mcParticles) { if (particle2.pdgCode() != pdg::Code::kD0Bar) { // check that inner particle is D0bar continue; } @@ -481,13 +481,13 @@ struct HfCorrelatorD0D0barBarrelFullPid { /// c-cbar correlator table builder - for MC gen-level analysis void processCCbar(aod::McCollision const&, - MCParticlesPlus const& particlesMC) + MCParticlesPlus const& mcParticles) { registry.fill(HIST("hMCEvtCount"), 0); int counterCCbar = 0, counterCCbarBeforeEtasel = 0; // loop over particles at MC gen level - for (const auto& particle1 : particlesMC) { + for (const auto& particle1 : mcParticles) { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } @@ -517,7 +517,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { } registry.fill(HIST("hCountCtriggersMCGen"), 0, particle1.pt()); // to count trigger c quark (for normalisation) - for (const auto& particle2 : particlesMC) { + for (const auto& particle2 : mcParticles) { if (particle2.pdgCode() != PDG_t::kCharmBar) { // check that inner particle is a cbar continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 69e850ae270..6e43957ea3a 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -74,7 +74,7 @@ using BinningType = ColumnBinningPolicy>; -using SelectedTracks = soa::Filtered>; +using SelectedTracks = soa::Filtered; using SelectedCandidatesData = soa::Filtered>; using SelectedCandidatesMcRec = soa::Filtered>; using SelectedCollisionsMcGen = soa::Filtered>; @@ -145,10 +145,10 @@ struct HfCorrelatorD0HadronsSelection { PROCESS_SWITCH(HfCorrelatorD0HadronsSelection, processD0SelectionMcRec, "Process D0 Selection MCRec", true); void processD0SelectionMcGen(aod::McCollision const& mcCollision, - aod::McParticles const& particlesMc) + aod::McParticles const& mcParticles) { bool isD0Found = 0; - for (const auto& particle1 : particlesMc) { + for (const auto& particle1 : mcParticles) { if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { continue; } @@ -233,7 +233,7 @@ struct HfCorrelatorD0Hadrons { {"hD0Bin", "D0 selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}, {"hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)bins; registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -259,7 +259,7 @@ struct HfCorrelatorD0Hadrons { /// D0-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(soa::Join::iterator const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const& candidates) { // protection against empty tables to be sliced @@ -390,7 +390,7 @@ struct HfCorrelatorD0Hadrons { // ================ Process starts for MCRec, same event ======================== void processMcRec(soa::Join::iterator const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const& candidates) { // protection against empty tables to be sliced @@ -558,11 +558,11 @@ struct HfCorrelatorD0Hadrons { // ================= Process starts for MCGen, same event =================== void processMcGen(aod::McCollision const& mcCollision, - soa::Join const& particlesMc) + soa::Join const& mcParticles) { registry.fill(HIST("hEvtCountGen"), 0); // MC gen level - for (const auto& particle1 : particlesMc) { + for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { continue; @@ -586,7 +586,7 @@ struct HfCorrelatorD0Hadrons { } registry.fill(HIST("hCountD0TriggersGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) - for (const auto& particle2 : particlesMc) { + for (const auto& particle2 : mcParticles) { registry.fill(HIST("hTrackCounterGen"), 1); // total no. of tracks if (std::abs(particle2.eta()) > etaTrackMax) { continue; @@ -602,16 +602,16 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hTrackCounterGen"), 2); // fill before soft pi removal // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion - auto indexMotherPi = RecoDecay::getMother(particlesMc, particle2, pdg::Code::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only - auto indexMotherD0 = RecoDecay::getMother(particlesMc, particle1, pdg::Code::kDStar, true, nullptr, 1); + auto indexMotherPi = RecoDecay::getMother(mcParticles, particle2, pdg::Code::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only + auto indexMotherD0 = RecoDecay::getMother(mcParticles, particle1, pdg::Code::kDStar, true, nullptr, 1); if (std::abs(particle2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) continue; registry.fill(HIST("hTrackCounterGen"), 3); // fill after soft pion removal - auto getTracksSize = [&particlesMc](aod::McCollision const& collision) { + auto getTracksSize = [&mcParticles](aod::McCollision const& collision) { int nTracks = 0; - for (const auto& track : particlesMc) { + for (const auto& track : mcParticles) { if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { nTracks++; } @@ -801,12 +801,12 @@ struct HfCorrelatorD0Hadrons { // ====================== Implement Event mixing on McGen =================================== void processMcGenMixedEvent(SelectedCollisionsMcGen const& collisions, - SelectedTracksMcGen const& particlesMc) + SelectedTracksMcGen const& mcParticles) { - auto getTracksSize = [&particlesMc, this](SelectedCollisionsMcGen::iterator const& collision) { + auto getTracksSize = [&mcParticles, this](SelectedCollisionsMcGen::iterator const& collision) { int nTracks = 0; - auto associatedTracks = particlesMc.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); + auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); for (const auto& track : associatedTracks) { if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { nTracks++; @@ -818,7 +818,7 @@ struct HfCorrelatorD0Hadrons { using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zBins, multBins}, true}; - auto tracksTuple = std::make_tuple(particlesMc, particlesMc); + auto tracksTuple = std::make_tuple(mcParticles, mcParticles); Pair pairMcGen{corrBinningMcGen, 5, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { @@ -847,8 +847,8 @@ struct HfCorrelatorD0Hadrons { // ==============================soft pion removal================================ // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion - auto indexMotherPi = RecoDecay::getMother(particlesMc, t2, pdg::Code::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only - auto indexMotherD0 = RecoDecay::getMother(particlesMc, t1, pdg::Code::kDStar, true, nullptr, 1); + auto indexMotherPi = RecoDecay::getMother(mcParticles, t2, pdg::Code::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only + auto indexMotherD0 = RecoDecay::getMother(mcParticles, t1, pdg::Code::kDStar, true, nullptr, 1); if (std::abs(t2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) { continue; } diff --git a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx index d5ae5809303..0491ce78130 100644 --- a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx @@ -139,7 +139,7 @@ struct HfCorrelatorDMesonPairs { {"hMatchedMcGen", "D Meson pair candidates - MC gen;MC Matched;entries", hTH1Matched}, {"hOriginMcGen", "D Meson pair candidates - MC gen;prompt vs. non-prompt;entries", hTH1Origin}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; constexpr int kNBinsSelStatus = 6; @@ -325,10 +325,10 @@ struct HfCorrelatorDMesonPairs { // Common code to analyse D0's and D+'s at Gen level. template - void analyseMcGen(const T& particlesMc) + void analyseMcGen(const T& mcParticles) { registry.fill(HIST("hMcEvtCount"), 0); - for (const auto& particle1 : particlesMc) { + for (const auto& particle1 : mcParticles) { // check if the particle is D0, D0bar, DPlus or DMinus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kD0 && std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { continue; @@ -352,7 +352,7 @@ struct HfCorrelatorDMesonPairs { int8_t matchedGen1 = particle1.flagMcMatchGen(); registry.fill(HIST("hMatchedMcGen"), matchedGen1); - for (const auto& particle2 : particlesMc) { + for (const auto& particle2 : mcParticles) { // Candidate sign attribution. auto candidateType2 = assignCandidateTypeGen(particle2); if (!kinematicCutsGen(particle2)) { @@ -405,7 +405,7 @@ struct HfCorrelatorDMesonPairs { /// D0(bar)-D0(bar) correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processDataD0(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { // protection against empty tables to be sliced @@ -452,7 +452,7 @@ struct HfCorrelatorDMesonPairs { /// D0(bar)-D0(bar) correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) void processMcRecD0(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { // protection against empty tables to be sliced @@ -524,16 +524,16 @@ struct HfCorrelatorDMesonPairs { /// D0(bar)-D0(bar) correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) void processMcGenD0(aod::McCollision const&, - McParticlesPlus2Prong const& particlesMc) + McParticlesPlus2Prong const& mcParticles) { - analyseMcGen(particlesMc); + analyseMcGen(mcParticles); } PROCESS_SWITCH(HfCorrelatorDMesonPairs, processMcGenD0, "Process D0 Mc Gen mode", false); /// Dplus(minus)-Dplus(minus) correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processDataDPlus(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { // protection against empty tables to be sliced @@ -593,7 +593,7 @@ struct HfCorrelatorDMesonPairs { /// Dplus(minus)-Dplus(minus) correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) void processMcRecDPlus(aod::Collision const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const&) { // protection against empty tables to be sliced @@ -674,9 +674,9 @@ struct HfCorrelatorDMesonPairs { /// Dplus(minus)-Dplus(minus) correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) void processMcGenDPlus(aod::McCollision const&, - McParticlesPlus3Prong const& particlesMc) + McParticlesPlus3Prong const& mcParticles) { - analyseMcGen(particlesMc); + analyseMcGen(mcParticles); } PROCESS_SWITCH(HfCorrelatorDMesonPairs, processMcGenDPlus, "Process DPlus Mc Gen mode", false); diff --git a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx index 9180ac458d1..5a1b688b61e 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusDminus.cxx @@ -65,13 +65,10 @@ const int ptDAxisBins = 180; const double ptDAxisMin = 0.; const double ptDAxisMax = 36.; -using MCParticlesPlus2Prong = soa::Join; -using MCParticlesPlus3Prong = soa::Join; +using McParticlesPlus2Prong = soa::Join; +using McParticlesPlus3Prong = soa::Join; struct HfCorrelatorDplusDminus { - SliceCache cache; - Preslice perCol = aod::hf_cand::collisionId; - Produces entryDplusDminusPair; Produces entryDplusDminusRecoInfo; @@ -84,6 +81,10 @@ struct HfCorrelatorDplusDminus { Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_dplus_to_pi_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmeson_v}, "Efficiency values for Dplus meson"}; + SliceCache cache; + + Preslice perCol = aod::hf_cand::collisionId; + Partition> selectedDPlusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Partition> selectedDPlusCandidatesMC = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; @@ -119,7 +120,7 @@ struct HfCorrelatorDplusDminus { {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hCountCCbarPerEventBeforeEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMass", "Dplus,Dminus candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -240,7 +241,6 @@ struct HfCorrelatorDplusDminus { } // end inner loop (Dminus) } // end outer loop (Dplus) } - PROCESS_SWITCH(HfCorrelatorDplusDminus, processData, "Process data", false); /// Dplus-Dminus correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) @@ -368,17 +368,16 @@ struct HfCorrelatorDplusDminus { } // end outer loop } - PROCESS_SWITCH(HfCorrelatorDplusDminus, processMcRec, "Process MC Reco mode", true); /// Dplus-Dminus correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) - void processMcGen(aod::McCollision const& mccollision, - MCParticlesPlus3Prong const& particlesMC) + void processMcGen(aod::McCollision const& mcCollision, + McParticlesPlus3Prong const& mcParticles) { int counterDplusDminus = 0; registry.fill(HIST("hMCEvtCount"), 0); // MC gen level - for (const auto& particle1 : particlesMC) { + for (const auto& particle1 : mcParticles) { // check if the particle is Dplus or Dminus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { continue; @@ -402,7 +401,7 @@ struct HfCorrelatorDplusDminus { continue; } registry.fill(HIST("hCountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus (for normalisation) - for (const auto& particle2 : particlesMC) { + for (const auto& particle2 : mcParticles) { if (particle2.pdgCode() != -pdg::Code::kDPlus) { // check that inner particle is a Dminus continue; } @@ -437,13 +436,13 @@ struct HfCorrelatorDplusDminus { if (rightDecayChannels) { // fill with D and Dbar daughter particls acceptance checks bool candidate1DauInAcc = true; bool candidate2DauInAcc = true; - for (const auto& dau : particle1.daughters_as()) { + for (const auto& dau : particle1.daughters_as()) { if (std::abs(dau.eta()) > etaCut) { candidate1DauInAcc = false; break; } } - for (const auto& dau : particle2.daughters_as()) { + for (const auto& dau : particle2.daughters_as()) { if (std::abs(dau.eta()) > etaCut) { candidate2DauInAcc = false; break; @@ -460,22 +459,21 @@ struct HfCorrelatorDplusDminus { } // end outer loop registry.fill(HIST("hCountDplusDminusPerEvent"), counterDplusDminus); } - PROCESS_SWITCH(HfCorrelatorDplusDminus, processMcGen, "Process MC Gen mode", false); /// c-cbar correlator table builder - for MC gen-level analysis - void processCCbar(aod::McCollision const& mccollision, - MCParticlesPlus2Prong const& particlesMC) + void processCCbar(aod::McCollision const& mcCollision, + McParticlesPlus2Prong const& mcParticles) { registry.fill(HIST("hMCEvtCount"), 0); int counterCCbar = 0, counterCCbarBeforeEtasel = 0; // loop over particles at MC gen level - for (const auto& particle1 : particlesMC) { + for (const auto& particle1 : mcParticles) { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } - int partMothPDG = particle1.mothers_as().front().pdgCode(); + int partMothPDG = particle1.mothers_as().front().pdgCode(); // check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; @@ -501,7 +499,7 @@ struct HfCorrelatorDplusDminus { } registry.fill(HIST("hCountCtriggersMCGen"), 0, particle1.pt()); // to count trigger c quark (for normalisation) - for (const auto& particle2 : particlesMC) { + for (const auto& particle2 : mcParticles) { if (particle2.pdgCode() != PDG_t::kCharmBar) { continue; } @@ -512,7 +510,7 @@ struct HfCorrelatorDplusDminus { continue; } // check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it - if (particle2.mothers_as().front().pdgCode() == PDG_t::kCharmBar) { + if (particle2.mothers_as().front().pdgCode() == PDG_t::kCharmBar) { continue; } entryDplusDminusPair(getDeltaPhi(particle2.phi(), particle1.phi()), @@ -527,7 +525,6 @@ struct HfCorrelatorDplusDminus { registry.fill(HIST("hCountCCbarPerEvent"), counterCCbar); registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterCCbarBeforeEtasel); } - PROCESS_SWITCH(HfCorrelatorDplusDminus, processCCbar, "Process c-cbar pairs", false); }; diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index dabf7232913..48942fc9c2a 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -68,14 +68,16 @@ BinningType corrBinning{{zBins, multBins}, true}; // Code to select a Dmeson in a collision struct HfDplusSelection { - SliceCache cache; Produces dplusSel; + Configurable selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + SliceCache cache; + Partition> selectedDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition> recoFlagDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition> selectedDplusCandidatesMc = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; void processDplusSelectionData(aod::Collision const& collision, soa::Join const& candidates) @@ -103,9 +105,9 @@ struct HfDplusSelection { soa::Join const& candidates) { bool isDplusFound = 0; - if (recoFlagDplusCandidates.size() > 0) { - auto selectedDplusCandidatesGroupedMc = recoFlagDplusCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - for (const auto& candidate1 : selectedDplusCandidatesGroupedMc) { + if (selectedDplusCandidatesMc.size() > 0) { + auto selectedDplusCandidatesMcGrouped = selectedDplusCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + for (const auto& candidate1 : selectedDplusCandidatesMcGrouped) { // check decay channel flag for candidate1 if (!(candidate1.hfflag() & 1 << DecayType::DplusToPiKPi)) { continue; @@ -125,10 +127,10 @@ struct HfDplusSelection { PROCESS_SWITCH(HfDplusSelection, processDplusSelectionMcRec, "Process Dplus Selection MCRec", false); void processDplusSelectionMcGen(aod::McCollision const& mcCollision, - aod::McParticles const& particlesMc) + aod::McParticles const& mcParticles) { bool isDplusFound = 0; - for (const auto& particle1 : particlesMc) { + for (const auto& particle1 : mcParticles) { if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { continue; } @@ -149,11 +151,9 @@ struct HfDplusSelection { /// Dplus-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) struct HfCorrelatorDplusHadrons { - SliceCache cache; - Preslice perCol = aod::hf_cand::collisionId; - Produces entryDplusHadronPair; Produces entryDplusHadronRecoInfo; + Configurable selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus"}; Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying D-meson efficiency weights"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; @@ -168,8 +168,28 @@ struct HfCorrelatorDplusHadrons { Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_dplus_to_pi_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; Configurable> efficiencyD{"efficiencyD", std::vector{efficiencyDmeson_v}, "Efficiency values for Dplus meson"}; + SliceCache cache; + + // Event Mixing for the Data Mode + using MySelCollisions = soa::Filtered>; + using MyTracks = soa::Filtered; + using MyCandidatesData = soa::Filtered>; + // Event Mixing for the MCRec Mode + using MyCandidatesMcRec = soa::Filtered>; + // Event Mixing for the MCGen Mode + using McCollisionsSel = soa::Filtered>; + using McParticlesSel = soa::Filtered; + + Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; + Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + Filter dplusFilter = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 1; + Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true; + Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 411 || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); + + Preslice perCol = aod::hf_cand::collisionId; + Partition> selectedDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; - Partition> recoFlagDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + Partition> selectedDplusCandidatesMc = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; HistogramRegistry registry{ "registry", @@ -202,7 +222,7 @@ struct HfCorrelatorDplusHadrons { {"hDplusBin", "Dplus selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}, {"hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMassDplus_2D", "Dplus candidates;inv. mass (K^{-}#pi^{+}#pi^{+}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -215,7 +235,7 @@ struct HfCorrelatorDplusHadrons { /// Dplus-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(soa::Join::iterator const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const& candidates) { if (selectedDplusCandidates.size() > 0) { @@ -299,15 +319,14 @@ struct HfCorrelatorDplusHadrons { registry.fill(HIST("hMultV0M"), collision.multFV0M()); } } - PROCESS_SWITCH(HfCorrelatorDplusHadrons, processData, "Process data", false); /// Dplus-Hadron correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) void processMcRec(soa::Join::iterator const& collision, - soa::Join const& tracks, + aod::TracksWDca const& tracks, soa::Join const& candidates) { - if (recoFlagDplusCandidates.size() > 0) { + if (selectedDplusCandidatesMc.size() > 0) { int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFV0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -328,10 +347,10 @@ struct HfCorrelatorDplusHadrons { } registry.fill(HIST("hMultiplicity"), nTracks); - auto selectedDplusCandidatesGroupedMc = recoFlagDplusCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + auto selectedDplusCandidatesMcGrouped = selectedDplusCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); // MC reco level bool flagDplusSignal = false; - for (const auto& candidate1 : selectedDplusCandidatesGroupedMc) { + for (const auto& candidate1 : selectedDplusCandidatesMcGrouped) { // check decay channel flag for candidate1 if (!(candidate1.hfflag() & 1 << DecayType::DplusToPiKPi)) { continue; @@ -398,18 +417,18 @@ struct HfCorrelatorDplusHadrons { registry.fill(HIST("hMultV0M"), collision.multFV0M()); } } - PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcRec, "Process MC Reco mode", true); + /// Dplus-Hadron correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) void processMcGen(aod::McCollision const& mcCollision, - aod::McParticles const& particlesMc) + aod::McParticles const& mcParticles) { int counterDplusHadron = 0; registry.fill(HIST("hMCEvtCount"), 0); - auto getTracksSize = [&particlesMc](aod::McCollision const& collision) { + auto getTracksSize = [&mcParticles](aod::McCollision const& collision) { int nTracks = 0; - for (const auto& track : particlesMc) { + for (const auto& track : mcParticles) { if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { nTracks++; } @@ -420,7 +439,7 @@ struct HfCorrelatorDplusHadrons { BinningTypeMCGen corrBinningMcGen{{getTracksSize}, {zBins, multBinsMcGen}, true}; // MC gen level - for (const auto& particle1 : particlesMc) { + for (const auto& particle1 : mcParticles) { // check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { continue; @@ -443,7 +462,7 @@ struct HfCorrelatorDplusHadrons { continue; } registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus for normalisation) - for (const auto& particle2 : particlesMc) { + for (const auto& particle2 : mcParticles) { // Check Mother of particle 2 bool flagMotherFound = false; @@ -480,23 +499,12 @@ struct HfCorrelatorDplusHadrons { } PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcGen, "Process MC Gen mode", false); - // Event Mixing for the Data Mode - using myCollisions = soa::Join; - using fullTracks = soa::Join; - using mySelCollisions = soa::Filtered; - using myTracks = soa::Filtered; - using myCandidatesData = soa::Filtered>; - - Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; - Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); - Filter dplusfilter = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 1; - - void processDataMixedEvent(mySelCollisions const& collisions, - myCandidatesData const& candidates, - myTracks const& tracks) + void processDataMixedEvent(MySelCollisions const& collisions, + MyCandidatesData const& candidates, + MyTracks const& tracks) { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, 5, -1, collisions, tracksTuple, &cache}; + Pair pairData{corrBinning, 5, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFV0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFV0M()))); // For debug @@ -513,15 +521,12 @@ struct HfCorrelatorDplusHadrons { } PROCESS_SWITCH(HfCorrelatorDplusHadrons, processDataMixedEvent, "Process Mixed Event Data", false); - // Event Mixing for the MCRec Mode - using myCandidatesMcRec = soa::Filtered>; - - void processMcRecMixedEvent(mySelCollisions const& collisions, - myCandidatesMcRec const& candidates, - myTracks const& tracks) + void processMcRecMixedEvent(MySelCollisions const& collisions, + MyCandidatesMcRec const& candidates, + MyTracks const& tracks) { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, 5, -1, collisions, tracksTuple, &cache}; + Pair pairMcRec{corrBinning, 5, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFV0M())); @@ -537,20 +542,13 @@ struct HfCorrelatorDplusHadrons { } PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcRecMixedEvent, "Process Mixed Event MCRec", false); - // Event Mixing for the MCGen Mode - using McCollisionsSel = soa::Filtered>; - using McParticlesSel = soa::Filtered; - - Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true; - Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 411 || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); - void processMcGenMixedEvent(McCollisionsSel const& collisions, - McParticlesSel const& particlesMc) + McParticlesSel const& mcParticles) { - auto getTracksSize = [&particlesMc, this](McCollisionsSel::iterator const& collision) { + auto getTracksSize = [&mcParticles, this](McCollisionsSel::iterator const& collision) { int nTracks = 0; - auto associatedTracks = particlesMc.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); + auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); for (const auto& track : associatedTracks) { if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { nTracks++; @@ -562,7 +560,7 @@ struct HfCorrelatorDplusHadrons { using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zBins, multBins}, true}; - auto tracksTuple = std::make_tuple(particlesMc, particlesMc); + auto tracksTuple = std::make_tuple(mcParticles, mcParticles); Pair pairMcGen{corrBinningMcGen, 5, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { diff --git a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx index 529a91e7b2c..615f215bc94 100644 --- a/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDsHadrons.cxx @@ -71,29 +71,30 @@ BinningType corrBinning{{zBins, multBins}, true}; /// Code to select collisions with at least one Ds meson struct HfCorrelatorDsHadronsSelCollision { - SliceCache cache; Produces collisionsWithSelDs; Configurable selectionFlagDs{"selectionFlagDs", 7, "Selection Flag for Ds"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - Filter dsFlagFilter = (o2::aod::hf_track_index::hfflag & static_cast(1 << DecayType::DsToKKPi)) != static_cast(0); // filter in HfCand3Prong + SliceCache cache; using CandDsData = soa::Filtered>; using CandDsMcReco = soa::Filtered>; using CandDsMcGen = soa::Join; - Partition selectedDsAllCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Partition recoFlagDsCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; + Filter dsFilter = (o2::aod::hf_track_index::hfflag & static_cast(1 << DecayType::DsToKKPi)) != static_cast(0); // filter in HfCand3Prong + + Partition selectedDsCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; + Partition selectedDsCandidatesMc = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; /// Code to select collisions with at least one Ds meson - for real data and data-like analysis void processDsSelCollisionsData(aod::Collision const& collision, CandDsData const& candidates) { bool isDsFound = false; - if (selectedDsAllCand.size() > 0) { - auto selectedDsAllCandGrouped = selectedDsAllCand->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + if (selectedDsCandidates.size() > 0) { + auto selectedDsAllCandGrouped = selectedDsCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); for (const auto& candidate : selectedDsAllCandGrouped) { if (yCandMax >= 0. && std::abs(yDs(candidate)) > yCandMax) { continue; @@ -114,8 +115,8 @@ struct HfCorrelatorDsHadronsSelCollision { CandDsMcReco const& candidates) { bool isDsFound = false; - if (recoFlagDsCandidates.size() > 0) { - auto selectedDsCandidatesGroupedMc = recoFlagDsCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + if (selectedDsCandidatesMc.size() > 0) { + auto selectedDsCandidatesGroupedMc = selectedDsCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); for (const auto& candidate : selectedDsCandidatesGroupedMc) { if (yCandMax >= 0. && std::abs(yDs(candidate)) > yCandMax) { continue; @@ -132,11 +133,11 @@ struct HfCorrelatorDsHadronsSelCollision { PROCESS_SWITCH(HfCorrelatorDsHadronsSelCollision, processDsSelCollisionsMcRec, "Process Ds Collision Selection MCRec", false); /// Code to select collisions with at least one Ds meson - for MC gen-level analysis - void processDsSelCollisionsMcGen(aod::McCollision const& mccollision, - CandDsMcGen const& particlesMc) + void processDsSelCollisionsMcGen(aod::McCollision const& mcCollision, + CandDsMcGen const& mcParticles) { bool isDsFound = false; - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { if (std::abs(particle.pdgCode()) != pdg::Code::kDS) { continue; } @@ -157,8 +158,6 @@ struct HfCorrelatorDsHadronsSelCollision { /// Ds-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) struct HfCorrelatorDsHadrons { - SliceCache cache; - Preslice perCol = aod::hf_cand::collisionId; Produces entryDsHadronPair; Produces entryDsHadronRecoInfo; Produces entryDsHadronGenInfo; @@ -179,16 +178,20 @@ struct HfCorrelatorDsHadrons { Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; Configurable> efficiencyD{"efficiencyD", std::vector{vecEfficiencyDmeson}, "Efficiency values for Ds meson"}; - Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; - Filter flagDsFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << DecayType::DsToKKPi)) != static_cast(0)) && (aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs); - Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + SliceCache cache; using SelCollisionsWithDs = soa::Filtered>; // collisionFilter applied using SelCollisionsWithDsMc = soa::Filtered>; // collisionFilter applied using CandDsData = soa::Filtered>; // flagDsFilter applied using CandDsMcReco = soa::Filtered>; // flagDsFilter applied using CandDsMcGen = soa::Join; // flagDsFilter applied - using MyTracksData = soa::Filtered>; // trackFilter applied + using MyTracksData = soa::Filtered; // trackFilter applied + + Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; + Filter flagDsFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << DecayType::DsToKKPi)) != static_cast(0)) && (aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs); + Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + + Preslice perCol = aod::hf_cand::collisionId; HistogramRegistry registry{ "registry", @@ -244,7 +247,7 @@ struct HfCorrelatorDsHadrons { {"hDsPoolBin", "Ds selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {axisPoolBin}}}, {"hTracksPoolBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {axisPoolBin}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMassDsVsPt", "Ds candidates", {HistType::kTH2F, {{axisMassD}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -357,7 +360,7 @@ struct HfCorrelatorDsHadrons { CandDsData const& candidates, MyTracksData const& tracks) { - // if (selectedDsAllCand.size() > 0) { + // if (selectedDsCandidates.size() > 0) { if (candidates.size() > 0) { registry.fill(HIST("hZVtx"), collision.posZ()); registry.fill(HIST("hMultV0M"), collision.multFV0M()); @@ -546,7 +549,7 @@ struct HfCorrelatorDsHadrons { /// Ds-Hadron correlation - for calculating efficiencies using MC reco-level analysis void processMcEfficiencies(CandDsMcReco const& candidates, - CandDsMcGen const& particlesMc, + CandDsMcGen const& mcParticles, MyTracksData const& tracksData, aod::TracksWMc const&) { @@ -592,7 +595,7 @@ struct HfCorrelatorDsHadrons { } // MC gen level for Ds meson reconstruction's efficiency - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { // check if the particle is Ds if (std::abs(particle.pdgCode()) != pdg::Code::kDS) { continue; @@ -610,7 +613,7 @@ struct HfCorrelatorDsHadrons { } // MC gen level for particles associated reconstruction's efficiency - for (const auto& particleAssoc : particlesMc) { + for (const auto& particleAssoc : mcParticles) { if (std::abs(particleAssoc.eta()) > etaTrackMax) { continue; } @@ -626,15 +629,15 @@ struct HfCorrelatorDsHadrons { PROCESS_SWITCH(HfCorrelatorDsHadrons, processMcEfficiencies, "Process MC for calculating efficiencies", false); /// Ds-Hadron correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) - void processMcGen(SelCollisionsWithDsMc::iterator const& mccollision, - CandDsMcGen const& particlesMc) + void processMcGen(SelCollisionsWithDsMc::iterator const& mcCollision, + CandDsMcGen const& mcParticles) { int counterDsHadron = 0; registry.fill(HIST("hMcEvtCount"), 0); - auto getTracksSize = [&particlesMc](SelCollisionsWithDsMc::iterator const& mccollision) { + auto getTracksSize = [&mcParticles](SelCollisionsWithDsMc::iterator const& mcCollision) { int nTracks = 0; - for (const auto& track : particlesMc) { + for (const auto& track : mcParticles) { if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { nTracks++; } @@ -643,12 +646,12 @@ struct HfCorrelatorDsHadrons { }; using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zBins, multBinsMcGen}, true}; - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mccollision.posZ(), getTracksSize(mccollision))); + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); registry.fill(HIST("hCollisionPoolBin"), poolBin); bool isDsPrompt = false; // MC gen level - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { // check if the particle is Ds if (std::abs(particle.pdgCode()) != pdg::Code::kDS) { continue; @@ -667,7 +670,7 @@ struct HfCorrelatorDsHadrons { isDsPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; // Ds Hadron correlation dedicated section - for (const auto& particleAssoc : particlesMc) { + for (const auto& particleAssoc : mcParticles) { if (std::abs(particleAssoc.eta()) > etaTrackMax) { continue; } diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index 42e144bb58f..2ca9a75b64b 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -168,7 +168,7 @@ struct HfTaskCorrelationD0Hadrons { {"hDeltaEtaPtIntGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, {"hDeltaPhiPtIntGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { int nBinsPtAxis = binsCorrelations->size() - 1; const double* valuesPtAxis = binsCorrelations->data(); diff --git a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx index eb0498a7027..1893e421ff3 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDDbar.cxx @@ -158,7 +158,7 @@ struct HfTaskCorrelationDDbar { {"hDeltaPtDDbarMCGen", stringMCParticles + stringDeltaPt + "entries", {HistType::kTH1F, {{144, -36., 36.}}}}, {"hDeltaPtMaxMinMCGen", stringMCParticles + stringDeltaPtMaxMin + "entries", {HistType::kTH1F, {{72, 0., 36.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { // redefinition of pT axes for THnSparse holding correlation entries int nBinspTaxis = binsPtCorrelations->size() - 1; diff --git a/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx b/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx index 7a14a4258d5..1869b8f127b 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDMesonPairs.cxx @@ -197,7 +197,7 @@ struct HfTaskCorrelationDMesonPairs { {"hDeltaPtDDbarMCGen", stringMCParticles + stringDeltaPt + "entries", hTH1DeltaPtDDbar}, {"hDeltaPtMaxMinMCGen", stringMCParticles + stringDeltaPtMaxMin + "entries", hTH1DeltaPtMaxMin}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { // redefinition of pT axes for THnSparse holding correlation entries int nBinspTaxis = binsPtCorrelations->size() - 1; diff --git a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx index 45fc127dc44..11d5e968509 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx @@ -120,7 +120,7 @@ struct HfTaskCorrelationDplusHadrons { {"hCorrel2DVsPtMCGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + stringPtD + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}, {9, 0., 9.}}}}, // note: axes 3 and 4 (the pT) are updated in the init() }}; - void init(o2::framework::InitContext&) + void init(InitContext&) { // redefinition of pT axes for THnSparse holding correlation entries int nBinspTaxis = binsPtCorrelations->size() - 1; diff --git a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx index 7b10278a7c8..22df61d1937 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDsHadrons.cxx @@ -124,7 +124,7 @@ struct HfTaskCorrelationDsHadrons { {"hCorrel2DVsPtMcGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + stringPtD + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDetlaPhi}, {axisDetlaEta}, {axisPtD}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the pT) are updated in the init() {"hCorrel2DVsPtMcGenPromptDivision", stringMCParticles + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + stringDsPrompt + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDetlaPhi}, {axisDetlaEta}, {axisPtD}, {axisPtHadron}, {axisDsPrompt}, {axisPoolBin}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { // redefinition of pT axes for THnSparse holding correlation entries int nBinsPtAxis = binsPtCorrelations->size() - 1; diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index b3098737354..5a14ca0b766 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -48,9 +48,6 @@ using namespace o2::aod::hf_cand_2prong; using namespace o2::analysis::hf_cuts_d0_to_pi_k; struct HfTaskFlow { - SliceCache cache; - Preslice perCol = aod::track::collisionId; - // configurables for processing options Configurable processRun2{"processRun2", false, "Flag to run on Run 2 data"}; Configurable processRun3{"processRun3", true, "Flag to run on Run 3 data"}; @@ -67,21 +64,24 @@ struct HfTaskFlow { Configurable yCandMax{"yCandMax", -1., "max. cand. rapidity"}; Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; + SliceCache cache; + + using MyCollisions = soa::Filtered>; + using MyTracks = soa::Filtered>; + using HfCandidatesSel = soa::Filtered>; + // Collision filters // FIXME: The filter is applied also on the candidates! Beware! Filter collisionVtxZFilter = nabs(aod::collision::posZ) < zVertexMax; - using aodCollisions = soa::Filtered>; - // Charged track filters Filter trackFilter = (nabs(aod::track::eta) < etaTrackAssocMax) && (aod::track::pt > ptTrackAssocMin) && requireGlobalTrackWoPtEtaInFilter(); - using aodTracks = soa::Filtered>; - // HF candidate filter // TODO: use Partition instead of filter Filter candidateFilter = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - using hfCandidates = soa::Filtered>; + + Preslice perCol = aod::track::collisionId; // configurables for containers ConfigurableAxis axisVertex{"axisVertex", {14, -7, 7}, "vertex axis for histograms"}; @@ -109,7 +109,7 @@ struct HfTaskFlow { // ========================= // init() // ========================= - void init(o2::framework::InitContext&) + void init(InitContext&) { // EVENT HISTOGRAMS constexpr int kNBinsEvents = 3; @@ -365,7 +365,7 @@ struct HfTaskFlow { // Note: this is needed only in case of HF-hadron correlations bool fillingHFcontainer = false; double invmass = 0; - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v) { // TODO: Check how to put this into a Filter if (!isAcceptedCandidate(track1)) { continue; @@ -393,7 +393,7 @@ struct HfTaskFlow { // in case of HF-h correlations, remove candidate daughters from the pool of associated hadrons // with which the candidate is being correlated - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v) { if ((track1.prong0Id() == track2.globalIndex()) || (track1.prong1Id() == track2.globalIndex())) { continue; } @@ -427,13 +427,13 @@ struct HfTaskFlow { } template - void mixCollisions(aodCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) + void mixCollisions(MyCollisions const& collisions, TTracksTrig const& tracks1, TTracksAssoc const& tracks2, TLambda getPartsSize, OutputObj& corrContainer) { using BinningType = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getPartsSize)>; BinningType binningWithTracksSize{{getPartsSize}, {axisVertex, axisMultiplicity}, true}; auto tracksTuple = std::make_tuple(tracks1, tracks2); - Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; + Pair pair{binningWithTracksSize, nMixedEvents, -1, collisions, tracksTuple, &cache}; for (const auto& [collision1, tracks1, collision2, tracks2] : pair) { @@ -450,7 +450,7 @@ struct HfTaskFlow { const auto multiplicity = tracks2.size(); // get multiplicity of charged hadrons, which is used for slicing in mixing const auto vz = collision1.posZ(); - if constexpr (std::is_same_v) { + if constexpr (std::is_same_v) { registry.fill(HIST("hEventCountHFMixing"), bin); fillHFMixingQA(multiplicity, vz, tracks1); } else { @@ -466,8 +466,8 @@ struct HfTaskFlow { // ===================================== // process same event correlations: h-h case // ===================================== - void processSameTpcTpcHH(aodCollisions::iterator const& collision, - aodTracks const& tracks) + void processSameTpcTpcHH(MyCollisions::iterator const& collision, + MyTracks const& tracks) { if (!(isCollisionSelected(collision, true))) { return; @@ -495,9 +495,9 @@ struct HfTaskFlow { // ===================================== // process same event correlations: HF-h case // ===================================== - void processSameHfHadrons(aodCollisions::iterator const& collision, - aodTracks const& tracks, - hfCandidates const& candidates) + void processSameHfHadrons(MyCollisions::iterator const& collision, + MyTracks const& tracks, + HfCandidatesSel const& candidates) { if (!(isCollisionSelected(collision, false))) { return; @@ -514,8 +514,8 @@ struct HfTaskFlow { // ===================================== // process same event correlations: h-MFT case // ===================================== - void processSameTpcMftHH(aodCollisions::iterator const& collision, - aodTracks const& tracks, + void processSameTpcMftHH(MyCollisions::iterator const& collision, + MyTracks const& tracks, aod::MFTTracks const& mfttracks) { if (!(isCollisionSelected(collision, false))) { @@ -534,11 +534,11 @@ struct HfTaskFlow { // ===================================== // process mixed event correlations: h-h case // ===================================== - void processMixedTpcTpcHH(aodCollisions const& collisions, - aodTracks const& tracks) + void processMixedTpcTpcHH(MyCollisions const& collisions, + MyTracks const& tracks) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&tracks, this](aodCollisions::iterator const& col) { + auto getTracksSize = [&tracks, this](MyCollisions::iterator const& col) { auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); // it's cached, so slicing/grouping happens only once auto size = associatedTracks.size(); return size; @@ -551,12 +551,12 @@ struct HfTaskFlow { // ===================================== // process mixed event correlations: h-h case // ===================================== - void processMixedHfHadrons(aodCollisions const& collisions, - aodTracks const& tracks, - hfCandidates const& candidates) + void processMixedHfHadrons(MyCollisions const& collisions, + MyTracks const& tracks, + HfCandidatesSel const& candidates) { // we want to group collisions based on charged-track multiplicity - auto getTracksSize = [&tracks, this](aodCollisions::iterator const& col) { + auto getTracksSize = [&tracks, this](MyCollisions::iterator const& col) { auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, col.globalIndex(), this->cache); auto size = associatedTracks.size(); return size; @@ -569,6 +569,5 @@ struct HfTaskFlow { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx index 7c3b8c81a0c..cc2637cedc3 100644 --- a/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx +++ b/PWGHF/HFL/Tasks/taskMuonCharmBeautySeparation.cxx @@ -28,7 +28,7 @@ using namespace o2::framework::expressions; struct HfTaskMuonCharmBeautySeparation { HistogramRegistry registry{"registry"}; - void init(o2::framework::InitContext&) + void init(InitContext&) { AxisSpec trackTypeAxis = {6, -0.5, 5.5, "Track Type"}; AxisSpec ptRecoAxis = {1500, 0, 15, "#it{p}_{T}_{Reco}"}; diff --git a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index 09b090da0c6..62e54203c9f 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx @@ -14,7 +14,6 @@ // \author Maolin Zhang , CCNU #include -#include #include #include @@ -145,7 +144,7 @@ struct HfTaskSingleMuonSource { continue; } // compute the flavor of constituent quark - const int flv(pdgRem / TMath::Power(10, static_cast(TMath::Log10(pdgRem)))); + const int flv(pdgRem / std::pow(10, static_cast(std::log10(pdgRem)))); if (flv > 6) { // no more than 6 flavors continue; diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 7bd65ddcfa1..fdd3ce9f8e2 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -241,7 +241,7 @@ struct HfCandidateCreator2ProngExpressions { /// Performs MC matching. void processMc(aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { rowCandidateProng2->bindExternalIndices(&tracks); @@ -260,7 +260,7 @@ struct HfCandidateCreator2ProngExpressions { // D0(bar) → π± K∓ // Printf("Checking D0(bar) → π± K∓"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); if (indexRec > -1) { flag = sign * (1 << DecayType::D0ToPiK); } @@ -268,7 +268,7 @@ struct HfCandidateCreator2ProngExpressions { // J/ψ → e+ e− if (flag == 0) { // Printf("Checking J/ψ → e+ e−"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToEE; } @@ -277,7 +277,7 @@ struct HfCandidateCreator2ProngExpressions { // J/ψ → μ+ μ− if (flag == 0) { // Printf("Checking J/ψ → μ+ μ−"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToMuMu; } @@ -285,29 +285,29 @@ struct HfCandidateCreator2ProngExpressions { // Check whether the particle is non-prompt (from a b quark). if (flag != 0) { - auto particle = particlesMC.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchRec(flag, origin); } // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; // D0(bar) → π± K∓ // Printf("Checking D0(bar) → π± K∓"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { flag = sign * (1 << DecayType::D0ToPiK); } // J/ψ → e+ e− if (flag == 0) { // Printf("Checking J/ψ → e+ e−"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true)) { flag = 1 << DecayType::JpsiToEE; } } @@ -315,14 +315,14 @@ struct HfCandidateCreator2ProngExpressions { // J/ψ → μ+ μ− if (flag == 0) { // Printf("Checking J/ψ → μ+ μ−"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { flag = 1 << DecayType::JpsiToMuMu; } } // Check whether the particle is non-prompt (from a b quark). if (flag != 0) { - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchGen(flag, origin); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index c8628f26dff..69dde764a03 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -249,7 +249,7 @@ struct HfCandidateCreator3ProngExpressions { /// Performs MC matching. void processMc(aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { rowCandidateProng3->bindExternalIndices(&tracks); @@ -280,7 +280,7 @@ struct HfCandidateCreator3ProngExpressions { // D± → π± K∓ π± // Printf("Checking D± → π± K∓ π±"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::DplusToPiKPi); } @@ -288,16 +288,16 @@ struct HfCandidateCreator3ProngExpressions { // Ds± → K± K∓ π± if (flag == 0) { // Printf("Checking Ds± → K± K∓ π±"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::DsToKKPi); if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } - RecoDecay::getDaughters(particlesMC.rawIteratorAt(indexRec), &arrDaughIndex, std::array{0}, 1); + RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == 2) { for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { - auto daughI = particlesMC.rawIteratorAt(arrDaughIndex[iProng]); + auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); arrPDGDaugh[iProng] = std::abs(daughI.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[0])) { @@ -312,7 +312,7 @@ struct HfCandidateCreator3ProngExpressions { // Λc± → p± K∓ π± if (flag == 0) { // Printf("Checking Λc± → p± K∓ π±"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::LcToPKPi); @@ -320,10 +320,10 @@ struct HfCandidateCreator3ProngExpressions { if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } - RecoDecay::getDaughters(particlesMC.rawIteratorAt(indexRec), &arrDaughIndex, std::array{0}, 1); + RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == 2) { for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { - auto daughI = particlesMC.rawIteratorAt(arrDaughIndex[iProng]); + auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); arrPDGDaugh[iProng] = std::abs(daughI.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonant1[0] && arrPDGDaugh[1] == arrPDGResonant1[1]) || (arrPDGDaugh[0] == arrPDGResonant1[1] && arrPDGDaugh[1] == arrPDGResonant1[0])) { @@ -340,7 +340,7 @@ struct HfCandidateCreator3ProngExpressions { // Ξc± → p± K∓ π± if (flag == 0) { // Printf("Checking Ξc± → p± K∓ π±"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * (1 << DecayType::XicToPKPi); } @@ -348,15 +348,15 @@ struct HfCandidateCreator3ProngExpressions { // Check whether the particle is non-prompt (from a b quark). if (flag != 0) { - auto particle = particlesMC.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchRec(flag, origin, swapping, channel); } // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; @@ -365,19 +365,19 @@ struct HfCandidateCreator3ProngExpressions { // D± → π± K∓ π± // Printf("Checking D± → π± K∓ π±"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::DplusToPiKPi); } // Ds± → K± K∓ π± if (flag == 0) { // Printf("Checking Ds± → K± K∓ π±"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::DsToKKPi); RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == 2) { for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { - auto daughJ = particlesMC.rawIteratorAt(arrDaughIndex[jProng]); + auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[0])) { @@ -392,14 +392,14 @@ struct HfCandidateCreator3ProngExpressions { // Λc± → p± K∓ π± if (flag == 0) { // Printf("Checking Λc± → p± K∓ π±"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::LcToPKPi); // Printf("Flagging the different Λc± → p± K∓ π± decay channels"); RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == 2) { for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { - auto daughJ = particlesMC.rawIteratorAt(arrDaughIndex[jProng]); + auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); } if ((arrPDGDaugh[0] == arrPDGResonant1[0] && arrPDGDaugh[1] == arrPDGResonant1[1]) || (arrPDGDaugh[0] == arrPDGResonant1[1] && arrPDGDaugh[1] == arrPDGResonant1[0])) { @@ -416,14 +416,14 @@ struct HfCandidateCreator3ProngExpressions { // Ξc± → p± K∓ π± if (flag == 0) { // Printf("Checking Ξc± → p± K∓ π±"); - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * (1 << DecayType::XicToPKPi); } } // Check whether the particle is non-prompt (from a b quark). if (flag != 0) { - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchGen(flag, origin, channel); diff --git a/PWGHF/TableProducer/candidateCreatorB0.cxx b/PWGHF/TableProducer/candidateCreatorB0.cxx index 502b440ae9d..63ac2cbccab 100644 --- a/PWGHF/TableProducer/candidateCreatorB0.cxx +++ b/PWGHF/TableProducer/candidateCreatorB0.cxx @@ -68,7 +68,6 @@ struct HfCandidateCreatorB0 { o2::base::MatLayerCylSet* lut; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT; int runNumber; - double massPi = RecoDecay::getMassPDG(kPiPlus); double massD = RecoDecay::getMassPDG(pdg::Code::kDMinus); double massB0 = RecoDecay::getMassPDG(pdg::Code::kB0); @@ -76,11 +75,11 @@ struct HfCandidateCreatorB0 { double bz{0.}; using TracksWithSel = soa::Join; + using CandsDFiltered = soa::Filtered>; Filter filterSelectCandidates = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagD); - using CandsDFiltered = soa::Filtered>; - Preslice candsDPerCollision = aod::track_association::collisionId; + Preslice candsDPerCollision = aod::track_association::collisionId; Preslice trackIndicesPerCollision = aod::track_association::collisionId; OutputObj hMassDToPiKPi{TH1F("hMassDToPiKPi", "D^{#minus} candidates;inv. mass (p^{#minus} K^{#plus} #pi^{#minus}) (GeV/#it{c}^{2});entries", 500, 0., 5.)}; @@ -332,7 +331,7 @@ struct HfCandidateCreatorB0Expressions { void processMc(aod::HfCand3Prong const& dplus, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMc) + aod::McParticles const& mcParticles) { rowCandidateB0->bindExternalIndices(&tracks); rowCandidateB0->bindExternalIndices(&dplus); @@ -361,11 +360,11 @@ struct HfCandidateCreatorB0Expressions { // B0 → D- π+ → (π- K+ π-) π+ // Printf("Checking B0 → D- π+"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersB0, pdg::Code::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, pdg::Code::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // D- → π- K+ π- // Printf("Checking D- → π- K+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD, pdg::Code::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, pdg::Code::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * BIT(hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi); } else { @@ -376,10 +375,10 @@ struct HfCandidateCreatorB0Expressions { // B0 → Ds- π+ → (K- K+ π-) π+ if (!flag) { - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersB0, pdg::Code::kB0, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, pdg::Code::kB0, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Ds- → K- K+ π- - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersD, -pdg::Code::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, -pdg::Code::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * BIT(hf_cand_b0::DecayTypeMc::B0ToDsPiToKKPiPi); } @@ -397,10 +396,10 @@ struct HfCandidateCreatorB0Expressions { std::array bHadronMotherHypos = {pdg::Code::kB0, pdg::Code::kBS, pdg::Code::kLambdaB0}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); - int index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); + int index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); + int index1Mother = RecoDecay::getMother(mcParticles, particleProng1, bHadronMotherHypo, true); + int index2Mother = RecoDecay::getMother(mcParticles, particleProng2, bHadronMotherHypo, true); + int index3Mother = RecoDecay::getMother(mcParticles, particleProng3, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1 && index3Mother > -1) { @@ -416,16 +415,16 @@ struct HfCandidateCreatorB0Expressions { } // rec // Match generated particles. - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; // B0 → D- π+ - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kB0, std::array{-static_cast(pdg::Code::kDPlus), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kB0, std::array{-static_cast(pdg::Code::kDPlus), +kPiPlus}, true)) { // Match D- -> π- K+ π- - auto candDMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); + auto candDMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking D- -> π- K+ π-"); - if (RecoDecay::isMatchedMCGen(particlesMc, candDMC, -static_cast(pdg::Code::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, candDMC, -static_cast(pdg::Code::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) { flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi); } } diff --git a/PWGHF/TableProducer/candidateCreatorBplus.cxx b/PWGHF/TableProducer/candidateCreatorBplus.cxx index 341eff1eb74..c912a8d5f87 100644 --- a/PWGHF/TableProducer/candidateCreatorBplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorBplus.cxx @@ -331,7 +331,7 @@ struct HfCandidateCreatorBplusExpressions { void processMc(aod::HfCand2Prong const& dzero, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { rowCandidateBPlus->bindExternalIndices(&tracks); rowCandidateBPlus->bindExternalIndices(&dzero); @@ -355,8 +355,8 @@ struct HfCandidateCreatorBplusExpressions { // B± → D0bar(D0) π± → (K± π∓) π± // Printf("Checking B± → D0(bar) π±"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &signB, 2); - indexRecD0 = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersD0, -pdg::Code::kD0, std::array{+kKPlus, -kPiPlus}, true, &signD0, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &signB, 2); + indexRecD0 = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD0, -pdg::Code::kD0, std::array{+kKPlus, -kPiPlus}, true, &signD0, 1); if (indexRecD0 > -1 && indexRec > -1) { flag = signB * (1 << hf_cand_bplus::DecayType::BplusToD0Pi); @@ -365,7 +365,7 @@ struct HfCandidateCreatorBplusExpressions { } // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; @@ -376,13 +376,13 @@ struct HfCandidateCreatorBplusExpressions { // B± → D0bar(D0) π± → (K± π∓) π± // Printf("Checking B± → D0(bar) π±"); std::vector arrayDaughterB; - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kBPlus, std::array{-kD0pdg, +kPiPlus}, true, &signB, 1, &arrayDaughterB)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kBPlus, std::array{-kD0pdg, +kPiPlus}, true, &signB, 1, &arrayDaughterB)) { // D0(bar) → π± K∓ // Printf("Checking D0(bar) → π± K∓"); for (auto iD : arrayDaughterB) { - auto candDaughterMC = particlesMC.rawIteratorAt(iD); + auto candDaughterMC = mcParticles.rawIteratorAt(iD); if (std::abs(candDaughterMC.pdgCode()) == kD0pdg) { - indexGenD0 = RecoDecay::isMatchedMCGen(particlesMC, candDaughterMC, pdg::Code::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD0, 1); + indexGenD0 = RecoDecay::isMatchedMCGen(mcParticles, candDaughterMC, pdg::Code::kD0, std::array{-kKPlus, +kPiPlus}, true, &signD0, 1); } } if (indexGenD0 > -1) { diff --git a/PWGHF/TableProducer/candidateCreatorBs.cxx b/PWGHF/TableProducer/candidateCreatorBs.cxx index 874ede9ddb8..66e92b58704 100644 --- a/PWGHF/TableProducer/candidateCreatorBs.cxx +++ b/PWGHF/TableProducer/candidateCreatorBs.cxx @@ -327,7 +327,7 @@ struct HfCandidateCreatorBsExpressions { void processMc(aod::HfCand3Prong const& ds, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMc) + aod::McParticles const& mcParticles) { rowCandidateBs->bindExternalIndices(&tracks); rowCandidateBs->bindExternalIndices(&ds); @@ -354,15 +354,15 @@ struct HfCandidateCreatorBsExpressions { candDs.prong2_as()}; // Checking Bs0(bar) → Ds∓ π± → (K- K+ π∓) π± - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersBs, pdg::Code::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBs, pdg::Code::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Checking Ds∓ → K- K+ π∓ - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersDs, pdg::Code::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDs, pdg::Code::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { - RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); + RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { - auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]); + auto daughI = mcParticles.rawIteratorAt(arrDaughDsIndex[iProng]); arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode()); } if ((arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[0])) { @@ -374,15 +374,15 @@ struct HfCandidateCreatorBsExpressions { if (!flag) { // Checking B0(bar) → Ds± π∓ → (K- K+ π±) π∓ - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersBs, pdg::Code::kB0, std::array{-kKPlus, +kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBs, pdg::Code::kB0, std::array{-kKPlus, +kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Checking Ds± → K- K+ π± - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughtersDs, pdg::Code::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersDs, pdg::Code::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { - RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); + RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { - auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]); + auto daughI = mcParticles.rawIteratorAt(arrDaughDsIndex[iProng]); arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode()); } if ((arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[0])) { @@ -404,10 +404,10 @@ struct HfCandidateCreatorBsExpressions { std::array bHadronMotherHypos = {pdg::Code::kB0, pdg::Code::kBPlus, pdg::Code::kBS, pdg::Code::kLambdaB0}; for (const auto& bHadronMotherHypo : bHadronMotherHypos) { - int index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); - int index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); - int index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); - int index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); + int index0Mother = RecoDecay::getMother(mcParticles, particleProng0, bHadronMotherHypo, true); + int index1Mother = RecoDecay::getMother(mcParticles, particleProng1, bHadronMotherHypo, true); + int index2Mother = RecoDecay::getMother(mcParticles, particleProng2, bHadronMotherHypo, true); + int index3Mother = RecoDecay::getMother(mcParticles, particleProng3, bHadronMotherHypo, true); // look for common b-hadron ancestor if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1 && index3Mother > -1) { @@ -423,19 +423,19 @@ struct HfCandidateCreatorBsExpressions { } // rec // Match generated particles. - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { flag = 0; arrDaughDsIndex.clear(); // Checking Bs0(bar) → Ds∓ π± → (K- K+ π∓) π± - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kBS, std::array{+pdg::Code::kDSBar, +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kBS, std::array{+pdg::Code::kDSBar, +kPiPlus}, true)) { // Checking Ds∓ → K- K+ π∓ - auto candDsMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(particlesMc, candDsMC, pdg::Code::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2)) { + auto candDsMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); + if (RecoDecay::isMatchedMCGen(mcParticles, candDsMC, pdg::Code::kDSBar, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2)) { RecoDecay::getDaughters(candDsMC, &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { - auto daughJ = particlesMc.rawIteratorAt(arrDaughDsIndex[jProng]); + auto daughJ = mcParticles.rawIteratorAt(arrDaughDsIndex[jProng]); arrPDGDaughDs[jProng] = std::abs(daughJ.pdgCode()); } if ((arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[0])) { @@ -447,14 +447,14 @@ struct HfCandidateCreatorBsExpressions { if (!flag) { // Checking B0(bar) → Ds± π∓ → (K- K+ π±) π∓ - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kB0, std::array{+pdg::Code::kDS, -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kB0, std::array{+pdg::Code::kDS, -kPiPlus}, true)) { // Checking Ds± → K- K+ π± - auto candDsMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(particlesMc, candDsMC, pdg::Code::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2)) { + auto candDsMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); + if (RecoDecay::isMatchedMCGen(mcParticles, candDsMC, pdg::Code::kDS, std::array{-kKPlus, +kKPlus, +kPiPlus}, true, &sign, 2)) { RecoDecay::getDaughters(candDsMC, &arrDaughDsIndex, std::array{0}, 1); if (arrDaughDsIndex.size() == 2) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { - auto daughJ = particlesMc.rawIteratorAt(arrDaughDsIndex[jProng]); + auto daughJ = mcParticles.rawIteratorAt(arrDaughDsIndex[jProng]); arrPDGDaughDs[jProng] = std::abs(daughJ.pdgCode()); } if ((arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaughDs[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaughDs[1] == arrPDGResonantDsPhiPi[0])) { diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index a687e0e1df0..90458e5e781 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -261,7 +261,7 @@ struct HfCandidateCreatorCascadeMc { using MyTracksWMc = soa::Join; void processMc(MyTracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { int8_t sign = 0; int8_t origin = 0; @@ -297,20 +297,20 @@ struct HfCandidateCreatorCascadeMc { MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "correct K0S in the Lc daughters: posTrack --> " << indexV0DaughPos << ", negTrack --> " << indexV0DaughNeg); // if (isLc) { - RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersV0, kK0Short, std::array{+kPiPlus, -kPiPlus}, false, &sign, 1); + RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersV0, kK0Short, std::array{+kPiPlus, -kPiPlus}, false, &sign, 1); if (sign != 0) { // we have already positively checked the K0s // then we check the Lc MY_DEBUG_MSG(sign, LOG(info) << "K0S was correct! now we check the Lc"); MY_DEBUG_MSG(sign, LOG(info) << "index proton = " << indexBach); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, +kPiPlus, -kPiPlus}, true, &sign, 3); // 3-levels Lc --> p + K0 --> p + K0s --> p + pi+ pi- + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, +kPiPlus, -kPiPlus}, true, &sign, 3); // 3-levels Lc --> p + K0 --> p + K0s --> p + pi+ pi- MY_DEBUG_MSG(sign, LOG(info) << "Lc found with sign " << sign; printf("\n")); } // Check whether the particle is non-prompt (from a b quark). if (sign != 0) { - auto particle = particlesMC.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchRec(sign, origin); @@ -318,12 +318,12 @@ struct HfCandidateCreatorCascadeMc { //} // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { origin = 0; // checking if I have a Lc --> K0S + p - RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, +kK0Short}, false, &sign, 2); + RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, +kK0Short}, false, &sign, 2); if (sign == 0) { // now check for anti-Lc - RecoDecay::isMatchedMCGen(particlesMC, particle, -pdg::Code::kLambdaCPlus, std::array{-kProton, +kK0Short}, false, &sign, 2); + RecoDecay::isMatchedMCGen(mcParticles, particle, -pdg::Code::kLambdaCPlus, std::array{-kProton, +kK0Short}, false, &sign, 2); sign = -sign; } if (sign != 0) { @@ -333,7 +333,7 @@ struct HfCandidateCreatorCascadeMc { RecoDecay::getDaughters(particle, &arrDaughLcIndex, arrDaughLcPDGRef, 3); // best would be to check the K0S daughters if (arrDaughLcIndex.size() == 3) { for (std::size_t iProng = 0; iProng < arrDaughLcIndex.size(); ++iProng) { - auto daughI = particlesMC.rawIteratorAt(arrDaughLcIndex[iProng]); + auto daughI = mcParticles.rawIteratorAt(arrDaughLcIndex[iProng]); arrDaughLcPDG[iProng] = daughI.pdgCode(); } if (!(arrDaughLcPDG[0] == sign * arrDaughLcPDGRef[0] && arrDaughLcPDG[1] == arrDaughLcPDGRef[1] && arrDaughLcPDG[2] == arrDaughLcPDGRef[2])) { // this should be the condition, first bach, then v0 @@ -346,7 +346,7 @@ struct HfCandidateCreatorCascadeMc { } // Check whether the particle is non-prompt (from a b quark). if (sign != 0) { - origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } rowMcMatchGen(sign, origin); } diff --git a/PWGHF/TableProducer/candidateCreatorLb.cxx b/PWGHF/TableProducer/candidateCreatorLb.cxx index 73ea1a43a65..912869437f6 100644 --- a/PWGHF/TableProducer/candidateCreatorLb.cxx +++ b/PWGHF/TableProducer/candidateCreatorLb.cxx @@ -231,7 +231,7 @@ struct HfCandidateCreatorLbMc { void process(aod::HfCandLb const& candidates, aod::HfCand3Prong const&, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { int indexRec = -1; int8_t sign = 0; @@ -255,11 +255,11 @@ struct HfCandidateCreatorLbMc { lcCand.prong2_as()}; // Λb → Λc+ π- // Printf("Checking Λb → Λc+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 2); if (indexRec > -1) { // Λb → Λc+ π- // Printf("Checking Λb → Λc+ π-"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersLc, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); if (indexRec > -1) { flag = 1 << hf_cand_lb::DecayType::LbToLcPi; } else { @@ -271,16 +271,16 @@ struct HfCandidateCreatorLbMc { } // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; // Λb → Λc+ π- - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kLambdaB0, std::array{static_cast(pdg::Code::kLambdaCPlus), -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaB0, std::array{static_cast(pdg::Code::kLambdaCPlus), -kPiPlus}, true)) { // Match Λc+ -> pKπ - auto LcCandMC = particlesMC.rawIteratorAt(particle.daughtersIds().front()); + auto LcCandMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking Λc+ → p K- π+"); - if (RecoDecay::isMatchedMCGen(particlesMC, LcCandMC, static_cast(pdg::Code::kLambdaCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, LcCandMC, static_cast(pdg::Code::kLambdaCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { flag = sign * (1 << hf_cand_lb::DecayType::LbToLcPi); } } diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index 4e2908df9fe..a327fd0714f 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -38,7 +38,6 @@ using namespace o2::framework::expressions; using namespace o2::aod::hf_cand_3prong; struct HfCandidateCreatorSigmac0plusplus { - /// Table with Σc0,++ info Produces rowScCandidates; @@ -47,14 +46,12 @@ struct HfCandidateCreatorSigmac0plusplus { Configurable yCandLcMax{"yCandLcMax", -1., "max. candLc. Lc rapidity"}; Configurable mPKPiCandLcMax{"mPKPiCandLcMax", 0.03, "max. spread (abs. value) between PDG(Lc) and Minv(pKpi)"}; Configurable mPiKPCandLcMax{"mPiKPCandLcMax", 0.03, "max. spread (abs. value) between PDG(Lc) and Minv(piKp)"}; - /// Selections on candidate soft π-,+ Configurable softPiEtaMax{"softPiEtaMax", 0.9f, "Soft pion max value for pseudorapidity (abs vale)"}; Configurable softPiItsHitMap{"softPiItsHitMap", 127, "Soft pion ITS hitmap"}; Configurable softPiItsHitsMin{"softPiItsHitsMin", 1, "Minimum number of ITS layers crossed by the soft pion among those in \"softPiItsHitMap\""}; Configurable softPiDcaXYMax{"softPiDcaXYMax", 0.065, "Soft pion max dcaXY (cm)"}; Configurable softPiDcaZMax{"softPiDcaZMax", 0.065, "Soft pion max dcaZ (cm)"}; - // CCDB Configurable isRun2Ccdb{"isRun2Ccdb", false, "enable Run 2 or Run 3 GRP objects for magnetic field"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -62,9 +59,15 @@ struct HfCandidateCreatorSigmac0plusplus { Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; - HistogramRegistry histos; + /// Cut selection object for soft π-,+ + TrackSelection softPiCuts; + + // Needed for dcaXY, dcaZ recalculation of soft pions reassigned to a new collision + Service ccdb; + o2::base::MatLayerCylSet* lut; + o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; + int runNumber; - using TracksSigmac = soa::Join; using CandidatesLc = soa::Filtered>; /// Filter the candidate Λc+ used for the Σc0,++ creation @@ -75,14 +78,7 @@ struct HfCandidateCreatorSigmac0plusplus { // Preslice hf3ProngPerCollision = aod::track_association::collisionId; Preslice hf3ProngPerCollision = aod::hf_cand::collisionId; - /// Cut selection object for soft π-,+ - TrackSelection softPiCuts; - - // Needed for dcaXY, dcaZ recalculation of soft pions reassigned to a new collision - Service ccdb; - o2::base::MatLayerCylSet* lut; - o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; - int runNumber; + HistogramRegistry histos; /// @brief init function, to define the soft pion selections and histograms /// @param @@ -134,7 +130,7 @@ struct HfCandidateCreatorSigmac0plusplus { /// @param candidates are 3-prong candidates satisfying the analysis selections for Λc+ → pK-π+ (and charge conj.) void process(aod::Collisions const& collisions, aod::TrackAssoc const& trackIndices, - TracksSigmac const& tracks, + aod::TracksWDcaExtra const& tracks, CandidatesLc const& candidates, aod::BCsWithTimestamps const& bcWithTimeStamps) { @@ -178,7 +174,7 @@ struct HfCandidateCreatorSigmac0plusplus { auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); for (const auto& trackId : trackIdsThisCollision) { - auto trackSoftPi = trackId.track_as(); + auto trackSoftPi = trackId.track_as(); // auto trackSoftPi = tracks.rawIteratorAt(trackId.trackId()); histos.fill(HIST("hCounter"), 4); @@ -226,7 +222,7 @@ struct HfCandidateCreatorSigmac0plusplus { histos.fill(HIST("hCounter"), 5); /// determine the Σc candidate charge - int chargeLc = candLc.prong0_as().sign() + candLc.prong1_as().sign() + candLc.prong2_as().sign(); + int chargeLc = candLc.prong0_as().sign() + candLc.prong1_as().sign() + candLc.prong2_as().sign(); int chargeSoftPi = trackSoftPi.sign(); int8_t chargeSigmac = chargeLc + chargeSoftPi; if (std::abs(chargeSigmac) != 0 && std::abs(chargeSigmac) != 2) { @@ -258,14 +254,12 @@ struct HfCandidateCreatorSigmac0plusplus { /// Extends the base table with expression columns. struct HfCandidateSigmac0plusplusMc { - Spawns candidatesSigmac; Produces rowMCMatchScRec; Produces rowMCMatchScGen; using LambdacMc = soa::Join; // using LambdacMcGen = soa::Join; - using TracksMC = soa::Join; /// @brief init function void init(InitContext const&) {} @@ -276,9 +270,9 @@ struct HfCandidateSigmac0plusplusMc { /// @brief process function for MC matching of Σc0,++ → Λc+(→pK-π+) π- reconstructed candidates and counting of generated ones /// @param candidatesSigmac reconstructed Σc0,++ candidates - /// @param particlesMc table of generated particles - void processMc(aod::McParticles const& particlesMc, - TracksMC const& tracks, + /// @param mcParticles table of generated particles + void processMc(aod::McParticles const& mcParticles, + aod::TracksWMc const& tracks, LambdacMc const& /*, const LambdacMcGen&*/) { @@ -308,10 +302,10 @@ struct HfCandidateSigmac0plusplusMc { } /// matching to MC - auto arrayDaughters = std::array{candLc.prong0_as(), - candLc.prong1_as(), - candLc.prong2_as(), - candSigmac.prong1_as()}; + auto arrayDaughters = std::array{candLc.prong0_as(), + candLc.prong1_as(), + candLc.prong2_as(), + candSigmac.prong1_as()}; chargeSigmac = candSigmac.charge(); if (chargeSigmac == 0) { /// candidate Σc0 @@ -319,7 +313,7 @@ struct HfCandidateSigmac0plusplusMc { /// 1. Σc0 → Λc+ π-,+ /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughters, pdg::Code::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kSigmaC0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); } @@ -329,7 +323,7 @@ struct HfCandidateSigmac0plusplusMc { /// 1. Σc0 → Λc+ π-,+ /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ - indexRec = RecoDecay::getMatchedMCRec(particlesMc, arrayDaughters, pdg::Code::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kSigmaCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 3); if (indexRec > -1) { /// due to (*) no need to check anything for LambdaC flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); } @@ -337,8 +331,8 @@ struct HfCandidateSigmac0plusplusMc { /// check the origin (prompt vs. non-prompt) if (flag != 0) { - auto particle = particlesMc.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(particlesMc, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } /// fill the table with results of reconstruction level MC matching @@ -346,7 +340,7 @@ struct HfCandidateSigmac0plusplusMc { } /// end loop over reconstructed Σc0,++ candidates /// Match generated Σc0,++ candidates - for (const auto& particle : particlesMc) { + for (const auto& particle : mcParticles) { flag = 0; origin = 0; @@ -355,7 +349,7 @@ struct HfCandidateSigmac0plusplusMc { /// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii) /// 3. in case of (ii): resonant channel to pK-π+ /// → here we check level 1. first, and then levels 2. and 3. are inherited by the Λc+ → pK-π+ MC matching in candidateCreator3Prong.cxx - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kSigmaC0, std::array{static_cast(pdg::Code::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kSigmaC0, std::array{static_cast(pdg::Code::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { // generated Σc0 // for (const auto& daughter : particle.daughters_as()) { for (const auto& daughter : particle.daughters_as()) { @@ -363,13 +357,13 @@ struct HfCandidateSigmac0plusplusMc { if (std::abs(daughter.pdgCode()) != pdg::Code::kLambdaCPlus) continue; // if (std::abs(daughter.flagMcMatchGen()) == (1 << DecayType::LcToPKPi)) { - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * (1 << aod::hf_cand_sigmac::DecayType::Sc0ToPKPiPi); break; } } - } else if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kSigmaCPlusPlus, std::array{static_cast(pdg::Code::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { + } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kSigmaCPlusPlus, std::array{static_cast(pdg::Code::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { // generated Σc++ // for (const auto& daughter : particle.daughters_as()) { for (const auto& daughter : particle.daughters_as()) { @@ -377,7 +371,7 @@ struct HfCandidateSigmac0plusplusMc { if (std::abs(daughter.pdgCode()) != pdg::Code::kLambdaCPlus) continue; // if (std::abs(daughter.flagMcMatchGen()) == (1 << DecayType::LcToPKPi)) { - if (RecoDecay::isMatchedMCGen(particlesMc, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { /// Λc+ daughter decaying in pK-π+ found! flag = sign * (1 << aod::hf_cand_sigmac::DecayType::ScplusplusToPKPiPi); break; @@ -387,22 +381,21 @@ struct HfCandidateSigmac0plusplusMc { /// check the origin (prompt vs. non-prompt) if (flag != 0) { - auto particle = particlesMc.rawIteratorAt(indexRec); - origin = RecoDecay::getCharmHadronOrigin(particlesMc, particle); + auto particle = mcParticles.rawIteratorAt(indexRec); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); } /// fill the table with results of generation level MC matching rowMCMatchScGen(flag, origin); - } /// end loop over particlesMc + } /// end loop over mcParticles } /// end processMc PROCESS_SWITCH(HfCandidateSigmac0plusplusMc, processMc, "Process MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{ + return WorkflowSpec{ adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; - return workflow; } diff --git a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx index 3fbbee1fa4a..bf8e197683a 100644 --- a/PWGHF/TableProducer/candidateCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorToXiPi.cxx @@ -437,7 +437,7 @@ struct HfCandidateCreatorToXiPiMc { void processMc(aod::HfCandToXiPi const& candidates, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { int indexRec = -1; int8_t sign = -9; @@ -476,21 +476,21 @@ struct HfCandidateCreatorToXiPiMc { if (matchOmegacMc) { // Omegac → pi pi pi p // Printf("Checking Omegac → pi pi pi p"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdgCodeOmegac0, std::array{pdgCodePiPlus, pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeOmegac0, std::array{pdgCodePiPlus, pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 3); if (indexRec == -1) { debug = 1; } if (indexRec > -1) { // cascade → lambda pi // Printf("Checking cascade → pi pi p"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersCasc, pdgCodeXiMinus, std::array{pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersCasc, pdgCodeXiMinus, std::array{pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 2); if (indexRec == -1) { debug = 2; } if (indexRec > -1) { // v0 → p pi // Printf("Checking v0 → p pi"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersV0, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersV0, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true, &sign, 1); if (indexRec == -1) { debug = 3; } @@ -505,21 +505,21 @@ struct HfCandidateCreatorToXiPiMc { if (matchXicMc) { // Xic → pi pi pi p // Printf("Checking Xic → pi pi pi p"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdgCodeXic0, std::array{pdgCodePiPlus, pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeXic0, std::array{pdgCodePiPlus, pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 3); if (indexRec == -1) { debug = 1; } if (indexRec > -1) { // cascade → lambda pi // Printf("Checking cascade → pi pi p"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersCasc, pdgCodeXiMinus, std::array{pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersCasc, pdgCodeXiMinus, std::array{pdgCodePiMinus, pdgCodeProton, pdgCodePiMinus}, true, &sign, 2); if (indexRec == -1) { debug = 2; } if (indexRec > -1) { // v0 → p pi // Printf("Checking v0 → p pi"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersV0, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersV0, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true, &sign, 1); if (indexRec == -1) { debug = 3; } @@ -538,7 +538,7 @@ struct HfCandidateCreatorToXiPiMc { } // close loop over candidates // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = -9; sign = -9; @@ -548,16 +548,16 @@ struct HfCandidateCreatorToXiPiMc { // origin = 0; if (matchOmegacMc) { // Omegac → Xi pi - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdgCodeOmegac0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeOmegac0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) { debugGenCharmBar = 1; // Match Xi -> lambda pi - auto cascMC = particlesMC.rawIteratorAt(particle.daughtersIds().front()); + auto cascMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking cascade → lambda pi"); - if (RecoDecay::isMatchedMCGen(particlesMC, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) { debugGenXi = 1; // lambda -> p pi - auto v0MC = particlesMC.rawIteratorAt(cascMC.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(particlesMC, v0MC, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true)) { + auto v0MC = mcParticles.rawIteratorAt(cascMC.daughtersIds().front()); + if (RecoDecay::isMatchedMCGen(mcParticles, v0MC, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true)) { debugGenLambda = 1; flag = sign * (1 << DecayType::OmegaczeroToXiPi); } @@ -566,16 +566,16 @@ struct HfCandidateCreatorToXiPiMc { } if (matchXicMc) { // Xic → Xi pi - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdgCodeXic0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeXic0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) { debugGenCharmBar = 1; // Match Xi -> lambda pi - auto cascMC = particlesMC.rawIteratorAt(particle.daughtersIds().front()); + auto cascMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking cascade → lambda pi"); - if (RecoDecay::isMatchedMCGen(particlesMC, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) { debugGenXi = 1; // lambda -> p pi - auto v0MC = particlesMC.rawIteratorAt(cascMC.daughtersIds().front()); - if (RecoDecay::isMatchedMCGen(particlesMC, v0MC, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true)) { + auto v0MC = mcParticles.rawIteratorAt(cascMC.daughtersIds().front()); + if (RecoDecay::isMatchedMCGen(mcParticles, v0MC, pdgCodeLambda, std::array{pdgCodeProton, pdgCodePiMinus}, true)) { debugGenLambda = 1; flag = sign * (1 << DecayType::XiczeroToXiPi); } diff --git a/PWGHF/TableProducer/candidateCreatorXicc.cxx b/PWGHF/TableProducer/candidateCreatorXicc.cxx index 49142a82688..a46e7251ebd 100644 --- a/PWGHF/TableProducer/candidateCreatorXicc.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicc.cxx @@ -205,7 +205,7 @@ struct HfCandidateCreatorXiccMc { void process(aod::HfCandXicc const& candidates, aod::HfCand3Prong const&, aod::TracksWMc const& tracks, - aod::McParticles const& particlesMC) + aod::McParticles const& mcParticles) { int indexRec = -1; int8_t sign = 0; @@ -229,11 +229,11 @@ struct HfCandidateCreatorXiccMc { xicCand.prong2_as()}; // Ξcc±± → p± K∓ π± π± // Printf("Checking Ξcc±± → p± K∓ π± π±"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kXiCCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg::Code::kXiCCPlusPlus, std::array{+kProton, -kKPlus, +kPiPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { // Ξc± → p± K∓ π± // Printf("Checking Ξc± → p± K∓ π±"); - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughtersXic, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersXic, pdg::Code::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 1); if (indexRec > -1) { flag = 1 << DecayType::XiccToXicPi; } else { @@ -245,16 +245,16 @@ struct HfCandidateCreatorXiccMc { } // Match generated particles. - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { // Printf("New gen. candidate"); flag = 0; origin = 0; // Xicc → Xic + π+ - if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kXiCCPlusPlus, std::array{static_cast(pdg::Code::kXiCPlus), +kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kXiCCPlusPlus, std::array{static_cast(pdg::Code::kXiCPlus), +kPiPlus}, true)) { // Match Xic -> pKπ - auto XicCandMC = particlesMC.rawIteratorAt(particle.daughtersIds().front()); + auto XicCandMC = mcParticles.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking Ξc± → p± K∓ π±"); - if (RecoDecay::isMatchedMCGen(particlesMC, XicCandMC, static_cast(pdg::Code::kXiCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { + if (RecoDecay::isMatchedMCGen(mcParticles, XicCandMC, static_cast(pdg::Code::kXiCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign)) { flag = sign * (1 << DecayType::XiccToXicPi); } } diff --git a/PWGHF/TableProducer/candidateSelectorLcMl.cxx b/PWGHF/TableProducer/candidateSelectorLcMl.cxx index 945ff3d0bf7..06c582d1242 100644 --- a/PWGHF/TableProducer/candidateSelectorLcMl.cxx +++ b/PWGHF/TableProducer/candidateSelectorLcMl.cxx @@ -64,17 +64,16 @@ struct HfCandidateSelectorLcMl { Configurable onnxFileLcToPiKPConf{"onnxFileLcToPiKPConf", "/cvmfs/alice.cern.ch/data/analysis/2022/vAN-20220818/PWGHF/o2/trigger/ModelHandler_onnx_LcToPKPi.onnx", "ONNX file for ML model for Lc+ candidates"}; Configurable> thresholdBDTScoreLcToPiKP{"thresholdBDTScoreLcToPiKP", {hf_cuts_bdt_multiclass::cuts[0], hf_cuts_bdt_multiclass::nBinsPt, hf_cuts_bdt_multiclass::nCutBdtScores, hf_cuts_bdt_multiclass::labelsPt, hf_cuts_bdt_multiclass::labelsCutBdt}, "Threshold values for BDT output scores of Lc+ candidates"}; - o2::ccdb::CcdbApi ccdbApi; Configurable url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable mlModelPathCCDB{"mlModelPathCCDB", "Analysis/PWGHF/ML/HFTrigger/Lc", "Path on CCDB"}; Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; Configurable activateQA{"activateQA", false, "flag to enable QA histos"}; - HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + int dataTypeML; + o2::ccdb::CcdbApi ccdbApi; OnnxModel model; - TrackSelectorPi selectorPion; TrackSelectorKa selectorKaon; TrackSelectorPr selectorProton; @@ -83,6 +82,8 @@ struct HfCandidateSelectorLcMl { aod::TracksPidPi, aod::TracksPidKa, aod::TracksPidPr, aod::pidBayesPi, aod::pidBayesKa, aod::pidBayesPr, aod::pidBayes>; + HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + void init(InitContext&) { selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index 16d5018b02d..41bb32592b2 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -207,26 +207,25 @@ struct HfTreeCreatorDsToKKPi { Configurable decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds->PhiPi->KKpi, 2 for Ds->K0*K->KKPi"}; Configurable selectionFlagDs{"selectionFlagDs", 1, "Selection flag for Ds"}; Configurable fillCandidateLiteTable{"fillCandidateLiteTable", false, "Switch to fill lite table with candidate properties"}; - // parameters for production of training samples Configurable fillOnlySignal{"fillOnlySignal", false, "Flag to fill derived tables with signal for ML trainings"}; Configurable fillOnlyBackground{"fillOnlyBackground", false, "Flag to fill derived tables with background for ML trainings"}; Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; - using candDsData = soa::Filtered>; - using candDsMcReco = soa::Filtered>; - using candDsMcGen = soa::Filtered>; + using CandDsData = soa::Filtered>; + using CandDsMcReco = soa::Filtered>; + using CandDsMcGen = soa::Filtered>; using TracksWPid = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanGen == decayChannel; - Partition selectedDsToKKPiCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs; - Partition selectedDsToPiKKCand = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; + Partition selectedDsToKKPiCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs; + Partition selectedDsToPiKKCand = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel; - Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(DecayType::DsToKKPi)); + Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel; + Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(DecayType::DsToKKPi)); void init(InitContext const&) { @@ -383,7 +382,7 @@ struct HfTreeCreatorDsToKKPi { } void processData(aod::Collisions const& collisions, - candDsData const& candidates, + CandDsData const& candidates, TracksWPid const&) { // Filling event properties @@ -424,8 +423,8 @@ struct HfTreeCreatorDsToKKPi { void processMc(aod::Collisions const& collisions, aod::McCollisions const&, - candDsMcReco const& candidates, - candDsMcGen const& particlesMC, + CandDsMcReco const& candidates, + CandDsMcGen const& mcParticles, TracksWPid const&) { // Filling event properties @@ -500,8 +499,8 @@ struct HfTreeCreatorDsToKKPi { } // Filling particle properties - rowCandidateFullParticles.reserve(particlesMC.size()); - for (const auto& particle : particlesMC) { + rowCandidateFullParticles.reserve(mcParticles.size()); + for (const auto& particle : mcParticles) { rowCandidateFullParticles( particle.mcCollision().bcId(), particle.pt(), diff --git a/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx b/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx index e23c2b68323..9b8b0c33461 100644 --- a/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLbToLcPi.cxx @@ -182,7 +182,7 @@ DECLARE_SOA_INDEX_TABLE_USER(HfTrackIndexALICE3PID, Tracks, "HFTRKIDXA3PID", //! struct HfTreeCreatorLbToLcPiAlice3PidIndexBuilder { Builds index; - void init(o2::framework::InitContext&) {} + void init(InitContext&) {} }; /// Writes the full information in an output TTree diff --git a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx index 932d69808b5..740965aeba1 100644 --- a/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToK0sP.cxx @@ -262,7 +262,7 @@ struct HfTreeCreatorLcToK0sP { } void processMc(aod::Collisions const& collisions, - aod::McCollisions const& mccollisions, + aod::McCollisions const& mcCollisions, soa::Join const& candidates, soa::Join const& particles, TracksWPid const& tracks) diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index a405c537a1e..2fbd6e4c6e1 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -194,7 +194,7 @@ struct HfTreeCreatorLcToPKPi { } void processMc(aod::Collisions const& collisions, - aod::McCollisions const& mccollisions, + aod::McCollisions const& mcCollisions, soa::Join const& candidates, soa::Join const& particles, TracksWPid const& tracks, aod::BCs const&) diff --git a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx index 852e71cb32a..430f4c9a520 100644 --- a/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToPKPi.cxx @@ -195,7 +195,7 @@ struct HfTreeCreatorXicToPKPi { } void processMc(aod::Collisions const& collisions, - aod::McCollisions const& mccollisions, + aod::McCollisions const& mcCollisions, soa::Join const& candidates, soa::Join const& particles, TracksWPid const& tracks) diff --git a/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx b/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx index 29d44c853e5..de5c6b3cf41 100644 --- a/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXiccToPKPiPi.cxx @@ -169,7 +169,7 @@ struct HfTreeCreatorXiccToPKPiPi { } void process(aod::Collisions const& collisions, - aod::McCollisions const& mccollisions, + aod::McCollisions const& mcCollisions, soa::Join const& candidates, soa::Join const& particles, TracksWPid const& tracks, diff --git a/PWGHF/Tasks/taskLcCentrality.cxx b/PWGHF/Tasks/taskLcCentrality.cxx index 87b65e3491a..26d453ca3d2 100644 --- a/PWGHF/Tasks/taskLcCentrality.cxx +++ b/PWGHF/Tasks/taskLcCentrality.cxx @@ -54,7 +54,7 @@ struct HfTaskLcCentrality { {"hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, {"hCentrality", "centrality;centrality percentile;entries", {HistType::kTH1F, {{100, 0., 100.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hMass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}; centrality", {HistType::kTH3F, {{500, 1.6, 3.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {100, 0., 100.}}}); @@ -130,7 +130,7 @@ struct HfTaskLcCentralityMc { {"hEtaRecBg", "3-prong candidates (unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, {"hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { auto vbins = (std::vector)binsPt; registry.add("hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -144,7 +144,7 @@ struct HfTaskLcCentralityMc { } void process(soa::Filtered> const& candidates, - soa::Join const& particlesMC, + soa::Join const& mcParticles, aod::TracksWMc const& tracks) { // MC rec. @@ -158,8 +158,8 @@ struct HfTaskLcCentralityMc { } if (std::abs(candidate.flagMcMatchRec()) == 1 << DecayType::LcToPKPi) { // Get the corresponding MC particle. - auto indexMother = RecoDecay::getMother(particlesMC, candidate.prong0_as().mcParticle_as>(), pdg::Code::kLambdaCPlus, true); - auto particleMother = particlesMC.rawIteratorAt(indexMother); + auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong0_as().mcParticle_as>(), pdg::Code::kLambdaCPlus, true); + auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT auto ptRec = candidate.pt(); registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT @@ -177,8 +177,8 @@ struct HfTaskLcCentralityMc { } } // MC gen. - // Printf("MC Particles: %d", particlesMC.size()); - for (const auto& particle : particlesMC) { + // Printf("MC Particles: %d", mcParticles.size()); + for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << DecayType::LcToPKPi) { if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > yCandMax) { continue; diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index 4206a66e17a..d27802350d7 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -118,7 +118,7 @@ struct HfTaskMcValidationGen { {"hNonPromptCharmHadronsYDistr", "Y distribution vs non-prompt charm hadron; ; #it{y}^{gen}", {HistType::kTH2F, {axisSpecies, axisY}}}, {"hNonPromptCharmHadronsDecLenDistr", "Decay length distribution vs non-prompt charm hadron; ; decay length (#mum)", {HistType::kTH2F, {axisSpecies, axisDecLen}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { for (auto iBin = 1; iBin <= nCharmHadrons; ++iBin) { registry.get(HIST("hPromptCharmHadronsPtDistr"))->GetXaxis()->SetBinLabel(iBin, labels[iBin - 1].data()); @@ -131,7 +131,7 @@ struct HfTaskMcValidationGen { } /// Primary-vertex selection - /// \param collision mccollision table row + /// \param collision mcCollision table row template bool selectVertex(const Col& collision) { @@ -150,10 +150,10 @@ struct HfTaskMcValidationGen { return true; } - void process(aod::McCollision const& mccollision, - aod::McParticles const& particlesMC) + void process(aod::McCollision const& mcCollision, + aod::McParticles const& mcParticles) { - if (!selectVertex(mccollision)) { + if (!selectVertex(mcCollision)) { return; } @@ -164,7 +164,7 @@ struct HfTaskMcValidationGen { std::array counterPrompt{0}, counterNonPrompt{0}; bool hasSignal = false; - for (const auto& particle : particlesMC) { + for (const auto& particle : mcParticles) { if (!particle.has_mothers()) { continue; } @@ -211,7 +211,7 @@ struct HfTaskMcValidationGen { double sumPzDau = 0.; bool momentumCheck = true; for (std::size_t iDau = 0; iDau < listDaughters.size(); ++iDau) { - auto daughter = particlesMC.rawIteratorAt(listDaughters.at(iDau) - particlesMC.offset()); + auto daughter = mcParticles.rawIteratorAt(listDaughters.at(iDau) - mcParticles.offset()); sumPxDau += daughter.px(); sumPyDau += daughter.py(); sumPzDau += daughter.pz(); @@ -236,7 +236,7 @@ struct HfTaskMcValidationGen { } hasSignal = true; - int origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle); + int origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle); if (origin == RecoDecay::OriginType::Prompt) { counterPrompt[iD]++; } else if (origin == RecoDecay::OriginType::NonPrompt) { @@ -245,7 +245,7 @@ struct HfTaskMcValidationGen { auto daughter0 = particle.daughters_as().begin(); double vertexDau[3] = {daughter0.vx(), daughter0.vy(), daughter0.vz()}; - double vertexPrimary[3] = {mccollision.posX(), mccollision.posY(), mccollision.posZ()}; + double vertexPrimary[3] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; auto decayLength = RecoDecay::distance(vertexPrimary, vertexDau); if (origin == RecoDecay::OriginType::Prompt) { if (std::abs(particle.y()) < 0.5) { @@ -358,7 +358,7 @@ struct HfTaskMcValidationRec { return stdev; } - void init(o2::framework::InitContext&) + void init(InitContext&) { histOriginTracks[0] = registry.add("histOriginNonAssociatedTracks", ";origin;#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm); is PV contributor; has TOF; number of ITS hits", HistType::kTHnSparseF, {axisOrigin, axisPt, axisEta, axisDeltaVtx, axisDecision, axisDecision, axisITShits}); // tracks not associated to any collision histOriginTracks[1] = registry.add("histOriginAssociatedTracks", ";origin;#it{p}_{T}^{reco} (GeV/#it{c});#it{#eta}^{reco};#it{Z}_{vtx}^{reco}#minus#it{Z}_{vtx}^{gen} (cm); is PV contributor; has TOF; number of ITS hits", HistType::kTHnSparseF, {axisOrigin, axisPt, axisEta, axisDeltaVtx, axisDecision, axisDecision, axisITShits}); // tracks associasted to a collision @@ -406,7 +406,7 @@ struct HfTaskMcValidationRec { void process(HfCand2ProngWithMCRec const& cand2Prongs, HfCand3ProngWithMCRec const& cand3Prongs, TracksWithSel const& tracks, - aod::McParticles const& particlesMC, + aod::McParticles const& mcParticles, McCollisionWithHFSignalInfo const& mcCollisions, CollisionsWithMCLabels const& collisions, aod::BCs const&) @@ -454,7 +454,7 @@ struct HfTaskMcValidationRec { for (const auto& trackColl1 : tracksColl1) { if (trackColl1.has_mcParticle() && trackColl1.isPVContributor()) { auto particleColl1 = trackColl1.mcParticle(); - auto origin = RecoDecay::getCharmHadronOrigin(particlesMC, particleColl1, true); + auto origin = RecoDecay::getCharmHadronOrigin(mcParticles, particleColl1, true); if (origin == RecoDecay::NonPrompt) { nFromBeautyColl1++; } @@ -464,7 +464,7 @@ struct HfTaskMcValidationRec { for (const auto& trackColl2 : tracksColl2) { if (trackColl2.has_mcParticle() && trackColl2.isPVContributor()) { auto particleColl2 = trackColl2.mcParticle(); - auto origin = RecoDecay::getCharmHadronOrigin(particlesMC, particleColl2, true); + auto origin = RecoDecay::getCharmHadronOrigin(mcParticles, particleColl2, true); if (origin == RecoDecay::NonPrompt) { nFromBeautyColl2++; } @@ -495,7 +495,7 @@ struct HfTaskMcValidationRec { continue; } } - auto origin = RecoDecay::getCharmHadronOrigin(particlesMC, particle, true); + auto origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, true); histTracks->Fill(origin, track.pt()); bool isAmbiguous = (track.compatibleCollIds().size() != 1); if (isAmbiguous) { @@ -569,9 +569,9 @@ struct HfTaskMcValidationRec { if (whichHad >= 0 && whichOrigin >= 0) { int indexParticle = 0; if (cand2Prong.prong0_as().has_mcParticle()) { - indexParticle = RecoDecay::getMother(particlesMC, cand2Prong.prong0_as().mcParticle(), PDGArrayParticle[whichHad], true); + indexParticle = RecoDecay::getMother(mcParticles, cand2Prong.prong0_as().mcParticle(), PDGArrayParticle[whichHad], true); } - auto mother = particlesMC.rawIteratorAt(indexParticle); + auto mother = mcParticles.rawIteratorAt(indexParticle); histDeltaPt[whichHad]->Fill(cand2Prong.pt() - mother.pt()); histDeltaPx[whichHad]->Fill(cand2Prong.px() - mother.px()); histDeltaPy[whichHad]->Fill(cand2Prong.py() - mother.py()); @@ -634,9 +634,9 @@ struct HfTaskMcValidationRec { if (whichHad >= 0) { int indexParticle = 0; if (cand3Prong.prong0_as().has_mcParticle()) { - indexParticle = RecoDecay::getMother(particlesMC, cand3Prong.prong0_as().mcParticle(), PDGArrayParticle[whichHad], true); + indexParticle = RecoDecay::getMother(mcParticles, cand3Prong.prong0_as().mcParticle(), PDGArrayParticle[whichHad], true); } - auto mother = particlesMC.rawIteratorAt(indexParticle); + auto mother = mcParticles.rawIteratorAt(indexParticle); histDeltaPt[whichHad]->Fill(cand3Prong.pt() - mother.pt()); histDeltaPx[whichHad]->Fill(cand3Prong.px() - mother.px()); histDeltaPy[whichHad]->Fill(cand3Prong.py() - mother.py()); diff --git a/Tutorials/PWGHF/taskMini.cxx b/Tutorials/PWGHF/taskMini.cxx index 8cb8633a255..92f0b421559 100644 --- a/Tutorials/PWGHF/taskMini.cxx +++ b/Tutorials/PWGHF/taskMini.cxx @@ -71,7 +71,7 @@ struct HfTagSelTracks { "registry", {}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { const TString strTitle = "D^{0} candidates"; const TString strPt = "#it{p}_{T}^{track} (GeV/#it{c})"; @@ -163,7 +163,7 @@ struct HfTrackIndexSkimCreator { {"hVtx2ProngZ", "2-prong candidates;#it{z}_{sec. vtx.} (cm);entries", {HistType::kTH1F, {{1000, -20., 20.}}}}, {"hMassD0ToPiK", "D^{0} candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}}}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { } @@ -566,7 +566,7 @@ struct HfTaskD0 { "registry", {}}; - void init(o2::framework::InitContext&) + void init(InitContext&) { const TString strTitle = "D^{0} candidates"; const TString strPt = "#it{p}_{T} (GeV/#it{c})";