diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 4aa872b7e4e..c4a9694ed5c 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -66,15 +66,24 @@ namespace full { DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) -// ML scores DECLARE_SOA_COLUMN(MlScore0, mlScore0, float); //! ML score of the first configured index DECLARE_SOA_COLUMN(MlScore1, mlScore1, float); //! ML score of the second configured index +DECLARE_SOA_COLUMN(ScalarProd, scalarProd, float); //! Scalar product +DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality } // namespace full -DECLARE_SOA_TABLE(HfCandPtCent, "AOD", "HFCANDPTCENT", +DECLARE_SOA_TABLE(HfCandMPtInfos, "AOD", "HFCANDMPTINFO", full::M, full::Pt, full::MlScore0, full::MlScore1); + +DECLARE_SOA_TABLE(HfCandFlowInfos, "AOD", "HFCANDFLOWINFO", + full::M, + full::Pt, + full::MlScore0, + full::MlScore1, + full::ScalarProd, + full::Cent); } // namespace o2::aod enum DecayChannel { DplusToPiKPi = 0, @@ -98,7 +107,8 @@ enum QvecEstimator { FV0A = 0, TPCTot }; struct HfTaskFlowCharmHadrons { - Produces rowCandidateMassPtMlScores; + Produces rowCandMassPtMl; + Produces rowCandMassPtMlSpCent; Configurable harmonic{"harmonic", 2, "harmonic number"}; Configurable qvecDetector{"qvecDetector", 3, "Detector for Q vector estimation (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3, TPC Pos: 4, TPC Neg: 5, TPC Tot: 6)"}; @@ -108,7 +118,9 @@ struct HfTaskFlowCharmHadrons { Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP/EP computation (not applied in resolution process)"}; Configurable storeEP{"storeEP", false, "Flag to store EP-related axis"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; - Configurable fillMassPtMlTree{"fillMassPtMlTree", false, "Flag to fill mass and pt tree"}; + Configurable fillMassPtMlTree{"fillMassPtMlTree", false, "Flag to fill mass, pt and ML scores tree"}; + Configurable fillMassPtMlSpCentTree{"fillMassPtMlSpCentTree", false, "Flag to fill mass, pt, ML scores, SP and centrality tree"}; + Configurable fillSparse{"fillSparse", true, "Flag to fill sparse"}; Configurable downSampleFactor{"downSampleFactor", 1., "Fraction of candidates to keep in TTree"}; Configurable ptDownSampleMax{"ptDownSampleMax", 10., "Maximum pt for the application of the downsampling factor"}; Configurable storeResoOccu{"storeResoOccu", false, "Flag to store Occupancy in resolution ThnSparse"}; @@ -297,20 +309,6 @@ struct HfTaskFlowCharmHadrons { } }; // end init - /// Fill the mass, pt and ML scores of a candidate - /// \param mass is the candidate mass - /// \param pt is the candidate transverse momentum - /// \param mlscore0 is the first ML score - /// \param mlscore1 is the second ML score - void fillMassPt(const float mass, const float pt, const float mlscore0, const float mlscore1) - { - rowCandidateMassPtMlScores( - mass, - pt, - mlscore0, - mlscore1); - } - /// Compute the Q vector for the candidate's tracks /// \param cand is the candidate /// \param tracksQx is the X component of the Q vector for the tracks @@ -698,15 +696,21 @@ struct HfTaskFlowCharmHadrons { float const scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec; float const cosDeltaPhi = std::cos(harmonic * (phiCand - evtPl)); - if (fillMassPtMlTree && storeMl) { + if (fillMassPtMlTree || fillMassPtMlSpCentTree) { if (downSampleFactor < 1.) { float const pseudoRndm = ptCand * 1000. - static_cast(ptCand * 1000); if (ptCand < ptDownSampleMax && pseudoRndm >= downSampleFactor) { continue; } } - fillMassPt(massCand, ptCand, outputMl[0], outputMl[1]); - } else { + if (fillMassPtMlTree) { + rowCandMassPtMl(massCand, ptCand, outputMl[0], outputMl[1]); + } + if (fillMassPtMlSpCentTree) { + rowCandMassPtMlSpCent(massCand, ptCand, outputMl[0], outputMl[1], scalprodCand, cent); + } + } + if (fillSparse) { fillThn(massCand, ptCand, cent, cosNPhi, sinNPhi, cosDeltaPhi, scalprodCand, outputMl, occupancy, hfevflag); } }