diff --git a/Common/Tools/aodDataModelGraph.cxx b/Common/Tools/aodDataModelGraph.cxx index 43f355e1589..e857a80f166 100644 --- a/Common/Tools/aodDataModelGraph.cxx +++ b/Common/Tools/aodDataModelGraph.cxx @@ -281,8 +281,8 @@ int main(int, char**) displayEntities(); - displayEntities(); - displayEntities(); + displayEntities(); + displayEntities(); graphFooter(); return 0; diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 0647f791768..ceb06a44cc6 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -225,8 +225,8 @@ struct AddCollisionId { Produces colls2Prong; Produces colls3Prong; - void process(aod::HfTrackIndexProng2 const& cand2Prongs, - aod::HfTrackIndexProng3 const& cand3Prongs, + void process(aod::Hf2Prong const& cand2Prongs, + aod::Hf3Prong const& cand3Prongs, aod::Tracks const&) { for (const auto& cand2Prong : cand2Prongs) { @@ -572,7 +572,7 @@ struct HfFilter { // Main struct for HF triggers /// \param CharmCandMomentum is the three momentum of a charm candidate /// \param CharmMass is the mass of the charm hadron /// \return relative momentum of pair - template //template + template // template float computeRelativeMomentum(const T& track, const std::array& CharmCandMomentum, const float& CharmMass) { ROOT::Math::PxPyPzMVector part1(track.px(), track.py(), track.pz(), massProton); @@ -586,10 +586,10 @@ struct HfFilter { // Main struct for HF triggers float kStar = 0.5 * trackRelK.P(); return kStar; - } //float computeRelativeMomentum(const T& track, const std::array& CharmCandMomentum, const float& CharmMass) + } // float computeRelativeMomentum(const T& track, const std::array& CharmCandMomentum, const float& CharmMass) - using HfTrackIndexProng2withColl = soa::Join; - using HfTrackIndexProng3withColl = soa::Join; + using HfTrackIndexProng2withColl = soa::Join; + using HfTrackIndexProng3withColl = soa::Join; using BigTracksWithProtonPID = soa::Join; using BigTracksMCPID = soa::Join; @@ -863,8 +863,8 @@ struct HfFilter { // Main struct for HF triggers } } - void processTraining(aod::HfTrackIndexProng2 const& cand2Prongs, - aod::HfTrackIndexProng3 const& cand3Prongs, + void processTraining(aod::Hf2Prong const& cand2Prongs, + aod::Hf3Prong const& cand3Prongs, aod::McParticles_000 const& particlesMC, BigTracksMCPID const&) { @@ -918,7 +918,7 @@ struct HfFilter { // Main struct for HF triggers } if (indexRec < 0) { // Ds± → K± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); //TODO: replace hard coded pdg code + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); // TODO: replace hard coded pdg code if (indexRec >= 0) { channel = kDs; } diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index db8629dd822..aba3a1f7183 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -64,12 +64,11 @@ using BigTracksPIDExtended = soa::Join; namespace hf_track_index { -DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(Index3, index3, int, Tracks, "_3"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(IndexV0, indexV0, int, aod::V0Datas, "_V0"); //! -DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //! +DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //! Index to first prong +DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //! Index to second prong +DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //! Index to third prong +DECLARE_SOA_INDEX_COLUMN(V0, v0); //! Index to V0 prong +DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //! DECLARE_SOA_COLUMN(D0ToKPiFlag, d0ToKPiFlag, uint8_t); //! DECLARE_SOA_COLUMN(JpsiToEEFlag, jpsiToEEFlag, uint8_t); //! @@ -81,27 +80,40 @@ DECLARE_SOA_COLUMN(DsKKPiFlag, dsKKPiFlag, uint8_t); //! DECLARE_SOA_COLUMN(XicToPKPiFlag, xicToPKPiFlag, uint8_t); //! } // namespace hf_track_index -DECLARE_SOA_TABLE(HfTrackIndexProng2, "AOD", "HFTRACKIDXP2", //! +DECLARE_SOA_TABLE(Hf2Prong, "AOD", "HF2PRONG", //! Table for HF 2 prong candidates + o2::soa::Index<>, hf_track_index::Index0Id, hf_track_index::Index1Id, hf_track_index::HFflag); -DECLARE_SOA_TABLE(HfTrackIndexCasc, "AOD", "HFTRACKIDXCASC", //! +DECLARE_SOA_TABLE(HfCascade, "AOD", "HFCASCADE", //! Table for HF candidates with a V0 + o2::soa::Index<>, hf_track_index::Index0Id, - hf_track_index::IndexV0Id, + hf_track_index::V0Id, hf_track_index::HFflag); -DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //! - hf_track_index::D0ToKPiFlag, - hf_track_index::JpsiToEEFlag, - hf_track_index::JpsiToMuMuFlag); - -DECLARE_SOA_TABLE(HfTrackIndexProng3, "AOD", "HFTRACKIDXP3", //! +DECLARE_SOA_TABLE(Hf3Prong, "AOD", "HF3PRONG", //! Table for HF 3 prong candidates + o2::soa::Index<>, hf_track_index::Index0Id, hf_track_index::Index1Id, hf_track_index::Index2Id, hf_track_index::HFflag); +namespace hf_track_index +{ +DECLARE_SOA_INDEX_COLUMN_FULL(IndexD0, indexD0, int, Hf2Prong, ""); //! Index to a D0 prong +} // namespace hf_track_index + +DECLARE_SOA_TABLE(HfDStar, "AOD", "HFDSTAR", //! D* -> D0pi candidates + o2::soa::Index<>, + hf_track_index::Index0Id, + hf_track_index::IndexD0Id); + +DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //! + hf_track_index::D0ToKPiFlag, + hf_track_index::JpsiToEEFlag, + hf_track_index::JpsiToMuMuFlag); + DECLARE_SOA_TABLE(HfCutStatusProng3, "AOD", "HFCUTSTATUSP3", //! hf_track_index::DPlusPiKPiFlag, hf_track_index::LcPKPiFlag, @@ -236,7 +248,7 @@ DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); //! particle origin, enum DecayType { D0ToPiK = 0, JpsiToEE, JpsiToMuMu, - N2ProngDecays }; //always keep N2ProngDecays at the end + N2ProngDecays }; // always keep N2ProngDecays at the end // functions for specific particles @@ -402,7 +414,7 @@ DECLARE_SOA_EXPRESSION_COLUMN(Py, py, //! float, 1.f * aod::hf_cand::pyProng0 + 1.f * aod::hf_cand::pyProng1); DECLARE_SOA_EXPRESSION_COLUMN(Pz, pz, //! float, 1.f * aod::hf_cand::pzProng0 + 1.f * aod::hf_cand::pzProng1); -//DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); }); +// DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); }); DECLARE_SOA_DYNAMIC_COLUMN(PtV0Pos, ptV0Pos, //! [](float px, float py) { return RecoDecay::Pt(px, py); }); DECLARE_SOA_DYNAMIC_COLUMN(PtV0Neg, ptV0Neg, //! @@ -425,7 +437,7 @@ auto InvMassGamma(const T& candidate) } // namespace hf_cand_casc DECLARE_SOA_TABLE(HfCandCascBase, "AOD", "HFCANDCASCBASE", //! - // general columns + // general columns HFCAND_COLUMNS, // cascade specific columns hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, @@ -433,7 +445,7 @@ DECLARE_SOA_TABLE(HfCandCascBase, "AOD", "HFCANDCASCBASE", //! hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_track_index::Index0Id, - hf_track_index::IndexV0Id, // V0 index + hf_track_index::V0Id, // V0 index hf_track_index::HFflag, // V0 v0data::X, v0data::Y, v0data::Z, @@ -613,7 +625,7 @@ enum DecayType { DPlusToPiKPi = 0, LcToPKPi, DsToPiKK, XicToPKPi, - N3ProngDecays }; //always keep N3ProngDecays at the end + N3ProngDecays }; // always keep N3ProngDecays at the end // functions for specific particles @@ -1132,7 +1144,7 @@ DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mi enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? // Λb → Λc+ π- → p K- π+ π- -//float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0); +// float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0); template auto CtLb(const T& candidate) { diff --git a/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx b/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx index 688777dcb03..9642130980b 100644 --- a/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx @@ -50,7 +50,7 @@ struct HFCandidateCreator2Prong { double massKPi{0.}; void process(aod::Collisions const& collisions, - aod::HfTrackIndexProng2 const& rowsTrackIndexProng2, + aod::Hf2Prong const& rowsTrackIndexProng2, aod::BigTracks const& tracks) { // 2-prong vertex fitter @@ -152,13 +152,13 @@ struct HFCandidateCreator2ProngExpressions { // Match reconstructed candidates. // Spawned table can be used directly for (auto& candidate : *rowCandidateProng2) { - //Printf("New rec. candidate"); + // Printf("New rec. candidate"); flag = 0; origin = 0; auto arrayDaughters = array{candidate.index0_as(), candidate.index1_as()}; // D0(bar) → π± K∓ - //Printf("Checking D0(bar) → π± K∓"); + // Printf("Checking D0(bar) → π± K∓"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign); if (indexRec > -1) { flag = sign * (1 << DecayType::D0ToPiK); @@ -166,7 +166,7 @@ struct HFCandidateCreator2ProngExpressions { // J/ψ → e+ e− if (flag == 0) { - //Printf("Checking J/ψ → e+ e−"); + // Printf("Checking J/ψ → e+ e−"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToEE; @@ -175,7 +175,7 @@ struct HFCandidateCreator2ProngExpressions { // J/ψ → μ+ μ− if (flag == 0) { - //Printf("Checking J/ψ → μ+ μ−"); + // Printf("Checking J/ψ → μ+ μ−"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToMuMu; @@ -193,19 +193,19 @@ struct HFCandidateCreator2ProngExpressions { // Match generated particles. for (auto& particle : particlesMC) { - //Printf("New gen. candidate"); + // Printf("New gen. candidate"); flag = 0; origin = 0; // D0(bar) → π± K∓ - //Printf("Checking D0(bar) → π± K∓"); + // Printf("Checking D0(bar) → π± K∓"); if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign)) { flag = sign * (1 << DecayType::D0ToPiK); } // J/ψ → e+ e− if (flag == 0) { - //Printf("Checking J/ψ → e+ e−"); + // Printf("Checking J/ψ → e+ e−"); if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true)) { flag = 1 << DecayType::JpsiToEE; } @@ -213,7 +213,7 @@ struct HFCandidateCreator2ProngExpressions { // J/ψ → μ+ μ− if (flag == 0) { - //Printf("Checking J/ψ → μ+ μ−"); + // Printf("Checking J/ψ → μ+ μ−"); if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true)) { flag = 1 << DecayType::JpsiToMuMu; } diff --git a/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx b/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx index de1e9ab08f0..501011cbfd9 100644 --- a/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx @@ -55,7 +55,7 @@ struct HFCandidateCreator3Prong { double massPiKPi{0.}; void process(aod::Collisions const& collisions, - aod::HfTrackIndexProng3 const& rowsTrackIndexProng3, + aod::Hf3Prong const& rowsTrackIndexProng3, aod::BigTracks const& tracks) { // 3-prong vertex fitter diff --git a/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx b/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx index e63ff7e6d07..bb5adfdeb49 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx @@ -75,10 +75,11 @@ struct HFCandidateCreatorCascade { double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus); double mass2K0sP{0.}; - void process(aod::Collisions const& collisions, - aod::HfTrackIndexCasc const& rowsTrackIndexCasc, - MyBigTracks const& tracks, - aod::V0Datas const& V0s + void process(aod::Collisions const&, + aod::HfCascade const& rowsTrackIndexCasc, + MyBigTracks const&, + aod::V0sLinked const&, + aod::V0Datas const& #ifdef MY_DEBUG , aod::McParticles_000& mcParticles @@ -99,7 +100,11 @@ struct HFCandidateCreatorCascade { for (const auto& casc : rowsTrackIndexCasc) { const auto& bach = casc.index0_as(); - const auto& v0 = casc.indexV0_as(); + if (!casc.v0_as().has_v0Data()) { + LOGF(warning, "V0Data not there for V0 %d in HF cascade %d. Skipping candidate.", casc.v0Id(), casc.globalIndex()); + continue; + } + const auto& v0 = casc.v0_as().v0Data(); const auto& trackV0DaughPos = v0.posTrack_as(); const auto& trackV0DaughNeg = v0.negTrack_as(); @@ -176,7 +181,7 @@ struct HFCandidateCreatorCascade { pVecV0[0], pVecV0[1], pVecV0[2], impactParameterBach.getY(), impactParameterV0.getY(), std::sqrt(impactParameterBach.getSigmaY2()), std::sqrt(impactParameterV0.getSigmaY2()), - casc.index0Id(), casc.indexV0Id(), + casc.index0Id(), casc.v0Id(), casc.hfflag(), v0.x(), v0.y(), v0.z(), //v0.posTrack(), v0.negTrack(), // why this was not fine? diff --git a/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx b/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx index 62628dd5fdd..98c971c1dc9 100644 --- a/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx +++ b/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx @@ -524,9 +524,9 @@ struct HfTagSelTracks { /// Pre-selection of 2-prong and 3-prong secondary vertices struct HfTrackIndexSkimsCreator { - Produces rowTrackIndexProng2; + Produces rowTrackIndexProng2; Produces rowProng2CutStatus; - Produces rowTrackIndexProng3; + Produces rowTrackIndexProng3; Produces rowProng3CutStatus; //Configurable nCollsMax{"nCollsMax", -1, "Max collisions per file"}; //can be added to run over limited collisions per file - for tesing purposes @@ -1323,15 +1323,15 @@ struct HfTrackIndexSkimsCreator { //________________________________________________________________________________________________________________________ /// Pre-selection of cascade secondary vertices -/// It will produce in any case a HfTrackIndexProng2 object, but mixing a V0 +/// It will produce in any case a Hf2Prong object, but mixing a V0 /// with a track, instead of 2 tracks /// to run: o2-analysis-weak-decay-indices --aod-file AO2D.root -b | o2-analysis-lambdakzerobuilder -b | /// o2-analysis-trackextension -b | o2-analysis-hf-track-index-skims-creator -b struct HfTrackIndexSkimsCreatorCascades { - Produces rowTrackIndexCasc; - // Produces rowTrackIndexCasc; + Produces rowTrackIndexCasc; + // Produces rowTrackIndexCasc; // whether to do or not validation plots Configurable doValPlots{"doValPlots", true, "fill histograms"}; diff --git a/PWGLF/TableProducer/lambdakzerofinder.cxx b/PWGLF/TableProducer/lambdakzerofinder.cxx index e33b8da740d..a00c6d5096c 100644 --- a/PWGLF/TableProducer/lambdakzerofinder.cxx +++ b/PWGLF/TableProducer/lambdakzerofinder.cxx @@ -122,6 +122,8 @@ struct lambdakzeroprefilter { struct lambdakzerofinder { Produces v0data; + Produces v0; + Produces v0datalink; HistogramRegistry registry{ "registry", @@ -155,7 +157,7 @@ struct lambdakzerofinder { Long_t lNCand = 0; - for (auto& t0id : ptracks) { //FIXME: turn into combination(...) + for (auto& t0id : ptracks) { // FIXME: turn into combination(...) auto t0 = t0id.goodTrack_as>(); auto Track1 = getTrackParCov(t0); for (auto& t1id : ntracks) { @@ -197,6 +199,7 @@ struct lambdakzerofinder { } lNCand++; + v0(t0.collisionId(), t0.globalIndex(), t1.globalIndex()); v0data(t0.globalIndex(), t1.globalIndex(), t0.collisionId(), fitter.getTrack(0).getX(), fitter.getTrack(1).getX(), 0, pos[0], pos[1], pos[2], @@ -204,6 +207,7 @@ struct lambdakzerofinder { pvec1[0], pvec1[1], pvec1[2], fitter.getChi2AtPCACandidate(), t0id.dcaXY(), t1id.dcaXY()); + v0datalink(v0data.lastIndex()); } } registry.fill(HIST("hCandPerEvent"), lNCand);