From e7c6bb0e4d326d390684dcec7aea2ca8510de06a Mon Sep 17 00:00:00 2001 From: Wu ChunTai Date: Fri, 8 Mar 2024 13:49:32 +0800 Subject: [PATCH 1/5] version 2: taskFlowCharmHadrons --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 103 ++++++++++++++++++----- 1 file changed, 83 insertions(+), 20 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 7c88c2d1229..e811220ebd5 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -32,7 +32,8 @@ using namespace o2::framework::expressions; enum DecayChannel { DplusToPiKPi = 0, DsToKKPi, - DsToPiKK }; + DsToPiKK, + D0ToPiK }; enum centralityEstimator { V0A = 0, T0M, @@ -52,6 +53,7 @@ struct HfTaskFlowCharmHadrons { Configurable qvecDetector{"qvecDetector", 0, "Detector for Q vector estimation (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3, TPC Pos: 4, TPC Neg: 5)"}; Configurable centDetector{"centDetector", 0, "Detector for centrality estimation (V0A: 0, T0M: 1, T0A: 2, T0C: 3"}; Configurable selectionFlag{"selectionFlag", 1, "Selection Flag for hadron (e.g. 1 for skimming, 3 for topo. and kine., 7 for PID)"}; + Configurable prongNum{"prongNum", 3, "Number of candidate's prong (For D0, set selectionFlag = 1 and prongNum = 2)"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; Configurable saveEpResoHisto{"saveEpResoHisto", false, "Flag to save event plane resolution histogram"}; Configurable> classMl{"classMl", {0, 2}, "Indexes of BDT scores to be stored. Two indexes max."}; @@ -64,15 +66,19 @@ struct HfTaskFlowCharmHadrons { ConfigurableAxis thnConfigAxisScalarProd{"thnConfigAxisScalarProd", {100, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisMlOne{"thnConfigAxisMlOne", {1000, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisMlTwo{"thnConfigAxisMlTwo", {1000, 0., 1.}, ""}; + ConfigurableAxis thnConfigAxisSelFlag{"thnConfigAxisSelFlag", {10, -1, 9}, ""}; using CandDsDatawMl = soa::Filtered>; using CandDsData = soa::Filtered>; using CandDplusDatawMl = soa::Filtered>; using CandDplusData = soa::Filtered>; + using CandD0DatawMl = soa::Filtered>; + using CandD0Data = soa::Filtered>; using CollsWithQvecs = soa::Join; Filter filterSelectDsCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlag || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlag; Filter filterSelectDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlag; + Filter filterSelectD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag; Partition selectedDsToKKPi = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlag; Partition selectedDsToPiKK = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlag; @@ -94,11 +100,12 @@ struct HfTaskFlowCharmHadrons { const AxisSpec thnAxisScalarProd{thnConfigAxisScalarProd, "SP"}; const AxisSpec thnAxisMlOne{thnConfigAxisMlOne, "Bkg score"}; const AxisSpec thnAxisMlTwo{thnConfigAxisMlTwo, "FD score"}; + const AxisSpec thnAxisSelFlag{thnConfigAxisSelFlag, "Selection Flag"}; if (storeMl) { - registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd, thnAxisMlOne, thnAxisMlTwo}); + registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd, thnAxisMlOne, thnAxisMlTwo, thnAxisSelFlag}); } else { - registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd}); + registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd, thnAxisSelFlag}); } registry.add("spReso/hSpResoFT0cFT0a", "hSpResoFT0cFT0a; centrality; Q_{FT0c} #bullet Q_{FT0a}", {HistType::kTH2F, {thnAxisCent, thnAxisScalarProd}}); registry.add("spReso/hSpResoFT0cFV0a", "hSpResoFT0cFV0a; centrality; Q_{FT0c} #bullet Q_{FV0a}", {HistType::kTH2F, {thnAxisCent, thnAxisScalarProd}}); @@ -135,11 +142,13 @@ struct HfTaskFlowCharmHadrons { /// \param cand is the candidate /// \param tracksQx is the X component of the Q vector for the tracks /// \param tracksQy is the Y component of the Q vector for the tracks - template + /// \param DecayChannel +template void getQvecDtracks(const T1& cand, std::vector& tracksQx, std::vector& tracksQy, - float& ampl) + float& ampl + ) { // TODO: add possibility to consider different weights for the tracks, at the moment only pT is considered; float pXtrack0 = cand.pxProng0(); @@ -150,17 +159,20 @@ struct HfTaskFlowCharmHadrons { float pYtrack1 = cand.pyProng1(); float pTtrack1 = cand.ptProng1(); float phiTrack1 = std::atan2(pYtrack1, pXtrack1); - float pXtrack2 = cand.pxProng2(); - float pYtrack2 = cand.pyProng2(); - float pTtrack2 = cand.ptProng2(); - float phiTrack2 = std::atan2(pYtrack2, pXtrack2); tracksQx.push_back(cos(harmonic * phiTrack0) * pTtrack0 / ampl); tracksQy.push_back(sin(harmonic * phiTrack0) * pTtrack0 / ampl); tracksQx.push_back(cos(harmonic * phiTrack1) * pTtrack1 / ampl); tracksQy.push_back(sin(harmonic * phiTrack1) * pTtrack1 / ampl); - tracksQx.push_back(cos(harmonic * phiTrack2) * pTtrack2 / ampl); - tracksQy.push_back(sin(harmonic * phiTrack2) * pTtrack2 / ampl); + + if constexpr (DecayChannel != DecayChannel::D0ToPiK){ + float pXtrack2 = cand.pxProng2(); + float pYtrack2 = cand.pyProng2(); + float pTtrack2 = cand.ptProng2(); + float phiTrack2 = std::atan2(pYtrack2, pXtrack2); + tracksQx.push_back(cos(harmonic * phiTrack2) * pTtrack2 / ampl); + tracksQy.push_back(sin(harmonic * phiTrack2) * pTtrack2 / ampl); + } } /// Compute the delta psi in the range [0, pi/harmonic] @@ -188,18 +200,20 @@ struct HfTaskFlowCharmHadrons { /// \param sp is the scalar product /// \param evtPlReso is the event plane resolution /// \param outputMl are the ML scores + /// \param selectionFlag for D0, only 0 or1 void fillThn(float& mass, float& pt, float& cent, float& cosNPhi, float& cosDeltaPhi, float& sp, - std::vector& outputMl) + std::vector& outputMl, + int selectionFlag) { if (storeMl) { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp, outputMl[0], outputMl[1]); + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp, outputMl[0], outputMl[1], selectionFlag); } else { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp); + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp, selectionFlag); } } @@ -320,13 +334,22 @@ struct HfTaskFlowCharmHadrons { // If TPC is used for the SP estimation, the tracks of the hadron candidate must be removed from the TPC Q vector to avoid double counting if (qvecDetector == qvecEstimator::TPCNeg || qvecDetector == qvecEstimator::TPCPos) { - float ampl = amplQVec - 3.; + float ampl = amplQVec - float(prongNum); std::vector tracksQx = {}; std::vector tracksQy = {}; - getQvecDtracks(candidate, tracksQx, tracksQy, ampl); - for (unsigned int itrack = 0; itrack < 3; itrack++) { - xQVec -= tracksQx[itrack]; - yQVec -= tracksQy[itrack]; + + if constexpr (DecayChannel == DecayChannel::D0ToPiK){ + getQvecDtracks(candidate, tracksQx, tracksQy, ampl); + for (unsigned int itrack = 0; itrack < 2; itrack++) { + xQVec -= tracksQx[itrack]; + yQVec -= tracksQy[itrack]; + } + } else { + getQvecDtracks(candidate, tracksQx, tracksQy, ampl); + for (unsigned int itrack = 0; itrack < 3; itrack++) { + xQVec -= tracksQx[itrack]; + yQVec -= tracksQy[itrack]; + } } } @@ -335,7 +358,31 @@ struct HfTaskFlowCharmHadrons { float scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec; float cosDeltaPhi = std::cos(harmonic * (phiCand - evtPl)); - fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMl); + if constexpr (std::is_same::value || std::is_same::value) { + std::vector outputMlD0 = {-999., -999.}; + std::vector outputMlD0bar = {-999., -999.}; + + if (candidate.isSelD0() >= selectionFlag) { + massCand = hfHelper.invMassD0ToPiK(candidate); + if constexpr (std::is_same::value) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + outputMlD0[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; + } + fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0, 0); + } + if (candidate.isSelD0bar() >= selectionFlag) { + massCand = hfHelper.invMassD0barToKPi(candidate); + if constexpr (std::is_same::value) { + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + outputMlD0bar[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; + } + fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0bar, 1); + } + } //TODO: Whether to put all the mass calculations here + + if constexpr (DecayChannel != DecayChannel::D0ToPiK) { + fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMl, selectionFlag); + } } } @@ -373,6 +420,22 @@ struct HfTaskFlowCharmHadrons { } PROCESS_SWITCH(HfTaskFlowCharmHadrons, processDplus, "Process Dplus candidates", true); + // D0 with ML + void processD0Ml(CollsWithQvecs::iterator const& collision, + CandD0DatawMl const& candidatesD0) + { + runFlowAnalysis(collision, candidatesD0); + } + PROCESS_SWITCH(HfTaskFlowCharmHadrons, processD0Ml, "Process D0 candidates with ML", false); + + // D0 with rectangular cuts + void processD0(CollsWithQvecs::iterator const& collision, + CandD0Data const& candidatesD0) + { + runFlowAnalysis(collision, candidatesD0); + } + PROCESS_SWITCH(HfTaskFlowCharmHadrons, processD0, "Process D0 candidates", false); + // Resolution void processResolution(CollsWithQvecs::iterator const& collision) { From fd3c13c9dd778f79d7c25dd4181f2c9ae86dd5df Mon Sep 17 00:00:00 2001 From: Libeiyu Date: Mon, 11 Mar 2024 16:06:49 +0800 Subject: [PATCH 2/5] No selection flag in Thn --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index e811220ebd5..e32132be6cb 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -100,12 +100,11 @@ struct HfTaskFlowCharmHadrons { const AxisSpec thnAxisScalarProd{thnConfigAxisScalarProd, "SP"}; const AxisSpec thnAxisMlOne{thnConfigAxisMlOne, "Bkg score"}; const AxisSpec thnAxisMlTwo{thnConfigAxisMlTwo, "FD score"}; - const AxisSpec thnAxisSelFlag{thnConfigAxisSelFlag, "Selection Flag"}; if (storeMl) { - registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd, thnAxisMlOne, thnAxisMlTwo, thnAxisSelFlag}); + registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd, thnAxisMlOne, thnAxisMlTwo}); } else { - registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd, thnAxisSelFlag}); + registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisCent, thnAxisCosNPhi, thnAxisCosDeltaPhi, thnAxisScalarProd}); } registry.add("spReso/hSpResoFT0cFT0a", "hSpResoFT0cFT0a; centrality; Q_{FT0c} #bullet Q_{FT0a}", {HistType::kTH2F, {thnAxisCent, thnAxisScalarProd}}); registry.add("spReso/hSpResoFT0cFV0a", "hSpResoFT0cFV0a; centrality; Q_{FT0c} #bullet Q_{FV0a}", {HistType::kTH2F, {thnAxisCent, thnAxisScalarProd}}); @@ -211,9 +210,9 @@ template int selectionFlag) { if (storeMl) { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp, outputMl[0], outputMl[1], selectionFlag); + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp, outputMl[0], outputMl[1]); } else { - registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp, selectionFlag); + registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp); } } @@ -368,7 +367,7 @@ template for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMlD0[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; } - fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0, 0); + fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0); } if (candidate.isSelD0bar() >= selectionFlag) { massCand = hfHelper.invMassD0barToKPi(candidate); @@ -376,12 +375,12 @@ template for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) outputMlD0bar[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)]; } - fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0bar, 1); + fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0bar); } } //TODO: Whether to put all the mass calculations here if constexpr (DecayChannel != DecayChannel::D0ToPiK) { - fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMl, selectionFlag); + fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMl); } } } From 65681d5098f10754033abcd563831f7622f35ab5 Mon Sep 17 00:00:00 2001 From: Libeiyu Date: Mon, 11 Mar 2024 16:13:04 +0800 Subject: [PATCH 3/5] No selection Flag --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index e32132be6cb..4b91c1bbaf0 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -206,8 +206,7 @@ template float& cosNPhi, float& cosDeltaPhi, float& sp, - std::vector& outputMl, - int selectionFlag) + std::vector& outputMl) { if (storeMl) { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, cosNPhi, cosDeltaPhi, sp, outputMl[0], outputMl[1]); From 3f356f810e4788fd65ccecc25415db310a107e26 Mon Sep 17 00:00:00 2001 From: Libeiyu Date: Mon, 11 Mar 2024 17:05:02 +0800 Subject: [PATCH 4/5] Add D0 to taskFlowCharmHadrons, , including Ml --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 4b91c1bbaf0..67bb97d676f 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -51,7 +51,7 @@ struct HfTaskFlowCharmHadrons { Configurable zVtxMax{"zVtxMax", 10., "Max vertex coordinate z"}; Configurable harmonic{"harmonic", 2, "harmonic number"}; Configurable qvecDetector{"qvecDetector", 0, "Detector for Q vector estimation (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3, TPC Pos: 4, TPC Neg: 5)"}; - Configurable centDetector{"centDetector", 0, "Detector for centrality estimation (V0A: 0, T0M: 1, T0A: 2, T0C: 3"}; + Configurable centDetector{"centDetector", 0, "Detector for centrality estimation (V0A: 0, T0M: 1, T0A: 2, T0C: 3)"}; Configurable selectionFlag{"selectionFlag", 1, "Selection Flag for hadron (e.g. 1 for skimming, 3 for topo. and kine., 7 for PID)"}; Configurable prongNum{"prongNum", 3, "Number of candidate's prong (For D0, set selectionFlag = 1 and prongNum = 2)"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; @@ -66,7 +66,6 @@ struct HfTaskFlowCharmHadrons { ConfigurableAxis thnConfigAxisScalarProd{"thnConfigAxisScalarProd", {100, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisMlOne{"thnConfigAxisMlOne", {1000, 0., 1.}, ""}; ConfigurableAxis thnConfigAxisMlTwo{"thnConfigAxisMlTwo", {1000, 0., 1.}, ""}; - ConfigurableAxis thnConfigAxisSelFlag{"thnConfigAxisSelFlag", {10, -1, 9}, ""}; using CandDsDatawMl = soa::Filtered>; using CandDsData = soa::Filtered>; @@ -142,7 +141,7 @@ struct HfTaskFlowCharmHadrons { /// \param tracksQx is the X component of the Q vector for the tracks /// \param tracksQy is the Y component of the Q vector for the tracks /// \param DecayChannel -template + template void getQvecDtracks(const T1& cand, std::vector& tracksQx, std::vector& tracksQy, @@ -363,8 +362,10 @@ template if (candidate.isSelD0() >= selectionFlag) { massCand = hfHelper.invMassD0ToPiK(candidate); if constexpr (std::is_same::value) { - for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) + std::cout << "Here is CandD0DatawMl" << std::endl; + for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMlD0[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; + std::cout << "Here is iclass " << iclass << "\t Here is outputMl " << outputMlD0[iclass] << std::endl; } } fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0); } From 03317339db4306a5be60b0918ea75e03cf03d48c Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 11 Mar 2024 09:26:18 +0000 Subject: [PATCH 5/5] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 67bb97d676f..d9abe88289c 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -145,8 +145,7 @@ struct HfTaskFlowCharmHadrons { void getQvecDtracks(const T1& cand, std::vector& tracksQx, std::vector& tracksQy, - float& ampl - ) + float& ampl) { // TODO: add possibility to consider different weights for the tracks, at the moment only pT is considered; float pXtrack0 = cand.pxProng0(); @@ -163,7 +162,7 @@ struct HfTaskFlowCharmHadrons { tracksQx.push_back(cos(harmonic * phiTrack1) * pTtrack1 / ampl); tracksQy.push_back(sin(harmonic * phiTrack1) * pTtrack1 / ampl); - if constexpr (DecayChannel != DecayChannel::D0ToPiK){ + if constexpr (DecayChannel != DecayChannel::D0ToPiK) { float pXtrack2 = cand.pxProng2(); float pYtrack2 = cand.pyProng2(); float pTtrack2 = cand.ptProng2(); @@ -335,18 +334,18 @@ struct HfTaskFlowCharmHadrons { std::vector tracksQx = {}; std::vector tracksQy = {}; - if constexpr (DecayChannel == DecayChannel::D0ToPiK){ + if constexpr (DecayChannel == DecayChannel::D0ToPiK) { getQvecDtracks(candidate, tracksQx, tracksQy, ampl); - for (unsigned int itrack = 0; itrack < 2; itrack++) { - xQVec -= tracksQx[itrack]; - yQVec -= tracksQy[itrack]; - } - } else { + for (unsigned int itrack = 0; itrack < 2; itrack++) { + xQVec -= tracksQx[itrack]; + yQVec -= tracksQy[itrack]; + } + } else { getQvecDtracks(candidate, tracksQx, tracksQy, ampl); for (unsigned int itrack = 0; itrack < 3; itrack++) { - xQVec -= tracksQx[itrack]; - yQVec -= tracksQy[itrack]; - } + xQVec -= tracksQx[itrack]; + yQVec -= tracksQy[itrack]; + } } } @@ -365,7 +364,8 @@ struct HfTaskFlowCharmHadrons { std::cout << "Here is CandD0DatawMl" << std::endl; for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) { outputMlD0[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; - std::cout << "Here is iclass " << iclass << "\t Here is outputMl " << outputMlD0[iclass] << std::endl; } + std::cout << "Here is iclass " << iclass << "\t Here is outputMl " << outputMlD0[iclass] << std::endl; + } } fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0); } @@ -377,7 +377,7 @@ struct HfTaskFlowCharmHadrons { } fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMlD0bar); } - } //TODO: Whether to put all the mass calculations here + } // TODO: Whether to put all the mass calculations here if constexpr (DecayChannel != DecayChannel::D0ToPiK) { fillThn(massCand, ptCand, cent, cosNPhi, cosDeltaPhi, scalprodCand, outputMl); @@ -421,7 +421,7 @@ struct HfTaskFlowCharmHadrons { // D0 with ML void processD0Ml(CollsWithQvecs::iterator const& collision, - CandD0DatawMl const& candidatesD0) + CandD0DatawMl const& candidatesD0) { runFlowAnalysis(collision, candidatesD0); } @@ -429,7 +429,7 @@ struct HfTaskFlowCharmHadrons { // D0 with rectangular cuts void processD0(CollsWithQvecs::iterator const& collision, - CandD0Data const& candidatesD0) + CandD0Data const& candidatesD0) { runFlowAnalysis(collision, candidatesD0); }