From 6dcfbb1a28491d4a3becf42f6f5dcdc7b7ea7793 Mon Sep 17 00:00:00 2001 From: Chiara De Martin Date: Wed, 23 Jul 2025 16:09:43 +0200 Subject: [PATCH 1/5] adapt the task to measure lambda longitudinal polarization in OO collisions --- .../TableProducer/Strangeness/cascadeflow.cxx | 296 +++++++++++++++++- 1 file changed, 290 insertions(+), 6 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 5179a89846b..bdaaa82f59b 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -47,10 +47,12 @@ using CollEventPlaneCentralFW = soa::Join::iterator; using CollEventAndSpecPlaneCentralFW = soa::Join::iterator; using MCCollisionsStra = soa::Join; +using V0Candidates = soa::Join; using CascCandidates = soa::Join; using CascMCCandidates = soa::Join; -const int nParticles = 2; +const int nParticles = 2; //Xi, Omega +const int nCharges = 2; //Lambda, AntiLambda const int nParameters = 4; namespace cascadev2 @@ -77,6 +79,17 @@ std::shared_ptr hBkgScoreAfterSel[nParticles]; std::shared_ptr hSparseV2C[nParticles]; } // namespace cascadev2 +namespace lambdav2 +{ +enum species { Lambda = 0, + AntiLambda = 1 }; +static const std::vector speciesNames{"Lambda", "AntiLambda"}; +const double AlphaLambda[2] = {0.747, -0.757}; // decay parameter of Lambda and AntiLambda + +std::shared_ptr hMassBeforeSelVsPt[nCharges]; +std::shared_ptr hMassAfterSelVsPt[nCharges]; +} // namespace lambdav2 + namespace cascade_flow_cuts_ml { // direction of the cut @@ -143,6 +156,8 @@ struct cascadeFlow { Configurable isFillTHNXi_PzVsPsi{"isFillTHNXi_PzVsPsi", 1, ""}; Configurable isFillTHNOmega{"isFillTHNOmega", 1, ""}; Configurable isFillTHNOmega_PzVsPsi{"isFillTHNOmega_PzVsPsi", 1, ""}; + Configurable isFillTHNLambda{"isFillTHNLambda", 1, ""}; + Configurable isFillTHNLambda_PzVsPsi{"isFillTHNLambda_PzVsPsi", 1, ""}; Configurable isFillTHN_V2{"isFillTHN_V2", 1, ""}; Configurable isFillTHN_Pz{"isFillTHN_Pz", 1, ""}; Configurable isFillTHN_PzFromLambda{"isFillTHN_PzFromLambda", 1, ""}; @@ -208,6 +223,22 @@ struct cascadeFlow { Configurable MaxOmegaMass{"MaxOmegaMass", 1.690, ""}; } CandidateConfigs; + struct : ConfigurableGroup { + Configurable MinPtV0{"MinPtV0", 0.2, "Min pt of v0"}; + Configurable MaxPtV0{"MaxPtV0", 10, "Max pt of v0"}; + Configurable MinMassLambda{"MinMassLambda", 1.105, ""}; + Configurable MaxMassLambda{"MaxMassLambda", 1.125, ""}; + Configurable etaV0{"etaV0", 0.8, "etaV0"}; + Configurable v0cospa{"v0cospa", 0.97, "min V0 CosPA"}; + Configurable dcav0dau{"dcav0dau", 1.0, "max DCA V0 Daughters (cm)"}; + Configurable dcanegtopv{"dcanegtopv", .05, "min DCA Neg To PV (cm)"}; + Configurable dcapostopv{"dcapostopv", .05, "min DCA Pos To PV (cm)"}; + Configurable v0radius{"v0radius", 1.2, "minimum V0 radius (cm)"}; + Configurable v0radiusMax{"v0radiusMax", 1E5, "maximum V0 radius (cm)"}; + Configurable rapidityLambda{"rapidityLambda", 0.5, "rapidityLambda"}; + Configurable etaLambda{"etaLambda", 0.8, "etaLambda"}; + } V0Configs; + Configurable sideBandStart{"sideBandStart", 5, "Start of the sideband region in number of sigmas"}; Configurable sideBandEnd{"sideBandEnd", 7, "End of the sideband region in number of sigmas"}; Configurable downsample{"downsample", 1., "Downsample training output tree"}; @@ -230,8 +261,10 @@ struct cascadeFlow { Configurable acceptancePathsCCDBXi{"acceptancePathsCCDBXi", "Users/c/chdemart/AcceptanceXi", "Paths of Xi acceptance on CCDB"}; Configurable acceptancePathsCCDBOmega{"acceptancePathsCCDBOmega", "Users/c/chdemart/AcceptanceOmega", "Paths of Omega acceptance on CCDB"}; Configurable acceptancePathsCCDBLambda{"acceptancePathsCCDBLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of Lambda acceptance on CCDB"}; + Configurable acceptancePathsCCDBPrimaryLambda{"acceptancePathsCCDBPrimaryLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of PrimaryLambda acceptance on CCDB"}; Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; // ML inference Configurable isApplyML{"isApplyML", 1, "Flag to apply ML selections"}; @@ -360,6 +393,64 @@ struct cascadeFlow { return true; } + template + bool isLambdaAccepted(TDaughter negExtra, TDaughter posExtra, int& counter) // loose cuts on topological selections of v0s + { + // TPC cuts as those implemented for the training of the signal + if (doNTPCSigmaCut) { + if (std::abs(posExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(negExtra.tpcNSigmaPi()) > nsigmatpcPi) + return false; + } + counter++; + + if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows) + return false; + + counter++; + return true; + } + template + bool isAntiLambdaAccepted(TDaughter negExtra, TDaughter posExtra, int& counter) // loose cuts on topological selections of v0s + { + // TPC cuts as those implemented for the training of the signal + if (doNTPCSigmaCut) { + if (std::abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi) + return false; + } + counter++; + + if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows) + return false; + + counter++; + return true; + } + + template + bool isV0TopoAccepted(TV0 v0) + { + // topological selections + if (v0.v0radius() < V0Configs.v0radius) + return false; + if (v0.v0radius() > V0Configs.v0radiusMax) + return false; + if (std::abs(v0.dcapostopv()) < V0Configs.dcapostopv) + return false; + if (std::abs(v0.dcanegtopv()) < V0Configs.dcanegtopv) + return false; + if (v0.v0cosPA() < V0Configs.v0cospa) + return false; + if (v0.dcaV0daughters() > V0Configs.dcav0dau) + return false; + // rapidity selection + if (std::abs(v0.yLambda()) > V0Configs.rapidityLambda) + return false; + if (std::abs(v0.eta()) > V0Configs.etaLambda) + return false; + + return true; + } + double GetPhiInRange(double phi) { while (phi < 0) { @@ -375,6 +466,7 @@ struct cascadeFlow { TH2F* hAcceptanceXi; TH2F* hAcceptanceOmega; TH2F* hAcceptanceLambda; + TH2F* hAcceptancePrimaryLambda; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry histosMCGen{"histosMCGen", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; @@ -492,6 +584,10 @@ struct cascadeFlow { TList* listAcceptanceLambda = ccdb->get(acceptancePathsCCDBLambda); if (!listAcceptanceLambda) LOG(fatal) << "Problem getting TList object with acceptance for Lambda!"; + TList* listAcceptancePrimaryLambda = ccdb->get(acceptancePathsCCDBPrimaryLambda); + if (!listAcceptancePrimaryLambda) + LOG(fatal) << "Problem getting TList object with acceptance for Primary Lambda!"; + hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); if (!hAcceptanceXi) { LOG(fatal) << "The histogram for Xi is not there!"; @@ -507,6 +603,11 @@ struct cascadeFlow { LOG(fatal) << "The histogram for Lambda is not there!"; } hAcceptanceLambda->SetName("hAcceptanceLambda"); + hAcceptancePrimaryLambda = static_cast(listAcceptancePrimaryLambda->FindObject(Form("%s", acceptanceHistoNamePrimaryLambda->data()))); + if (!hAcceptancePrimaryLambda) { + LOG(fatal) << "The histogram for Primary Lambda is not there!"; + } + hAcceptancePrimaryLambda->SetName("hAcceptancePrimaryLambda"); LOG(info) << "Acceptance now loaded"; } @@ -515,9 +616,14 @@ struct cascadeFlow { float minMass[2]{1.28, 1.6}; float maxMass[2]{1.36, 1.73}; + float minMassLambda[2]{1.09, 1.09}; + float maxMassLambda[2]{1.14, 1.14}; const AxisSpec massCascAxis[2]{{static_cast((maxMass[0] - minMass[0]) / 0.001f), minMass[0], maxMass[0], "#Xi candidate mass (GeV/c^{2})"}, {static_cast((maxMass[1] - minMass[1]) / 0.001f), minMass[1], maxMass[1], "#Omega candidate mass (GeV/c^{2})"}}; - const AxisSpec ptAxis{static_cast((CandidateConfigs.MaxPt - CandidateConfigs.MinPt) / 0.2), CandidateConfigs.MinPt, CandidateConfigs.MaxPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec massLambdaAxis[2]{{static_cast((maxMassLambda[0] - minMassLambda[0]) / 0.001f), minMassLambda[0], maxMassLambda[0], "#Lambda candidate mass (GeV/c^{2})"}, + {static_cast((maxMassLambda[1] - minMassLambda[1]) / 0.001f), minMassLambda[1], maxMassLambda[1], "#bar{#Lambda} candidate mass (GeV/c^{2})"}}; + const AxisSpec ptAxisCasc{static_cast((CandidateConfigs.MaxPt - CandidateConfigs.MinPt) / 0.2), CandidateConfigs.MinPt, CandidateConfigs.MaxPt, "#it{p}_{T} (GeV/#it{c})"}; + const AxisSpec ptAxisLambda{static_cast((V0Configs.MaxPtV0 - V0Configs.MinPtV0) / 0.2), V0Configs.MinPtV0, V0Configs.MaxPtV0, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec v2Axis{200, -1., 1., "#it{v}_{2}"}; const AxisSpec CentAxis{18, 0., 90., "FT0C centrality percentile"}; TString hNEventsLabels[10] = {"All", "sel8", "z vrtx", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "trackOccupancyInTimeRange", "kNoCollInTimeRange", "kNoCollInROF", "kTVXinTRD", "kIsGoodEventEP"}; @@ -553,6 +659,7 @@ struct cascadeFlow { histos.add("hMultNTracksITSTPCVsCentrality", "hMultNTracksITSTPCVsCentrality", kTH2F, {{100, 0, 100}, {1000, 0, 5000}}); histos.add("hCandidate", "hCandidate", HistType::kTH1F, {{22, -0.5, 21.5}}); + histos.add("hLambdaCandidate", "hLambdaCandidate", HistType::kTH1F, {{5, -0.5, 4.5}}); histos.add("hCascadeSignal", "hCascadeSignal", HistType::kTH1F, {{6, -0.5, 5.5}}); histos.add("hCascade", "hCascade", HistType::kTH1F, {{6, -0.5, 5.5}}); histos.add("hXiPtvsCent", "hXiPtvsCent", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); @@ -563,6 +670,8 @@ struct cascadeFlow { histos.add("hOmegaPtvsCentY05", "hOmegaPtvsCentY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histos.add("hCascadePhi", "hCascadePhi", HistType::kTH1F, {{100, 0, o2::constants::math::TwoPI}}); histos.add("hcascminuspsiT0C", "hcascminuspsiT0C", HistType::kTH1F, {{100, 0, o2::constants::math::PI}}); + histos.add("hLambdaPhi", "hLambdaPhi", HistType::kTH1F, {{100, 0, o2::constants::math::TwoPI}}); + histos.add("hlambdaminuspsiT0C", "hlambdaminuspsiT0C", HistType::kTH1F, {{100, 0, o2::constants::math::PI}}); histos.add("hv2CEPvsFT0C", "hv2CEPvsFT0C", HistType::kTH2F, {CentAxis, {100, -1, 1}}); histos.add("hv2CEPvsv2CSP", "hv2CEPvsV2CSP", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); histos.add("hv1EPvsv1SP", "hV1EPvsV1SP", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); @@ -643,6 +752,20 @@ struct cascadeFlow { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) histos.add("hOmegaCos2ThetaVsPsiFromLambdaL", "THn for cos2Theta of Lambda vs Lambda mass and pt", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPtLambda, thnAxisMassLambda, thnAxisBDTScore, thnAxisCos2ThetaL, thnAxisPsiDiff}); } + if (fillingConfigs.isFillTHNLambda) { + if (fillingConfigs.isFillTHN_V2) + histos.add("hLambdaV2", "THn for v2 of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPtLambda, thnAxisMassLambda, thnAxisV2}); + if (fillingConfigs.isFillTHN_Pz) + histos.add("hLambdaPzs2", "THn for Pzs2 of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPtLambda, thnAxisMassLambda, thnAxisPzs2Lambda}); + if (fillingConfigs.isFillTHN_Acc) + histos.add("hLambdaCos2Theta", "THn for Cos2Theta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPtLambda, thnAxisMassLambda, thnAxisCos2Theta}); + } + if (fillingConfigs.isFillTHNLambda_PzVsPsi) { + if (fillingConfigs.isFillTHN_Pz) + histos.add("hLambdaPzVsPsi", "THn for cosTheta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPtLambda, thnAxisMassLambda, thnAxisCosThetaProtonAlpha, thnAxisPsiDiff}); + if (fillingConfigs.isFillTHN_Acc) + histos.add("hLambdaCos2ThetaVsPsi", "THn for cos2Theta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPtLambda, thnAxisMassLambda,thnAxisCos2Theta, thnAxisPsiDiff}); + } histosMCGen.add("h2DGenXiEta08", "h2DGenXiEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("h2DGenOmegaEta08", "h2DGenOmegaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); @@ -661,14 +784,19 @@ struct cascadeFlow { } for (int iS{0}; iS < nParticles; ++iS) { - cascadev2::hMassBeforeSelVsPt[iS] = histos.add(Form("hMassBeforeSelVsPt%s", cascadev2::speciesNames[iS].data()), "hMassBeforeSelVsPt", HistType::kTH2F, {massCascAxis[iS], ptAxis}); - cascadev2::hMassAfterSelVsPt[iS] = histos.add(Form("hMassAfterSelVsPt%s", cascadev2::speciesNames[iS].data()), "hMassAfterSelVsPt", HistType::kTH2F, {massCascAxis[iS], ptAxis}); + cascadev2::hMassBeforeSelVsPt[iS] = histos.add(Form("hMassBeforeSelVsPt%s", cascadev2::speciesNames[iS].data()), "hMassBeforeSelVsPt", HistType::kTH2F, {massCascAxis[iS], ptAxisCasc}); + cascadev2::hMassAfterSelVsPt[iS] = histos.add(Form("hMassAfterSelVsPt%s", cascadev2::speciesNames[iS].data()), "hMassAfterSelVsPt", HistType::kTH2F, {massCascAxis[iS], ptAxisCasc}); cascadev2::hSignalScoreBeforeSel[iS] = histos.add(Form("hSignalScoreBeforeSel%s", cascadev2::speciesNames[iS].data()), "Signal score before selection;BDT first score;entries", HistType::kTH1F, {{100, 0., 1.}}); cascadev2::hBkgScoreBeforeSel[iS] = histos.add(Form("hBkgScoreBeforeSel%s", cascadev2::speciesNames[iS].data()), "Bkg score before selection;BDT first score;entries", HistType::kTH1F, {{100, 0., 1.}}); cascadev2::hSignalScoreAfterSel[iS] = histos.add(Form("hSignalScoreAfterSel%s", cascadev2::speciesNames[iS].data()), "Signal score after selection;BDT first score;entries", HistType::kTH1F, {{100, 0., 1.}}); cascadev2::hBkgScoreAfterSel[iS] = histos.add(Form("hBkgScoreAfterSel%s", cascadev2::speciesNames[iS].data()), "Bkg score after selection;BDT first score;entries", HistType::kTH1F, {{100, 0., 1.}}); - cascadev2::hSparseV2C[iS] = histos.add(Form("hSparseV2C%s", cascadev2::speciesNames[iS].data()), "hSparseV2C", HistType::kTHnF, {massCascAxis[iS], ptAxis, v2Axis, CentAxis}); + cascadev2::hSparseV2C[iS] = histos.add(Form("hSparseV2C%s", cascadev2::speciesNames[iS].data()), "hSparseV2C", HistType::kTHnF, {massCascAxis[iS], ptAxisCasc, v2Axis, CentAxis}); + } + for (int iS{0}; iS < nCharges; ++iS) { + lambdav2::hMassBeforeSelVsPt[iS] = histos.add(Form("hMassBeforeSelVsPt%s", lambdav2::speciesNames[iS].data()), "hMassBeforeSelVsPt", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); + lambdav2::hMassAfterSelVsPt[iS] = histos.add(Form("hMassAfterSelVsPt%s", lambdav2::speciesNames[iS].data()), "hMassAfterSelVsPt", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); } + if (isApplyML) { // Configure and initialise the ML class mlResponseXi.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); @@ -1328,6 +1456,161 @@ struct cascadeFlow { } } + void processAnalyseLambdaEP2CentralFW(CollEventPlaneCentralFW const& coll, V0Candidates const& V0s, DauTracks const&) + { + + if (!AcceptEvent(coll, 1)) { + return; + } + + // select only events used for the calibration of the event plane + if (isGoodEventEP) { + if (std::abs(coll.qvecFT0CRe()) > 990 || std::abs(coll.qvecFT0CIm()) > 990 || std::abs(coll.qvecBNegRe()) > 990 || std::abs(coll.qvecBNegIm()) > 990 || std::abs(coll.qvecBPosRe()) > 990 || std::abs(coll.qvecBPosIm()) > 990) { + return; + } + } + + // event has FT0C event plane + bool hasEventPlane = 0; + if (std::abs(coll.qvecFT0CRe()) < 990 && std::abs(coll.qvecFT0CIm()) < 990) + hasEventPlane = 1; + + histos.fill(HIST("hNEvents"), 9.5); + histos.fill(HIST("hEventNchCorrelationAfterEP"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); + histos.fill(HIST("hEventPVcontributorsVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksPVeta1()); + histos.fill(HIST("hEventGlobalTracksVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksGlobal()); + + histos.fill(HIST("hEventCentrality"), coll.centFT0C()); + histos.fill(HIST("hEventVertexZ"), coll.posZ()); + + ROOT::Math::XYZVector eventplaneVecT0C{coll.qvecFT0CRe(), coll.qvecFT0CIm(), 0}; + ROOT::Math::XYZVector eventplaneVecTPCA{coll.qvecBPosRe(), coll.qvecBPosIm(), 0}; + ROOT::Math::XYZVector eventplaneVecTPCC{coll.qvecBNegRe(), coll.qvecBNegIm(), 0}; + + const float PsiT0C = std::atan2(coll.qvecFT0CIm(), coll.qvecFT0CRe()) * 0.5f; + histos.fill(HIST("hPsiT0C"), PsiT0C); + histos.fill(HIST("hPsiT0CvsCentFT0C"), coll.centFT0C(), PsiT0C); + + resolution.fill(HIST("QVectorsT0CTPCA"), eventplaneVecT0C.Dot(eventplaneVecTPCA), coll.centFT0C()); + resolution.fill(HIST("QVectorsT0CTPCC"), eventplaneVecT0C.Dot(eventplaneVecTPCC), coll.centFT0C()); + resolution.fill(HIST("QVectorsTPCAC"), eventplaneVecTPCA.Dot(eventplaneVecTPCC), coll.centFT0C()); + resolution.fill(HIST("QVectorsNormT0CTPCA"), eventplaneVecT0C.Dot(eventplaneVecTPCA) / (coll.qTPCR() * coll.sumAmplFT0C()), coll.centFT0C()); + resolution.fill(HIST("QVectorsNormT0CTPCC"), eventplaneVecT0C.Dot(eventplaneVecTPCC) / (coll.qTPCL() * coll.sumAmplFT0C()), coll.centFT0C()); + resolution.fill(HIST("QVectorsNormTPCAC"), eventplaneVecTPCA.Dot(eventplaneVecTPCC) / (coll.qTPCR() * coll.qTPCL()), coll.centFT0C()); + + std::vector bdtScore[nParticles]; + for (auto const& v0 : V0s) { + + /// Add some minimal cuts for single track variables (min number of TPC clusters) + auto negExtra = v0.negTrackExtra_as(); + auto posExtra = v0.posTrackExtra_as(); + + int counter = 0; + bool isLambdaCandidate = 0; + bool isALambdaCandidate = 0; + if (isLambdaAccepted(negExtra, posExtra, counter)) isLambdaCandidate = 1; + if (isAntiLambdaAccepted(negExtra, posExtra, counter)) isALambdaCandidate = 1; + + // pt cut + if (v0.pt() < V0Configs.MinPtV0 || v0.pt() > V0Configs.MaxPtV0) { + continue; + } + + float massV0[nCharges]{v0.mLambda(), v0.mAntiLambda()}; + lambdav2::hMassBeforeSelVsPt[0]->Fill(massV0[0], v0.pt()); + lambdav2::hMassBeforeSelVsPt[1]->Fill(massV0[1], v0.pt()); + + bool isSelectedV0[2]{false, false}; + if (isV0TopoAccepted(v0) && isLambdaCandidate) isSelectedV0[0] = true; + if (isV0TopoAccepted(v0) && isALambdaCandidate) isSelectedV0[1] = true; + + int ChargeIndex = -1; + if (isSelectedV0[0] && !isSelectedV0[1]) { //Lambdas + histos.fill(HIST("hLambdaCandidate"), 0); + ChargeIndex = 0; + } + if (isSelectedV0[1] && !isSelectedV0[0]) { //AntiLambdas + histos.fill(HIST("hLambdaCandidate"), 1); + ChargeIndex = 1; + } + if (isSelectedV0[0] && isSelectedV0[1]) { + histos.fill(HIST("hLambdaCandidate"), 2); + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { + histos.fill(HIST("hLambdaCandidate"), 3); + continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle + } + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) ChargeIndex = 0; + else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) ChargeIndex = 1; + else { + histos.fill(HIST("hLambdaCandidate"), 4); + continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle + } + } + if (!isSelectedV0[0] && !isSelectedV0[1]) continue; + + ROOT::Math::XYZVector lambdaQvec{std::cos(2 * v0.phi()), std::sin(2 * v0.phi()), 0}; + auto v2CSP = lambdaQvec.Dot(eventplaneVecT0C); // not normalised by amplitude + auto lambdaminuspsiT0C = GetPhiInRange(v0.phi() - PsiT0C); + auto v2CEP = std::cos(2.0 * lambdaminuspsiT0C); + ROOT::Math::XYZVector lambdaUvec{std::cos(v0.phi()), std::sin(v0.phi()), 0}; + + // polarization variables + double massLambda = o2::constants::physics::MassLambda; + float cosThetaStarProton[nCharges]; + ROOT::Math::PxPyPzMVector lambdaVector, protonVector[nCharges]; + lambdaVector.SetCoordinates(v0.px(), v0.py(), v0.pz(), massLambda); + ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; + for (int i{0}; i < nCharges; ++i) { + if (i==0) protonVector[i].SetCoordinates(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassProton); + else protonVector[i].SetCoordinates(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassProton); + auto boostedProton{lambdaBoost(protonVector[i])}; + cosThetaStarProton[i] = boostedProton.Pz() / boostedProton.P(); + } + + // acceptance values if requested + double meanCos2ThetaProtonFromLambda = 1; + if (applyAcceptanceCorrection) { + int bin2DLambda = hAcceptanceLambda->FindBin(v0.pt(), v0.eta()); + meanCos2ThetaProtonFromLambda = hAcceptancePrimaryLambda->GetBinContent(bin2DLambda); + } + + double Pzs2Lambda = 0; + double Cos2ThetaLambda = 0; + double CosThetaLambda = 0; + if (ChargeIndex == 0) { + Pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + Cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; + CosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + } + else { + Pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + Cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; + CosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + } + + histos.fill(HIST("hv2CEPvsFT0C"), coll.centFT0C(), v2CEP); + histos.fill(HIST("hv2CEPvsv2CSP"), v2CSP, v2CEP); + histos.fill(HIST("hLambdaPhi"), v0.phi()); + histos.fill(HIST("hlambdaminuspsiT0C"), lambdaminuspsiT0C); + + if (fillingConfigs.isFillTHNLambda) { + if (fillingConfigs.isFillTHN_V2) + histos.get(HIST("hLambdaV2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), v2CEP); + if (fillingConfigs.isFillTHN_Pz){ + histos.get(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), Pzs2Lambda); + } + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda); + } + if (fillingConfigs.isFillTHNLambda_PzVsPsi) { + if (fillingConfigs.isFillTHN_Pz) + histos.get(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), CosThetaLambda, 2 * lambdaminuspsiT0C); + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda, 2 * lambdaminuspsiT0C); + } + } + } + void processAnalyseDataEPCentralFW(CollEventAndSpecPlaneCentralFW const& coll, CascCandidates const& Cascades, DauTracks const&) { @@ -1488,7 +1771,7 @@ struct cascadeFlow { } bool hasEventPlane = 0; // no info at the moment - bool hasSpectatorPlane = 0; // no infor at the moment + bool hasSpectatorPlane = 0; // no info at the moment histos.fill(HIST("hNEvents"), 9.5); histos.fill(HIST("hEventNchCorrelationAfterEP"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); @@ -1707,6 +1990,7 @@ struct cascadeFlow { PROCESS_SWITCH(cascadeFlow, processAnalyseData, "Process to apply ML model to the data", false); PROCESS_SWITCH(cascadeFlow, processAnalyseDataEP2CentralFW, "Process to apply ML model to the data - second order event plane calibration from central framework", false); PROCESS_SWITCH(cascadeFlow, processAnalyseDataEPCentralFW, "Process to apply ML model to the data - event plane calibration from central framework", false); + PROCESS_SWITCH(cascadeFlow, processAnalyseLambdaEP2CentralFW, "Process to measure flow and polarization of Lambda - event plane calibration from central framework", false); PROCESS_SWITCH(cascadeFlow, processAnalyseMC, "Process to apply ML model to the MC", false); PROCESS_SWITCH(cascadeFlow, processMCGen, "Process to store MC generated particles", false); }; From 45b66972c03d580a3e527ef470a64f44fc2bdd40 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 23 Jul 2025 14:12:08 +0000 Subject: [PATCH 2/5] Please consider the following formatting changes --- .../TableProducer/Strangeness/cascadeflow.cxx | 122 ++++++++++-------- 1 file changed, 65 insertions(+), 57 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index bdaaa82f59b..670e11ffbe3 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -51,8 +51,8 @@ using V0Candidates = soa::Join; using CascCandidates = soa::Join; using CascMCCandidates = soa::Join; -const int nParticles = 2; //Xi, Omega -const int nCharges = 2; //Lambda, AntiLambda +const int nParticles = 2; // Xi, Omega +const int nCharges = 2; // Lambda, AntiLambda const int nParameters = 4; namespace cascadev2 @@ -238,7 +238,7 @@ struct cascadeFlow { Configurable rapidityLambda{"rapidityLambda", 0.5, "rapidityLambda"}; Configurable etaLambda{"etaLambda", 0.8, "etaLambda"}; } V0Configs; - + Configurable sideBandStart{"sideBandStart", 5, "Start of the sideband region in number of sigmas"}; Configurable sideBandEnd{"sideBandEnd", 7, "End of the sideband region in number of sigmas"}; Configurable downsample{"downsample", 1., "Downsample training output tree"}; @@ -399,7 +399,7 @@ struct cascadeFlow { // TPC cuts as those implemented for the training of the signal if (doNTPCSigmaCut) { if (std::abs(posExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(negExtra.tpcNSigmaPi()) > nsigmatpcPi) - return false; + return false; } counter++; @@ -415,7 +415,7 @@ struct cascadeFlow { // TPC cuts as those implemented for the training of the signal if (doNTPCSigmaCut) { if (std::abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi) - return false; + return false; } counter++; @@ -427,7 +427,7 @@ struct cascadeFlow { } template - bool isV0TopoAccepted(TV0 v0) + bool isV0TopoAccepted(TV0 v0) { // topological selections if (v0.v0radius() < V0Configs.v0radius) @@ -447,7 +447,7 @@ struct cascadeFlow { return false; if (std::abs(v0.eta()) > V0Configs.etaLambda) return false; - + return true; } @@ -587,7 +587,7 @@ struct cascadeFlow { TList* listAcceptancePrimaryLambda = ccdb->get(acceptancePathsCCDBPrimaryLambda); if (!listAcceptancePrimaryLambda) LOG(fatal) << "Problem getting TList object with acceptance for Primary Lambda!"; - + hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); if (!hAcceptanceXi) { LOG(fatal) << "The histogram for Xi is not there!"; @@ -621,7 +621,7 @@ struct cascadeFlow { const AxisSpec massCascAxis[2]{{static_cast((maxMass[0] - minMass[0]) / 0.001f), minMass[0], maxMass[0], "#Xi candidate mass (GeV/c^{2})"}, {static_cast((maxMass[1] - minMass[1]) / 0.001f), minMass[1], maxMass[1], "#Omega candidate mass (GeV/c^{2})"}}; const AxisSpec massLambdaAxis[2]{{static_cast((maxMassLambda[0] - minMassLambda[0]) / 0.001f), minMassLambda[0], maxMassLambda[0], "#Lambda candidate mass (GeV/c^{2})"}, - {static_cast((maxMassLambda[1] - minMassLambda[1]) / 0.001f), minMassLambda[1], maxMassLambda[1], "#bar{#Lambda} candidate mass (GeV/c^{2})"}}; + {static_cast((maxMassLambda[1] - minMassLambda[1]) / 0.001f), minMassLambda[1], maxMassLambda[1], "#bar{#Lambda} candidate mass (GeV/c^{2})"}}; const AxisSpec ptAxisCasc{static_cast((CandidateConfigs.MaxPt - CandidateConfigs.MinPt) / 0.2), CandidateConfigs.MinPt, CandidateConfigs.MaxPt, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec ptAxisLambda{static_cast((V0Configs.MaxPtV0 - V0Configs.MinPtV0) / 0.2), V0Configs.MinPtV0, V0Configs.MaxPtV0, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec v2Axis{200, -1., 1., "#it{v}_{2}"}; @@ -764,7 +764,7 @@ struct cascadeFlow { if (fillingConfigs.isFillTHN_Pz) histos.add("hLambdaPzVsPsi", "THn for cosTheta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPtLambda, thnAxisMassLambda, thnAxisCosThetaProtonAlpha, thnAxisPsiDiff}); if (fillingConfigs.isFillTHN_Acc) - histos.add("hLambdaCos2ThetaVsPsi", "THn for cos2Theta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPtLambda, thnAxisMassLambda,thnAxisCos2Theta, thnAxisPsiDiff}); + histos.add("hLambdaCos2ThetaVsPsi", "THn for cos2Theta of Lambda", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPtLambda, thnAxisMassLambda, thnAxisCos2Theta, thnAxisPsiDiff}); } histosMCGen.add("h2DGenXiEta08", "h2DGenXiEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); @@ -1500,7 +1500,7 @@ struct cascadeFlow { std::vector bdtScore[nParticles]; for (auto const& v0 : V0s) { - + /// Add some minimal cuts for single track variables (min number of TPC clusters) auto negExtra = v0.negTrackExtra_as(); auto posExtra = v0.posTrackExtra_as(); @@ -1508,9 +1508,11 @@ struct cascadeFlow { int counter = 0; bool isLambdaCandidate = 0; bool isALambdaCandidate = 0; - if (isLambdaAccepted(negExtra, posExtra, counter)) isLambdaCandidate = 1; - if (isAntiLambdaAccepted(negExtra, posExtra, counter)) isALambdaCandidate = 1; - + if (isLambdaAccepted(negExtra, posExtra, counter)) + isLambdaCandidate = 1; + if (isAntiLambdaAccepted(negExtra, posExtra, counter)) + isALambdaCandidate = 1; + // pt cut if (v0.pt() < V0Configs.MinPtV0 || v0.pt() > V0Configs.MaxPtV0) { continue; @@ -1520,34 +1522,39 @@ struct cascadeFlow { lambdav2::hMassBeforeSelVsPt[0]->Fill(massV0[0], v0.pt()); lambdav2::hMassBeforeSelVsPt[1]->Fill(massV0[1], v0.pt()); - bool isSelectedV0[2]{false, false}; - if (isV0TopoAccepted(v0) && isLambdaCandidate) isSelectedV0[0] = true; - if (isV0TopoAccepted(v0) && isALambdaCandidate) isSelectedV0[1] = true; + bool isSelectedV0[2]{false, false}; + if (isV0TopoAccepted(v0) && isLambdaCandidate) + isSelectedV0[0] = true; + if (isV0TopoAccepted(v0) && isALambdaCandidate) + isSelectedV0[1] = true; int ChargeIndex = -1; - if (isSelectedV0[0] && !isSelectedV0[1]) { //Lambdas - histos.fill(HIST("hLambdaCandidate"), 0); - ChargeIndex = 0; + if (isSelectedV0[0] && !isSelectedV0[1]) { // Lambdas + histos.fill(HIST("hLambdaCandidate"), 0); + ChargeIndex = 0; } - if (isSelectedV0[1] && !isSelectedV0[0]) { //AntiLambdas - histos.fill(HIST("hLambdaCandidate"), 1); - ChargeIndex = 1; + if (isSelectedV0[1] && !isSelectedV0[0]) { // AntiLambdas + histos.fill(HIST("hLambdaCandidate"), 1); + ChargeIndex = 1; } if (isSelectedV0[0] && isSelectedV0[1]) { - histos.fill(HIST("hLambdaCandidate"), 2); - if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { - histos.fill(HIST("hLambdaCandidate"), 3); - continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle - } - if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) ChargeIndex = 0; - else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) ChargeIndex = 1; - else { - histos.fill(HIST("hLambdaCandidate"), 4); - continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle - } + histos.fill(HIST("hLambdaCandidate"), 2); + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { + histos.fill(HIST("hLambdaCandidate"), 3); + continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle + } + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) + ChargeIndex = 0; + else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) + ChargeIndex = 1; + else { + histos.fill(HIST("hLambdaCandidate"), 4); + continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle + } } - if (!isSelectedV0[0] && !isSelectedV0[1]) continue; - + if (!isSelectedV0[0] && !isSelectedV0[1]) + continue; + ROOT::Math::XYZVector lambdaQvec{std::cos(2 * v0.phi()), std::sin(2 * v0.phi()), 0}; auto v2CSP = lambdaQvec.Dot(eventplaneVecT0C); // not normalised by amplitude auto lambdaminuspsiT0C = GetPhiInRange(v0.phi() - PsiT0C); @@ -1561,8 +1568,10 @@ struct cascadeFlow { lambdaVector.SetCoordinates(v0.px(), v0.py(), v0.pz(), massLambda); ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; for (int i{0}; i < nCharges; ++i) { - if (i==0) protonVector[i].SetCoordinates(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassProton); - else protonVector[i].SetCoordinates(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassProton); + if (i == 0) + protonVector[i].SetCoordinates(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassProton); + else + protonVector[i].SetCoordinates(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassProton); auto boostedProton{lambdaBoost(protonVector[i])}; cosThetaStarProton[i] = boostedProton.Pz() / boostedProton.P(); } @@ -1578,14 +1587,13 @@ struct cascadeFlow { double Cos2ThetaLambda = 0; double CosThetaLambda = 0; if (ChargeIndex == 0) { - Pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; - Cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - CosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; - } - else { - Pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; - Cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; - CosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + Pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + Cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; + CosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + } else { + Pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + Cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; + CosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; } histos.fill(HIST("hv2CEPvsFT0C"), coll.centFT0C(), v2CEP); @@ -1594,19 +1602,19 @@ struct cascadeFlow { histos.fill(HIST("hlambdaminuspsiT0C"), lambdaminuspsiT0C); if (fillingConfigs.isFillTHNLambda) { - if (fillingConfigs.isFillTHN_V2) - histos.get(HIST("hLambdaV2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), v2CEP); - if (fillingConfigs.isFillTHN_Pz){ - histos.get(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), Pzs2Lambda); - } - if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda); + if (fillingConfigs.isFillTHN_V2) + histos.get(HIST("hLambdaV2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), v2CEP); + if (fillingConfigs.isFillTHN_Pz) { + histos.get(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), Pzs2Lambda); + } + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda); } if (fillingConfigs.isFillTHNLambda_PzVsPsi) { - if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), CosThetaLambda, 2 * lambdaminuspsiT0C); - if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda, 2 * lambdaminuspsiT0C); + if (fillingConfigs.isFillTHN_Pz) + histos.get(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), CosThetaLambda, 2 * lambdaminuspsiT0C); + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda, 2 * lambdaminuspsiT0C); } } } From 5bff6bc97a224d607651a895089e1281b0131ded Mon Sep 17 00:00:00 2001 From: Chiara De Martin Date: Mon, 28 Jul 2025 10:24:29 +0200 Subject: [PATCH 3/5] remove unused variable --- PWGLF/TableProducer/Strangeness/cascadeflow.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 670e11ffbe3..ea86cdce66f 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -1470,11 +1470,6 @@ struct cascadeFlow { } } - // event has FT0C event plane - bool hasEventPlane = 0; - if (std::abs(coll.qvecFT0CRe()) < 990 && std::abs(coll.qvecFT0CIm()) < 990) - hasEventPlane = 1; - histos.fill(HIST("hNEvents"), 9.5); histos.fill(HIST("hEventNchCorrelationAfterEP"), coll.multNTracksPVeta1(), coll.multNTracksGlobal()); histos.fill(HIST("hEventPVcontributorsVsCentralityAfterEP"), coll.centFT0C(), coll.multNTracksPVeta1()); From 14ccf352acea91d3c6bf602dce551f0411a819d8 Mon Sep 17 00:00:00 2001 From: Chiara De Martin Date: Mon, 28 Jul 2025 11:20:16 +0200 Subject: [PATCH 4/5] fix lower camel case + add QA histos for Lambdas --- .../TableProducer/Strangeness/cascadeflow.cxx | 270 +++++++++--------- 1 file changed, 136 insertions(+), 134 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index ea86cdce66f..b51ce134de8 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -662,6 +662,8 @@ struct cascadeFlow { histos.add("hLambdaCandidate", "hLambdaCandidate", HistType::kTH1F, {{5, -0.5, 4.5}}); histos.add("hCascadeSignal", "hCascadeSignal", HistType::kTH1F, {{6, -0.5, 5.5}}); histos.add("hCascade", "hCascade", HistType::kTH1F, {{6, -0.5, 5.5}}); + histos.add("hLambdaDauSel", "hLambdaDauSel", HistType::kTH1F, {{3, -0.5, 2.5}}); + histos.add("hALambdaDauSel", "hALambdaDauSel", HistType::kTH1F, {{3, -0.5, 2.5}}); histos.add("hXiPtvsCent", "hXiPtvsCent", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histos.add("hXiPtvsCentEta08", "hXiPtvsCentEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histos.add("hXiPtvsCentY05", "hXiPtvsCentY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); @@ -1052,9 +1054,9 @@ struct cascadeFlow { auto etaLambda = RecoDecay::eta(std::array{casc.pxlambda(), casc.pylambda(), casc.pzlambda()}); // acceptance values if requested - double MeanCos2ThetaLambdaFromXi = 1; - double MeanCos2ThetaLambdaFromOmega = 1; - double MeanCos2ThetaProtonFromLambda = 1; + double meanCos2ThetaLambdaFromXi = 1; + double meanCos2ThetaLambdaFromOmega = 1; + double meanCos2ThetaProtonFromLambda = 1; if (applyAcceptanceCorrection) { if (ptLambda < CandidateConfigs.MinPtLambda || ptLambda > CandidateConfigs.MaxPtLambda) { continue; @@ -1066,24 +1068,24 @@ struct cascadeFlow { int bin2DXi = hAcceptanceXi->FindBin(casc.pt(), casc.eta()); int bin2DOmega = hAcceptanceOmega->FindBin(casc.pt(), casc.eta()); int bin2DLambda = hAcceptanceLambda->FindBin(ptLambda, etaLambda); - MeanCos2ThetaLambdaFromXi = hAcceptanceXi->GetBinContent(bin2DXi); - MeanCos2ThetaLambdaFromOmega = hAcceptanceOmega->GetBinContent(bin2DOmega); - MeanCos2ThetaProtonFromLambda = hAcceptanceLambda->GetBinContent(bin2DLambda); + meanCos2ThetaLambdaFromXi = hAcceptanceXi->GetBinContent(bin2DXi); + meanCos2ThetaLambdaFromOmega = hAcceptanceOmega->GetBinContent(bin2DOmega); + meanCos2ThetaProtonFromLambda = hAcceptanceLambda->GetBinContent(bin2DLambda); } - int ChargeIndex = 0; + int chargeIndex = 0; if (casc.sign() > 0) - ChargeIndex = 1; - double Pzs2Xi = cosThetaStarLambda[0] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaXi[ChargeIndex] / MeanCos2ThetaLambdaFromXi; - double Pzs2Omega = cosThetaStarLambda[1] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaOmega[ChargeIndex] / MeanCos2ThetaLambdaFromOmega; - double Cos2ThetaXi = cosThetaStarLambda[0] * cosThetaStarLambda[0]; - double Cos2ThetaOmega = cosThetaStarLambda[1] * cosThetaStarLambda[1]; - double Pzs2LambdaFromCasc = cosThetaStarProton * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaLambda[ChargeIndex] / MeanCos2ThetaProtonFromLambda; - double Cos2ThetaLambda = cosThetaStarProton * cosThetaStarProton; - - double CosThetaXiWithAlpha = cosThetaStarLambda[0] / cascadev2::AlphaXi[ChargeIndex]; - double CosThetaOmegaWithAlpha = cosThetaStarLambda[1] / cascadev2::AlphaOmega[ChargeIndex]; - double CosThetaProtonWithAlpha = cosThetaStarProton / cascadev2::AlphaLambda[ChargeIndex]; + chargeIndex = 1; + double pzs2Xi = cosThetaStarLambda[0] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaXi[chargeIndex] / meanCos2ThetaLambdaFromXi; + double pzs2Omega = cosThetaStarLambda[1] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaOmega[chargeIndex] / meanCos2ThetaLambdaFromOmega; + double cos2ThetaXi = cosThetaStarLambda[0] * cosThetaStarLambda[0]; + double cos2ThetaOmega = cosThetaStarLambda[1] * cosThetaStarLambda[1]; + double pzs2LambdaFromCasc = cosThetaStarProton * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaLambda[chargeIndex] / meanCos2ThetaProtonFromLambda; + double cos2ThetaLambda = cosThetaStarProton * cosThetaStarProton; + + double cosThetaXiWithAlpha = cosThetaStarLambda[0] / cascadev2::AlphaXi[chargeIndex]; + double cosThetaOmegaWithAlpha = cosThetaStarLambda[1] / cascadev2::AlphaOmega[chargeIndex]; + double cosThetaProtonWithAlpha = cosThetaStarProton / cascadev2::AlphaLambda[chargeIndex]; histos.fill(HIST("hv2CEPvsFT0C"), coll.centFT0C(), v2CEP); histos.fill(HIST("hv2CEPvsv2CSP"), v2CSP, v2CEP); @@ -1110,73 +1112,73 @@ struct cascadeFlow { if (std::abs(casc.eta()) < CandidateConfigs.etaCasc) { if (fillingConfigs.isFillTHNXi) { if (fillingConfigs.isFillTHN_V2) - histos.get(HIST("hXiV2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], v2CEP); + histos.get(HIST("hXiV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], v2CEP); if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], Pzs2Xi); + histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2Xi); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hXiPzs2FromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], Pzs2LambdaFromCasc); + histos.get(HIST("hXiPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2LambdaFromCasc); } if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hXiCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaXi); + histos.get(HIST("hXiCos2Theta"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaXi); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hXiCos2ThetaFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaLambda); + histos.get(HIST("hXiCos2ThetaFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaLambda); if (casc.mXi() > CandidateConfigs.MinXiMass && casc.mXi() < CandidateConfigs.MaxXiMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hXiCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], Cos2ThetaLambda); + histos.get(HIST("hXiCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], cos2ThetaLambda); histos.get(HIST("massXi_ProtonAcc"))->Fill(casc.mXi()); } } if (fillingConfigs.isFillTHNXi_PzVsPsi) { if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hXiPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], CosThetaXiWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hXiPzVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], cosThetaXiWithAlpha, 2 * cascminuspsiT0C); if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hXiPzVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], CosThetaProtonWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hXiPzVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], cosThetaProtonWithAlpha, 2 * cascminuspsiT0C); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hXiCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaXi, 2 * cascminuspsiT0C); + histos.get(HIST("hXiCos2ThetaVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaXi, 2 * cascminuspsiT0C); } if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hXiCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hXiCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaLambda, 2 * cascminuspsiT0C); if (casc.mXi() > CandidateConfigs.MinXiMass && casc.mXi() < CandidateConfigs.MaxXiMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hXiCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hXiCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], cos2ThetaLambda, 2 * cascminuspsiT0C); histos.get(HIST("massXi_ProtonAcc"))->Fill(casc.mXi()); } } if (fillingConfigs.isFillTHNOmega) { if (fillingConfigs.isFillTHN_V2) - histos.get(HIST("hOmegaV2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], v2CEP); + histos.get(HIST("hOmegaV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], v2CEP); if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], Pzs2Omega); + histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2Omega); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hOmegaPzs2FromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], Pzs2LambdaFromCasc); + histos.get(HIST("hOmegaPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2LambdaFromCasc); } if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hOmegaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaOmega); + histos.get(HIST("hOmegaCos2Theta"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaOmega); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hOmegaCos2ThetaFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaLambda); + histos.get(HIST("hOmegaCos2ThetaFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaLambda); if (casc.mOmega() > CandidateConfigs.MinOmegaMass && casc.mOmega() < CandidateConfigs.MaxOmegaMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hOmegaCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], Cos2ThetaLambda); + histos.get(HIST("hOmegaCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], cos2ThetaLambda); histos.get(HIST("massOmega_ProtonAcc"))->Fill(casc.mOmega()); } } if (fillingConfigs.isFillTHNOmega_PzVsPsi) { if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hOmegaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], CosThetaOmegaWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaPzVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], cosThetaOmegaWithAlpha, 2 * cascminuspsiT0C); if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hOmegaPzVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], CosThetaProtonWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaPzVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], cosThetaProtonWithAlpha, 2 * cascminuspsiT0C); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hOmegaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaOmega, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaOmega, 2 * cascminuspsiT0C); } if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaLambda, 2 * cascminuspsiT0C); if (casc.mOmega() > CandidateConfigs.MinOmegaMass && casc.mOmega() < CandidateConfigs.MaxOmegaMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], cos2ThetaLambda, 2 * cascminuspsiT0C); histos.get(HIST("massOmega_ProtonAcc"))->Fill(casc.mOmega()); } } @@ -1242,7 +1244,7 @@ struct cascadeFlow { int counter = 0; IsCascAccepted(casc, negExtra, posExtra, bachExtra, counter); histos.fill(HIST("hCascade"), counter); - + // ML selections bool isSelectedCasc[nParticles]{false, false}; @@ -1321,9 +1323,9 @@ struct cascadeFlow { auto etaLambda = RecoDecay::eta(std::array{casc.pxlambda(), casc.pylambda(), casc.pzlambda()}); // acceptance values if requested - double MeanCos2ThetaLambdaFromXi = 1; - double MeanCos2ThetaLambdaFromOmega = 1; - double MeanCos2ThetaProtonFromLambda = 1; + double meanCos2ThetaLambdaFromXi = 1; + double meanCos2ThetaLambdaFromOmega = 1; + double meanCos2ThetaProtonFromLambda = 1; if (applyAcceptanceCorrection) { if (ptLambda < CandidateConfigs.MinPtLambda || ptLambda > CandidateConfigs.MaxPtLambda) { continue; @@ -1335,24 +1337,24 @@ struct cascadeFlow { int bin2DXi = hAcceptanceXi->FindBin(casc.pt(), casc.eta()); int bin2DOmega = hAcceptanceOmega->FindBin(casc.pt(), casc.eta()); int bin2DLambda = hAcceptanceLambda->FindBin(ptLambda, etaLambda); - MeanCos2ThetaLambdaFromXi = hAcceptanceXi->GetBinContent(bin2DXi); - MeanCos2ThetaLambdaFromOmega = hAcceptanceOmega->GetBinContent(bin2DOmega); - MeanCos2ThetaProtonFromLambda = hAcceptanceLambda->GetBinContent(bin2DLambda); + meanCos2ThetaLambdaFromXi = hAcceptanceXi->GetBinContent(bin2DXi); + meanCos2ThetaLambdaFromOmega = hAcceptanceOmega->GetBinContent(bin2DOmega); + meanCos2ThetaProtonFromLambda = hAcceptanceLambda->GetBinContent(bin2DLambda); } - int ChargeIndex = 0; + int chargeIndex = 0; if (casc.sign() > 0) - ChargeIndex = 1; - double Pzs2Xi = cosThetaStarLambda[0] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaXi[ChargeIndex] / MeanCos2ThetaLambdaFromXi; - double Pzs2Omega = cosThetaStarLambda[1] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaOmega[ChargeIndex] / MeanCos2ThetaLambdaFromOmega; - double Cos2ThetaXi = cosThetaStarLambda[0] * cosThetaStarLambda[0]; - double Cos2ThetaOmega = cosThetaStarLambda[1] * cosThetaStarLambda[1]; - double Pzs2LambdaFromCasc = cosThetaStarProton * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaLambda[ChargeIndex] / MeanCos2ThetaProtonFromLambda; - double Cos2ThetaLambda = cosThetaStarProton * cosThetaStarProton; - - double CosThetaXiWithAlpha = cosThetaStarLambda[0] / cascadev2::AlphaXi[ChargeIndex]; - double CosThetaOmegaWithAlpha = cosThetaStarLambda[1] / cascadev2::AlphaOmega[ChargeIndex]; - double CosThetaProtonWithAlpha = cosThetaStarProton / cascadev2::AlphaLambda[ChargeIndex]; + chargeIndex = 1; + double pzs2Xi = cosThetaStarLambda[0] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaXi[chargeIndex] / meanCos2ThetaLambdaFromXi; + double pzs2Omega = cosThetaStarLambda[1] * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaOmega[chargeIndex] / meanCos2ThetaLambdaFromOmega; + double cos2ThetaXi = cosThetaStarLambda[0] * cosThetaStarLambda[0]; + double cos2ThetaOmega = cosThetaStarLambda[1] * cosThetaStarLambda[1]; + double pzs2LambdaFromCasc = cosThetaStarProton * std::sin(2 * (casc.phi() - PsiT0C)) / cascadev2::AlphaLambda[chargeIndex] / meanCos2ThetaProtonFromLambda; + double cos2ThetaLambda = cosThetaStarProton * cosThetaStarProton; + + double cosThetaXiWithAlpha = cosThetaStarLambda[0] / cascadev2::AlphaXi[chargeIndex]; + double cosThetaOmegaWithAlpha = cosThetaStarLambda[1] / cascadev2::AlphaOmega[chargeIndex]; + double cosThetaProtonWithAlpha = cosThetaStarProton / cascadev2::AlphaLambda[chargeIndex]; histos.fill(HIST("hv2CEPvsFT0C"), coll.centFT0C(), v2CEP); histos.fill(HIST("hv2CEPvsv2CSP"), v2CSP, v2CEP); @@ -1377,73 +1379,73 @@ struct cascadeFlow { if (std::abs(casc.eta()) < CandidateConfigs.etaCasc) { if (fillingConfigs.isFillTHNXi) { if (fillingConfigs.isFillTHN_V2) - histos.get(HIST("hXiV2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], v2CEP); + histos.get(HIST("hXiV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], v2CEP); if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], Pzs2Xi); + histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2Xi); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hXiPzs2FromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], Pzs2LambdaFromCasc); + histos.get(HIST("hXiPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2LambdaFromCasc); } if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hXiCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaXi); + histos.get(HIST("hXiCos2Theta"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaXi); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hXiCos2ThetaFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaLambda); + histos.get(HIST("hXiCos2ThetaFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaLambda); if (casc.mXi() > CandidateConfigs.MinXiMass && casc.mXi() < CandidateConfigs.MaxXiMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hXiCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], Cos2ThetaLambda); + histos.get(HIST("hXiCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], cos2ThetaLambda); histos.get(HIST("massXi_ProtonAcc"))->Fill(casc.mXi()); } } if (fillingConfigs.isFillTHNXi_PzVsPsi) { if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hXiPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], CosThetaXiWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hXiPzVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], cosThetaXiWithAlpha, 2 * cascminuspsiT0C); if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hXiPzVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], CosThetaProtonWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hXiPzVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], cosThetaProtonWithAlpha, 2 * cascminuspsiT0C); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hXiCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaXi, 2 * cascminuspsiT0C); + histos.get(HIST("hXiCos2ThetaVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaXi, 2 * cascminuspsiT0C); } if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hXiCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hXiCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mXi(), BDTresponse[0], cos2ThetaLambda, 2 * cascminuspsiT0C); if (casc.mXi() > CandidateConfigs.MinXiMass && casc.mXi() < CandidateConfigs.MaxXiMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hXiCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hXiCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[0], cos2ThetaLambda, 2 * cascminuspsiT0C); histos.get(HIST("massXi_ProtonAcc"))->Fill(casc.mXi()); } } if (fillingConfigs.isFillTHNOmega) { if (fillingConfigs.isFillTHN_V2) - histos.get(HIST("hOmegaV2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], v2CEP); + histos.get(HIST("hOmegaV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], v2CEP); if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], Pzs2Omega); + histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2Omega); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hOmegaPzs2FromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], Pzs2LambdaFromCasc); + histos.get(HIST("hOmegaPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2LambdaFromCasc); } if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hOmegaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaOmega); + histos.get(HIST("hOmegaCos2Theta"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaOmega); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hOmegaCos2ThetaFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaLambda); + histos.get(HIST("hOmegaCos2ThetaFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaLambda); if (casc.mOmega() > CandidateConfigs.MinOmegaMass && casc.mOmega() < CandidateConfigs.MaxOmegaMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hOmegaCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], Cos2ThetaLambda); + histos.get(HIST("hOmegaCos2ThetaFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], cos2ThetaLambda); histos.get(HIST("massOmega_ProtonAcc"))->Fill(casc.mOmega()); } } if (fillingConfigs.isFillTHNOmega_PzVsPsi) { if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hOmegaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], CosThetaOmegaWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaPzVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], cosThetaOmegaWithAlpha, 2 * cascminuspsiT0C); if (fillingConfigs.isFillTHN_PzFromLambda) - histos.get(HIST("hOmegaPzVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], CosThetaProtonWithAlpha, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaPzVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], cosThetaProtonWithAlpha, 2 * cascminuspsiT0C); if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hOmegaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaOmega, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaOmega, 2 * cascminuspsiT0C); } if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) - histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), ChargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.eta(), casc.pt(), casc.mOmega(), BDTresponse[1], cos2ThetaLambda, 2 * cascminuspsiT0C); if (casc.mOmega() > CandidateConfigs.MinOmegaMass && casc.mOmega() < CandidateConfigs.MaxOmegaMass) { if (fillingConfigs.isFillTHN_AccFromLambdaVsLambda) - histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), ChargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], Cos2ThetaLambda, 2 * cascminuspsiT0C); + histos.get(HIST("hOmegaCos2ThetaVsPsiFromLambdaL"))->Fill(coll.centFT0C(), chargeIndex, etaLambda, ptLambda, casc.mLambda(), BDTresponse[1], cos2ThetaLambda, 2 * cascminuspsiT0C); histos.get(HIST("massOmega_ProtonAcc"))->Fill(casc.mOmega()); } } @@ -1482,9 +1484,9 @@ struct cascadeFlow { ROOT::Math::XYZVector eventplaneVecTPCA{coll.qvecBPosRe(), coll.qvecBPosIm(), 0}; ROOT::Math::XYZVector eventplaneVecTPCC{coll.qvecBNegRe(), coll.qvecBNegIm(), 0}; - const float PsiT0C = std::atan2(coll.qvecFT0CIm(), coll.qvecFT0CRe()) * 0.5f; - histos.fill(HIST("hPsiT0C"), PsiT0C); - histos.fill(HIST("hPsiT0CvsCentFT0C"), coll.centFT0C(), PsiT0C); + const float psiT0C = std::atan2(coll.qvecFT0CIm(), coll.qvecFT0CRe()) * 0.5f; + histos.fill(HIST("hPsiT0C"), psiT0C); + histos.fill(HIST("hPsiT0CvsCentFT0C"), coll.centFT0C(), psiT0C); resolution.fill(HIST("QVectorsT0CTPCA"), eventplaneVecT0C.Dot(eventplaneVecTPCA), coll.centFT0C()); resolution.fill(HIST("QVectorsT0CTPCC"), eventplaneVecT0C.Dot(eventplaneVecTPCC), coll.centFT0C()); @@ -1500,14 +1502,15 @@ struct cascadeFlow { auto negExtra = v0.negTrackExtra_as(); auto posExtra = v0.posTrackExtra_as(); - int counter = 0; + int counterLambda = 0; + int counterALambda = 0; bool isLambdaCandidate = 0; bool isALambdaCandidate = 0; - if (isLambdaAccepted(negExtra, posExtra, counter)) - isLambdaCandidate = 1; - if (isAntiLambdaAccepted(negExtra, posExtra, counter)) - isALambdaCandidate = 1; - + if (isLambdaAccepted(negExtra, posExtra, counterLambda)) isLambdaCandidate = 1; + if (isAntiLambdaAccepted(negExtra, posExtra, counterALambda)) isALambdaCandidate = 1; + histos.fill(HIST("hLambdaDauSel"), counterLambda); + histos.fill(HIST("hALambdaDauSel"), counterALambda); + // pt cut if (v0.pt() < V0Configs.MinPtV0 || v0.pt() > V0Configs.MaxPtV0) { continue; @@ -1523,36 +1526,34 @@ struct cascadeFlow { if (isV0TopoAccepted(v0) && isALambdaCandidate) isSelectedV0[1] = true; - int ChargeIndex = -1; - if (isSelectedV0[0] && !isSelectedV0[1]) { // Lambdas - histos.fill(HIST("hLambdaCandidate"), 0); - ChargeIndex = 0; + int chargeIndex = -1; + if (isSelectedV0[0] && !isSelectedV0[1]) { //Lambdas + histos.fill(HIST("hLambdaCandidate"), 0); + chargeIndex = 0; } - if (isSelectedV0[1] && !isSelectedV0[0]) { // AntiLambdas - histos.fill(HIST("hLambdaCandidate"), 1); - ChargeIndex = 1; + if (isSelectedV0[1] && !isSelectedV0[0]) { //AntiLambdas + histos.fill(HIST("hLambdaCandidate"), 1); + chargeIndex = 1; } if (isSelectedV0[0] && isSelectedV0[1]) { - histos.fill(HIST("hLambdaCandidate"), 2); - if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { - histos.fill(HIST("hLambdaCandidate"), 3); - continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle - } - if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) - ChargeIndex = 0; - else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) - ChargeIndex = 1; - else { - histos.fill(HIST("hLambdaCandidate"), 4); - continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle - } + histos.fill(HIST("hLambdaCandidate"), 2); + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { + histos.fill(HIST("hLambdaCandidate"), 3); + continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle + } + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) chargeIndex = 0; + else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) chargeIndex = 1; + else { + histos.fill(HIST("hLambdaCandidate"), 4); + continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle + } } if (!isSelectedV0[0] && !isSelectedV0[1]) continue; ROOT::Math::XYZVector lambdaQvec{std::cos(2 * v0.phi()), std::sin(2 * v0.phi()), 0}; auto v2CSP = lambdaQvec.Dot(eventplaneVecT0C); // not normalised by amplitude - auto lambdaminuspsiT0C = GetPhiInRange(v0.phi() - PsiT0C); + auto lambdaminuspsiT0C = GetPhiInRange(v0.phi() - psiT0C); auto v2CEP = std::cos(2.0 * lambdaminuspsiT0C); ROOT::Math::XYZVector lambdaUvec{std::cos(v0.phi()), std::sin(v0.phi()), 0}; @@ -1578,17 +1579,18 @@ struct cascadeFlow { meanCos2ThetaProtonFromLambda = hAcceptancePrimaryLambda->GetBinContent(bin2DLambda); } - double Pzs2Lambda = 0; - double Cos2ThetaLambda = 0; - double CosThetaLambda = 0; - if (ChargeIndex == 0) { - Pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; - Cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - CosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; - } else { - Pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - PsiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; - Cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; - CosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + double pzs2Lambda = 0; + double cos2ThetaLambda = 0; + double cosThetaLambda = 0; + if (chargeIndex == 0) { + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + } + else { + pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; + cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; } histos.fill(HIST("hv2CEPvsFT0C"), coll.centFT0C(), v2CEP); @@ -1597,19 +1599,19 @@ struct cascadeFlow { histos.fill(HIST("hlambdaminuspsiT0C"), lambdaminuspsiT0C); if (fillingConfigs.isFillTHNLambda) { - if (fillingConfigs.isFillTHN_V2) - histos.get(HIST("hLambdaV2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), v2CEP); - if (fillingConfigs.isFillTHN_Pz) { - histos.get(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), Pzs2Lambda); - } - if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda); + if (fillingConfigs.isFillTHN_V2) + histos.get(HIST("hLambdaV2"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), v2CEP); + if (fillingConfigs.isFillTHN_Pz){ + histos.get(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); + } + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda); } if (fillingConfigs.isFillTHNLambda_PzVsPsi) { - if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.pt(), v0.mLambda(), CosThetaLambda, 2 * lambdaminuspsiT0C); - if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), ChargeIndex, v0.eta(), v0.pt(), v0.mLambda(), Cos2ThetaLambda, 2 * lambdaminuspsiT0C); + if (fillingConfigs.isFillTHN_Pz) + histos.get(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C); + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda, 2 * lambdaminuspsiT0C); } } } @@ -1679,7 +1681,7 @@ struct cascadeFlow { int counter = 0; IsCascAccepted(casc, negExtra, posExtra, bachExtra, counter); histos.fill(HIST("hCascade"), counter); - + // ML selections bool isSelectedCasc[nParticles]{false, false}; From 955541b015c931104757c10ef637377d3b34f8a2 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 28 Jul 2025 09:38:26 +0000 Subject: [PATCH 5/5] Please consider the following formatting changes --- .../TableProducer/Strangeness/cascadeflow.cxx | 85 ++++++++++--------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index b51ce134de8..ae997e2d1fc 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -1244,7 +1244,7 @@ struct cascadeFlow { int counter = 0; IsCascAccepted(casc, negExtra, posExtra, bachExtra, counter); histos.fill(HIST("hCascade"), counter); - + // ML selections bool isSelectedCasc[nParticles]{false, false}; @@ -1506,11 +1506,13 @@ struct cascadeFlow { int counterALambda = 0; bool isLambdaCandidate = 0; bool isALambdaCandidate = 0; - if (isLambdaAccepted(negExtra, posExtra, counterLambda)) isLambdaCandidate = 1; - if (isAntiLambdaAccepted(negExtra, posExtra, counterALambda)) isALambdaCandidate = 1; + if (isLambdaAccepted(negExtra, posExtra, counterLambda)) + isLambdaCandidate = 1; + if (isAntiLambdaAccepted(negExtra, posExtra, counterALambda)) + isALambdaCandidate = 1; histos.fill(HIST("hLambdaDauSel"), counterLambda); histos.fill(HIST("hALambdaDauSel"), counterALambda); - + // pt cut if (v0.pt() < V0Configs.MinPtV0 || v0.pt() > V0Configs.MaxPtV0) { continue; @@ -1527,26 +1529,28 @@ struct cascadeFlow { isSelectedV0[1] = true; int chargeIndex = -1; - if (isSelectedV0[0] && !isSelectedV0[1]) { //Lambdas - histos.fill(HIST("hLambdaCandidate"), 0); - chargeIndex = 0; + if (isSelectedV0[0] && !isSelectedV0[1]) { // Lambdas + histos.fill(HIST("hLambdaCandidate"), 0); + chargeIndex = 0; } - if (isSelectedV0[1] && !isSelectedV0[0]) { //AntiLambdas - histos.fill(HIST("hLambdaCandidate"), 1); - chargeIndex = 1; + if (isSelectedV0[1] && !isSelectedV0[0]) { // AntiLambdas + histos.fill(HIST("hLambdaCandidate"), 1); + chargeIndex = 1; } if (isSelectedV0[0] && isSelectedV0[1]) { - histos.fill(HIST("hLambdaCandidate"), 2); - if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { - histos.fill(HIST("hLambdaCandidate"), 3); - continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle - } - if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) chargeIndex = 0; - else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) chargeIndex = 1; - else { - histos.fill(HIST("hLambdaCandidate"), 4); - continue; //in case of ambiguity between Lambda and AntiLambda, I skip the particle - } + histos.fill(HIST("hLambdaCandidate"), 2); + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { + histos.fill(HIST("hLambdaCandidate"), 3); + continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle + } + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) + chargeIndex = 0; + else if (v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) + chargeIndex = 1; + else { + histos.fill(HIST("hLambdaCandidate"), 4); + continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle + } } if (!isSelectedV0[0] && !isSelectedV0[1]) continue; @@ -1583,14 +1587,13 @@ struct cascadeFlow { double cos2ThetaLambda = 0; double cosThetaLambda = 0; if (chargeIndex == 0) { - pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; - cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; - } - else { - pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; - cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; - cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0C)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + } else { + pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0C)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; + cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; } histos.fill(HIST("hv2CEPvsFT0C"), coll.centFT0C(), v2CEP); @@ -1599,19 +1602,19 @@ struct cascadeFlow { histos.fill(HIST("hlambdaminuspsiT0C"), lambdaminuspsiT0C); if (fillingConfigs.isFillTHNLambda) { - if (fillingConfigs.isFillTHN_V2) - histos.get(HIST("hLambdaV2"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), v2CEP); - if (fillingConfigs.isFillTHN_Pz){ - histos.get(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); - } - if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda); + if (fillingConfigs.isFillTHN_V2) + histos.get(HIST("hLambdaV2"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), v2CEP); + if (fillingConfigs.isFillTHN_Pz) { + histos.get(HIST("hLambdaPzs2"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); + } + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2Theta"))->Fill(coll.centFT0C(), chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda); } if (fillingConfigs.isFillTHNLambda_PzVsPsi) { - if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C); - if (fillingConfigs.isFillTHN_Acc) - histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda, 2 * lambdaminuspsiT0C); + if (fillingConfigs.isFillTHN_Pz) + histos.get(HIST("hLambdaPzVsPsi"))->Fill(coll.centFT0C(), chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C); + if (fillingConfigs.isFillTHN_Acc) + histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(coll.centFT0C(), chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda, 2 * lambdaminuspsiT0C); } } } @@ -1681,7 +1684,7 @@ struct cascadeFlow { int counter = 0; IsCascAccepted(casc, negExtra, posExtra, bachExtra, counter); histos.fill(HIST("hCascade"), counter); - + // ML selections bool isSelectedCasc[nParticles]{false, false};