From 0b0d64f2cb4a3f8b812b1fecf756509c1c387c05 Mon Sep 17 00:00:00 2001 From: Preet Pati Date: Sat, 12 Apr 2025 10:23:03 +0200 Subject: [PATCH 1/5] Recommiting after precommit fixes --- PWGCF/Flow/Tasks/resonancesGfwFlow.cxx | 75 ++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx index 2c097b33af3..87d1b3ff27f 100644 --- a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx +++ b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx @@ -148,6 +148,11 @@ struct ResonancesGfwFlow { O2_DEFINE_CONFIGURABLE(cfgUseWeightPhiEtaPt, bool, false, "Use Phi, Eta, Pt dependent NUA weights") O2_DEFINE_CONFIGURABLE(cfgUseBootStrap, bool, true, "Use bootstrap for error estimation") + O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, false, "Use track density efficiency correction") + + Configurable> cfgTrackDensityP0{"cfgTrackDensityP0", std::vector{0.7217476707, 0.7384792571, 0.7542625668, 0.7640680200, 0.7701951667, 0.7755299053, 0.7805901710, 0.7849446786, 0.7957356586, 0.8113039262, 0.8211968966, 0.8280558878, 0.8329342135}, "parameter 0 for track density efficiency correction"}; + Configurable> cfgTrackDensityP1{"cfgTrackDensityP1", std::vector{-2.169488e-05, -2.191913e-05, -2.295484e-05, -2.556538e-05, -2.754463e-05, -2.816832e-05, -2.846502e-05, -2.843857e-05, -2.705974e-05, -2.477018e-05, -2.321730e-05, -2.203315e-05, -2.109474e-05}, "parameter 1 for track density efficiency correction"}; + // Defining configurable axis ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; @@ -196,6 +201,13 @@ struct ResonancesGfwFlow { std::vector mAcceptance; bool correctionsLoaded = false; + // local track density correction + std::vector funcEff; + TH1D* hFindPtBin; + TF1* funcV2; + TF1* funcV3; + TF1* funcV4; + void init(InitContext const&) { ccdb->setURL(ccdbUrl.value); @@ -421,6 +433,25 @@ struct ResonancesGfwFlow { corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2 2} refN08 {-2 -2}", "AnLamB08Gap24", kTRUE)); fGFW->CreateRegions(); + + if (cfgTrackDensityCorrUse) { + std::vector pTEffBins = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.4, 1.8, 2.2, 2.6, 3.0}; + hFindPtBin = new TH1D("hFindPtBin", "hFindPtBin", pTEffBins.size() - 1, &pTEffBins[0]); + funcEff.resize(pTEffBins.size() - 1); + // LHC24g3 Eff + std::vector f1p0 = cfgTrackDensityP0; + std::vector f1p1 = cfgTrackDensityP1; + for (uint ifunc = 0; ifunc < pTEffBins.size() - 1; ifunc++) { + funcEff[ifunc] = new TF1(Form("funcEff%i", ifunc), "[0]+[1]*x", 0, 3000); + funcEff[ifunc]->SetParameters(f1p0[ifunc], f1p1[ifunc]); + } + funcV2 = new TF1("funcV2", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + funcV2->SetParameters(0.0186111, 0.00351907, -4.38264e-05, 1.35383e-07, -3.96266e-10); + funcV3 = new TF1("funcV3", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + funcV3->SetParameters(0.0174056, 0.000703329, -1.45044e-05, 1.91991e-07, -1.62137e-09); + funcV4 = new TF1("funcV4", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + funcV4->SetParameters(0.008845, 0.000259668, -3.24435e-06, 4.54837e-08, -6.01825e-10); + } } template @@ -957,6 +988,36 @@ struct ResonancesGfwFlow { loadCorrections(bc); // load corrections for the each event + // Track loop for calculating the Qn angles + double psi2Est = 0, psi3Est = 0, psi4Est = 0; + float wEPeff = 1; + double v2 = 0, v3 = 0, v4 = 0; + // be cautious, this only works for Pb-Pb + // esimate the Qn angles and vn for this event + if (cfgTrackDensityCorrUse) { + double q2x = 0, q2y = 0; + double q3x = 0, q3y = 0; + double q4x = 0, q4y = 0; + for (const auto& track : tracks) { + bool withinPtRef = (cfgCutPtMin < track.pt()) && (track.pt() < cfgCutPtMax); // within RF pT rang + if (withinPtRef) { + q2x += std::cos(2 * track.phi()); + q2y += std::sin(2 * track.phi()); + q3x += std::cos(3 * track.phi()); + q3y += std::sin(3 * track.phi()); + q4x += std::cos(4 * track.phi()); + q4y += std::sin(4 * track.phi()); + } + } + psi2Est = std::atan2(q2y, q2x) / 2.; + psi3Est = std::atan2(q3y, q3x) / 3.; + psi4Est = std::atan2(q4y, q4x) / 4.; + v2 = funcV2->Eval(cent); + v3 = funcV3->Eval(cent); + v4 = funcV4->Eval(cent); + } + + // Actual track loop for (auto const& track : tracks) { if (!selectionTrack(track)) continue; @@ -968,6 +1029,20 @@ struct ResonancesGfwFlow { fillWeights(track, collision, hRef); double waccRef = getAcceptance(track, collision, 0); + + if (cfgTrackDensityCorrUse && withinPtRef) { + double fphi = v2 * std::cos(2 * (track.phi() - psi2Est)) + v3 * std::cos(3 * (track.phi() - psi3Est)) + v4 * std::cos(4 * (track.phi() - psi4Est)); + fphi = (1 + 2 * fphi); + int pTBinForEff = hFindPtBin->FindBin(track.pt()); + if (pTBinForEff >= 1 && pTBinForEff <= hFindPtBin->GetNbinsX()) { + wEPeff = funcEff[pTBinForEff - 1]->Eval(fphi * tracks.size()); + if (wEPeff > 0.) { + wEPeff = 1. / wEPeff; + weff *= wEPeff; + } + } + } + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), waccRef * weff, 1); } From d72d676a07f17a08c85cacfeb3f0ba1d19760511 Mon Sep 17 00:00:00 2001 From: Preet Pati Date: Mon, 14 Apr 2025 20:41:28 +0200 Subject: [PATCH 2/5] Recommiting after precommit fixes --- PWGCF/Flow/Tasks/resonancesGfwFlow.cxx | 662 ++++++++++++++----------- 1 file changed, 364 insertions(+), 298 deletions(-) diff --git a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx index 87d1b3ff27f..b86fc40fca6 100644 --- a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx +++ b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx @@ -64,23 +64,28 @@ using namespace std; namespace { -std::shared_ptr phiC22Boot[10]; -std::shared_ptr phiC24Boot[10]; -std::shared_ptr k0C22Boot[10]; -std::shared_ptr k0C24Boot[10]; -std::shared_ptr lambdaC22Boot[10]; -std::shared_ptr lambdaC24Boot[10]; -std::shared_ptr anLambdaC22Boot[10]; -std::shared_ptr anLambdaC24Boot[10]; - -std::shared_ptr phiD22PtBoot[10]; -std::shared_ptr phiD24PtBoot[10]; -std::shared_ptr k0D22PtBoot[10]; -std::shared_ptr k0D24PtBoot[10]; -std::shared_ptr lambdaD22PtBoot[10]; -std::shared_ptr lambdaD24PtBoot[10]; -std::shared_ptr anLambdaD22PtBoot[10]; -std::shared_ptr anLambdaD24PtBoot[10]; +std::shared_ptr RefC22Boot[10]; +std::shared_ptr RefC24Boot[10]; + +std::shared_ptr phiD22FPtBoot[10]; +std::shared_ptr phiD22BPtBoot[10]; +std::shared_ptr phiD24FPtBoot[10]; +std::shared_ptr phiD24BPtBoot[10]; + +std::shared_ptr k0D22FPtBoot[10]; +std::shared_ptr k0D22BPtBoot[10]; +std::shared_ptr k0D24FPtBoot[10]; +std::shared_ptr k0D24BPtBoot[10]; + +std::shared_ptr lambdaD22FPtBoot[10]; +std::shared_ptr lambdaD22BPtBoot[10]; +std::shared_ptr lambdaD24FPtBoot[10]; +std::shared_ptr lambdaD24BPtBoot[10]; + +std::shared_ptr anLambdaD22FPtBoot[10]; +std::shared_ptr anLambdaD22BPtBoot[10]; +std::shared_ptr anLambdaD24FPtBoot[10]; +std::shared_ptr anLambdaD24BPtBoot[10]; } // namespace #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; @@ -98,21 +103,15 @@ struct ResonancesGfwFlow { O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5, "Chi2 per TPC clusters") O2_DEFINE_CONFIGURABLE(cfgTpcCluster, int, 70, "Number of TPC clusters") - O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Use Nch for flow observables") - O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgTpcNsigmaCut, float, 3.0f, "TPC N-sigma cut for pions, kaons, protons") O2_DEFINE_CONFIGURABLE(cfgTofNsigmaCut, float, 3.0f, "TOF N-sigma cut for pions, kaons, protons") O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 0.5f, "Minimum pt to use TOF N-sigma") O2_DEFINE_CONFIGURABLE(cfgITScluster, int, 0, "Number of ITS cluster") - O2_DEFINE_CONFIGURABLE(cfgCutTOFBeta, float, 0.0, "cut TOF beta") O2_DEFINE_CONFIGURABLE(cfgCutOccupancy, int, 3000, "Occupancy cut") O2_DEFINE_CONFIGURABLE(cfgUseGlobalTrack, bool, true, "use Global track") O2_DEFINE_CONFIGURABLE(cfgFakeKaonCut, float, 0.1f, "Maximum difference in measured momentum and TPC inner ring momentum of particle") O2_DEFINE_CONFIGURABLE(cfgRapidityCut, float, 0.5, "Rapidity cut for the reconstructed particles") O2_DEFINE_CONFIGURABLE(cfgUseCosPA, bool, false, "Use Pointing angle for resonances") - O2_DEFINE_CONFIGURABLE(cfgPhiCosPA, float, 0.04f, "Minimum Pointing angle for Phi") - O2_DEFINE_CONFIGURABLE(cfgK0CosPA, float, 0.97f, "Minimum Pointing angle for K0") - O2_DEFINE_CONFIGURABLE(cfgLambdaCosPA, float, 0.995f, "Minimum Pointing angle for Lambda") O2_DEFINE_CONFIGURABLE(cfgUseV0Radius, bool, true, "Use V0 radius for particle identification") O2_DEFINE_CONFIGURABLE(cfgLambdaRadiusMin, float, 0.5f, "Minimum Lambda radius in cm") O2_DEFINE_CONFIGURABLE(cfgLambdaRadiusMax, float, 200.0f, "Maximum Lambda radius in cm") @@ -125,34 +124,46 @@ struct ResonancesGfwFlow { O2_DEFINE_CONFIGURABLE(cfgCutDCAz, float, 2.0f, "DCAz range for tracks") O2_DEFINE_CONFIGURABLE(cfgDCALambdaPosToPVMin, float, 0.1f, "minimum DCA to PV for Lambda positive track") O2_DEFINE_CONFIGURABLE(cfgDCALambdaNegToPVMin, float, 0.25f, "minimum DCA to PV for Lambda negative track") - O2_DEFINE_CONFIGURABLE(cfgDCALambdaBetDaug, int, 1, "Maximum DCA between Lambda daughter tracks") O2_DEFINE_CONFIGURABLE(cfgDCAK0PosToPVMin, float, 0.06f, "minimum DCA to PV for K0 positive track") O2_DEFINE_CONFIGURABLE(cfgDCAK0NegToPVMin, float, 0.06f, "minimum DCA to PV for K0 negative track") - O2_DEFINE_CONFIGURABLE(cfgDCAK0BetDaug, int, 1, "Maximum DCA between K0 daughter tracks") - O2_DEFINE_CONFIGURABLE(cfgMassLambdaMin, float, 1.1f, "minimum lambda mass") - O2_DEFINE_CONFIGURABLE(cfgMassLambdaMax, float, 1.16f, "maximum lambda mass") - O2_DEFINE_CONFIGURABLE(cfgMassK0Min, float, 0.44f, "minimum K0short mass") - O2_DEFINE_CONFIGURABLE(cfgMassK0Max, float, 0.56f, "maximum K0short mass") O2_DEFINE_CONFIGURABLE(cfgUseMCCLambda, bool, false, "Use mass cross check for lambda") O2_DEFINE_CONFIGURABLE(cfgUseMCCK0, bool, false, "Use mass cross check for K0") - - O2_DEFINE_CONFIGURABLE(cfgNPhiMassBins, double, 70, "Invasriant mass bins for phi") - O2_DEFINE_CONFIGURABLE(cfgNK0MassBins, double, 70, "Invasriant mass bins for K0") - O2_DEFINE_CONFIGURABLE(cfgNLambdaMassBins, double, 70, "Invasriant mass bins for lambda") - O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, true, "Fill and output NUA weights") O2_DEFINE_CONFIGURABLE(cfgAcceptance, std::string, "", "CCDB path to acceptance object") - O2_DEFINE_CONFIGURABLE(cfgUseWeightPhiEtaVtxz, bool, true, "Use Phi, Eta, VertexZ dependent NUA weights") O2_DEFINE_CONFIGURABLE(cfgUseWeightPhiPtCent, bool, false, "Use Phi, Pt, Centrality dependent NUA weights") O2_DEFINE_CONFIGURABLE(cfgUseWeightPhiEtaPt, bool, false, "Use Phi, Eta, Pt dependent NUA weights") + O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgUseBootStrap, bool, true, "Use bootstrap for error estimation") - O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, false, "Use track density efficiency correction") + O2_DEFINE_CONFIGURABLE(cfgUseK0, bool, true, "Analyze K0") + O2_DEFINE_CONFIGURABLE(cfgUseLambda, bool, true, "Analyze Lambda") + O2_DEFINE_CONFIGURABLE(cfgUsePhi, bool, true, "Analyze Phi") + + struct : ConfigurableGroup { + Configurable> cfgCosPAs{"cfgcosPAs", std::vector{0.97f, 0.995f, 0.04f}, "Minimum Pointing angle for resonances [K0, Lambda, Phi]"}; + Configurable> cfgDCABetDaug{"cfgDCABetDaug", std::vector{1, 1, 1}, "Maximum DCA between resonance daughters [K0, Lambda, Phi]"}; + Configurable> cfgMassMin{"cfgMassMin", std::vector{0.44f, 1.1f, 0.99f}, "Minimum mass for resonances [K0, Lambda, Phi]"}; + Configurable> cfgMassMax{"cfgMassMax", std::vector{0.56f, 1.16f, 1.06f}, "Maximum mass for resonances [K0, Lambda, Phi]"}; + Configurable> cfgNMassBins{"cfgNMassBins", std::vector{70, 70, 70}, "Invariant mass bins for resonances [K0, Lambda, Phi]"}; + Configurable> cfgMccCut{"cfgMccCut", std::vector{0.005f, 0.01f}, "MCC cut for resonances [K0, Lambda]"}; + Configurable> cfgPosTrackPt{"cfgPosTrackPt", std::vector{0.15f, 0.15f, 0.15f}, "Pt cut for positive track of resonances [K0, Lambda, Phi]"}; + Configurable> cfgNegTrackPt{"cfgNegTrackPt", std::vector{0.15f, 0.15f, 0.15f}, "Pt cut for negative track of resonances [K0, Lambda, Phi]"}; + } resoCuts; Configurable> cfgTrackDensityP0{"cfgTrackDensityP0", std::vector{0.7217476707, 0.7384792571, 0.7542625668, 0.7640680200, 0.7701951667, 0.7755299053, 0.7805901710, 0.7849446786, 0.7957356586, 0.8113039262, 0.8211968966, 0.8280558878, 0.8329342135}, "parameter 0 for track density efficiency correction"}; Configurable> cfgTrackDensityP1{"cfgTrackDensityP1", std::vector{-2.169488e-05, -2.191913e-05, -2.295484e-05, -2.556538e-05, -2.754463e-05, -2.816832e-05, -2.846502e-05, -2.843857e-05, -2.705974e-05, -2.477018e-05, -2.321730e-05, -2.203315e-05, -2.109474e-05}, "parameter 1 for track density efficiency correction"}; + // Reading in the configurables + std::vector vMassMin = resoCuts.cfgMassMin; + std::vector vMassMax = resoCuts.cfgMassMax; + std::vector vMassBins = resoCuts.cfgNMassBins; + std::vector vCosPAs = resoCuts.cfgCosPAs; + std::vector vDCABetDaug = resoCuts.cfgDCABetDaug; + std::vector vMccCut = resoCuts.cfgMccCut; + std::vector vPosTrackPt = resoCuts.cfgPosTrackPt; + std::vector vNegTrackPt = resoCuts.cfgNegTrackPt; + // Defining configurable axis ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; @@ -162,9 +173,9 @@ struct ResonancesGfwFlow { ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {80, -5, 5}, "nsigmaTPC axis"}; ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"}; ConfigurableAxis axisParticles{"axisParticles", {3, 0, 3}, "axis for different hadrons"}; - ConfigurableAxis axisPhiMass{"axisPhiMass", {cfgNPhiMassBins, 0.99, 1.06}, "axis for invariant mass distibution for Phi"}; - ConfigurableAxis axisK0Mass{"axisK0Mass", {cfgNK0MassBins, cfgMassK0Min, cfgMassK0Max}, "axis for invariant mass distibution for K0"}; - ConfigurableAxis axisLambdaMass{"axisLambdaMass", {cfgNLambdaMassBins, cfgMassLambdaMin, cfgMassLambdaMax}, "axis for invariant mass distibution for Lambda"}; + ConfigurableAxis axisPhiMass{"axisPhiMass", {vMassBins[Phi - 2], vMassMin[Phi - 2], vMassMax[Phi - 2]}, "axis for invariant mass distibution for Phi"}; + ConfigurableAxis axisK0Mass{"axisK0Mass", {vMassBins[K0 - 1], vMassMin[K0 - 1], vMassMax[K0 - 1]}, "axis for invariant mass distibution for K0"}; + ConfigurableAxis axisLambdaMass{"axisLambdaMass", {vMassBins[Lambda - 1], vMassMin[Lambda - 1], vMassMax[Lambda - 1]}, "axis for invariant mass distibution for Lambda"}; ConfigurableAxis axisTPCsignal{"axisTPCsignal", {10000, 0, 1000}, "axis for TPC signal"}; ConfigurableAxis axisTOFsignal{"axisTOFsignal", {10000, 0, 1000}, "axis for TOF signal"}; @@ -190,11 +201,11 @@ struct ResonancesGfwFlow { TRandom3* fRndm = new TRandom3(0); enum OutputSpecies { - hRef = 0, - hK0 = 1, - hLambda = 2, - hAnLambda = 3, - hPhi = 4, + Ref = 0, + K0 = 1, + Lambda = 2, + AnLambda = 3, + Phi = 4, kCount_OutputSpecies }; @@ -210,6 +221,7 @@ struct ResonancesGfwFlow { void init(InitContext const&) { + // Initilizing ccdb ccdb->setURL(ccdbUrl.value); ccdb->setCaching(true); ccdb->setCreatedNotAfter(noLaterThan.value); @@ -220,58 +232,93 @@ struct ResonancesGfwFlow { histos.add("hMult", "", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); histos.add("hCent", "", {HistType::kTH1D, {{90, 0, 90}}}); - histos.add("KaplusTPC", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("KaminusTPC", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("KaplusTOF", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("KaminusTOF", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("hPhiPhi", "", {HistType::kTH1D, {axisPhi}}); - histos.add("hPhiEta", "", {HistType::kTH1D, {axisEta}}); - histos.add("hPhiMass_sparse", "", {HistType::kTHnSparseD, {{axisPhiMass, axisPt, axisMultiplicity}}}); - - histos.add("PlusTPC_L", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("MinusTPC_L", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("PlusTOF_L", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("MinusTOF_L", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("hLambdaPhi", "", {HistType::kTH1D, {axisPhi}}); - histos.add("hLambdaEta", "", {HistType::kTH1D, {axisEta}}); - histos.add("hLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, axisPt, axisMultiplicity}}}); - histos.add("PlusTPC_AL", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("MinusTPC_AL", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("PlusTOF_AL", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("MinusTOF_AL", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("hAntiLambdaPhi", "", {HistType::kTH1D, {axisPhi}}); - histos.add("hAntiLambdaEta", "", {HistType::kTH1D, {axisEta}}); - histos.add("hAntiLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, axisPt, axisMultiplicity}}}); - histos.add("hLambdas", "", {HistType::kTH1D, {singleCount}}); - - histos.add("PlusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("MinusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("PlusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("MinusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("hK0Phi", "", {HistType::kTH1D, {axisPhi}}); - histos.add("hK0Eta", "", {HistType::kTH1D, {axisEta}}); - histos.add("hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, axisPt, axisMultiplicity}}}); - histos.add("hK0s", "", {HistType::kTH1D, {singleCount}}); - - histos.add("Phic22", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("Phic24", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("Phiv22pt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); - histos.add("Phiv24pt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); - - histos.add("K0c22", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("K0c24", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("K0v22pt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - histos.add("K0v24pt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - - histos.add("Lambdac22", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("Lambdac24", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("Lambdav22pt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); - histos.add("Lambdav24pt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); - - histos.add("AnLambdac22", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("AnLambdac24", "", {HistType::kTProfile, {axisMultiplicity}}); - histos.add("AnLambdav22pt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); - histos.add("AnLambdav24pt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + histos.add("Refc22", "", {HistType::kTProfile, {axisMultiplicity}}); + histos.add("Refc24", "", {HistType::kTProfile, {axisMultiplicity}}); + + if (cfgUsePhi) { + histos.add("KaplusTPC", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("KaminusTPC", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("KaplusTOF", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("KaminusTOF", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("hPhiPhi", "", {HistType::kTH1D, {axisPhi}}); + histos.add("hPhiEta", "", {HistType::kTH1D, {axisEta}}); + histos.add("hPhiMass_sparse", "", {HistType::kTHnSparseD, {{axisPhiMass, axisPt, axisMultiplicity}}}); + + histos.add("Phid22Fpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + histos.add("Phid24Fpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + histos.add("Phid22Bpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + histos.add("Phid24Bpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + } + + if (cfgUseLambda) { + histos.add("PlusTPC_L", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("MinusTPC_L", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("PlusTOF_L", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("MinusTOF_L", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("hLambdaPhi", "", {HistType::kTH1D, {axisPhi}}); + histos.add("hLambdaEta", "", {HistType::kTH1D, {axisEta}}); + histos.add("hLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, axisPt, axisMultiplicity}}}); + histos.add("PlusTPC_AL", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("MinusTPC_AL", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("PlusTOF_AL", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("MinusTOF_AL", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("hAntiLambdaPhi", "", {HistType::kTH1D, {axisPhi}}); + histos.add("hAntiLambdaEta", "", {HistType::kTH1D, {axisEta}}); + histos.add("hAntiLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, axisPt, axisMultiplicity}}}); + histos.add("hLambdas", "", {HistType::kTH1D, {singleCount}}); + + histos.add("Lambdad22Fpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + histos.add("Lambdad24Fpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + histos.add("Lambdad22Bpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + histos.add("Lambdad24Bpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + + histos.add("AnLambdad22Fpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + histos.add("AnLambdad24Fpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + histos.add("AnLambdad22Bpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + histos.add("AnLambdad24Bpt", "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + + histos.add("hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{11, 0, 11}}}); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(1, "Lambda candidates"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(2, "Daughter pt"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(3, "Mass cut"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(4, "Rapidity cut"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(5, "DCA to PV"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(6, "DCA between daughters"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(7, "V0radius"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(8, "CosPA"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(9, "Proper lifetime"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(10, "Daughter track selection"); + histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(11, "Mass cross check"); + } + + if (cfgUseK0) { + histos.add("PlusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("MinusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("PlusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("MinusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("hK0Phi", "", {HistType::kTH1D, {axisPhi}}); + histos.add("hK0Eta", "", {HistType::kTH1D, {axisEta}}); + histos.add("hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, axisPt, axisMultiplicity}}}); + histos.add("hK0s", "", {HistType::kTH1D, {singleCount}}); + + histos.add("K0d22Fpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + histos.add("K0d24Fpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + histos.add("K0d22Bpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + histos.add("K0d24Bpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + + histos.add("hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{11, 0, 11}}}); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(1, "K0 candidates"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(2, "Daughter pt"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(3, "Mass cut"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(4, "Rapidity cut"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(5, "DCA to PV"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(6, "DCA between daughters"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(7, "V0radius"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(8, "CosPA"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(9, "Proper lifetime"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(10, "Daughter track selection"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(11, "Mass cross check"); + } histos.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{8, 0, 8}}}); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); @@ -283,32 +330,6 @@ struct ResonancesGfwFlow { histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(8, "After Occupancy"); - histos.add("hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{11, 0, 11}}}); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(1, "Lambda candidates"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(2, "Daughter pt"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(3, "Mass cut"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(4, "Rapidity cut"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(5, "DCA to PV"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(6, "DCA between daughters"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(7, "V0radius"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(8, "CosPA"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(9, "Proper lifetime"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(10, "Daughter track selection"); - histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(11, "Mass cross check"); - - histos.add("hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{11, 0, 11}}}); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(1, "K0 candidates"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(2, "Daughter pt"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(3, "Mass cut"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(4, "Rapidity cut"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(5, "DCA to PV"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(6, "DCA between daughters"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(7, "V0radius"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(8, "CosPA"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(9, "Proper lifetime"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(10, "Daughter track selection"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(11, "Mass cross check"); - if (cfgOutputNUAWeights) { histos.add("NUA/hPhiEtaVtxz_ref", ";#varphi;#eta;v_{z}", {HistType::kTH3D, {axisPhi, {64, -1.6, 1.6}, {40, -10, 10}}}); histos.add("NUA/hPhiEtaVtxz_k0", ";#varphi;#eta;v_{z}", {HistType::kTH3D, {axisPhi, {64, -1.6, 1.6}, {40, -10, 10}}}); @@ -330,39 +351,47 @@ struct ResonancesGfwFlow { } if (cfgUseBootStrap) { - for (int i = 0; i < 10; i++) { - phiC22Boot[i] = histos.add(Form("BootStrap/Phic22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - phiC24Boot[i] = histos.add(Form("BootStrap/Phic24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - k0C22Boot[i] = histos.add(Form("BootStrap/k0c22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - k0C24Boot[i] = histos.add(Form("BootStrap/k0c24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - lambdaC22Boot[i] = histos.add(Form("BootStrap/lambdac22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - lambdaC24Boot[i] = histos.add(Form("BootStrap/lambdac24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - anLambdaC22Boot[i] = histos.add(Form("BootStrap/anlambdac22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - anLambdaC24Boot[i] = histos.add(Form("BootStrap/anlambdac24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - - phiD22PtBoot[i] = histos.add(Form("BootStrap/Phid22pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); - phiD24PtBoot[i] = histos.add(Form("BootStrap/Phid24pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); - k0D22PtBoot[i] = histos.add(Form("BootStrap/k0d22pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - k0D24PtBoot[i] = histos.add(Form("BootStrap/k0d24pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - lambdaD22PtBoot[i] = histos.add(Form("BootStrap/lambdad22pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); - lambdaD24PtBoot[i] = histos.add(Form("BootStrap/lambdad24pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); - anLambdaD22PtBoot[i] = histos.add(Form("BootStrap/anlambdad22pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); - anLambdaD24PtBoot[i] = histos.add(Form("BootStrap/anlambdad24pt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); - } - } + for (int i = 0; i < cfgNbootstrap; i++) { + RefC22Boot[i] = histos.add(Form("BootStrap/Refc22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); + RefC24Boot[i] = histos.add(Form("BootStrap/Refc24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); + if (cfgUsePhi) { + phiD22FPtBoot[i] = histos.add(Form("BootStrap/Phid22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + phiD24FPtBoot[i] = histos.add(Form("BootStrap/Phid24Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + phiD22BPtBoot[i] = histos.add(Form("BootStrap/Phid22Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + phiD24BPtBoot[i] = histos.add(Form("BootStrap/Phid24Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + } + if (cfgUseK0) { + k0D22FPtBoot[i] = histos.add(Form("BootStrap/k0d22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + k0D24FPtBoot[i] = histos.add(Form("BootStrap/k0d24Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + k0D22BPtBoot[i] = histos.add(Form("BootStrap/k0d22Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + k0D24BPtBoot[i] = histos.add(Form("BootStrap/k0d24Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + } + if (cfgUseLambda) { + lambdaD22FPtBoot[i] = histos.add(Form("BootStrap/lambdad22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + lambdaD24FPtBoot[i] = histos.add(Form("BootStrap/lambdad24Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + lambdaD22BPtBoot[i] = histos.add(Form("BootStrap/lambdad22Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + lambdaD24BPtBoot[i] = histos.add(Form("BootStrap/lambdad24Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + + anLambdaD22FPtBoot[i] = histos.add(Form("BootStrap/anlambdad22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + anLambdaD24FPtBoot[i] = histos.add(Form("BootStrap/anlambdad24Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + anLambdaD22BPtBoot[i] = histos.add(Form("BootStrap/anlambdad22Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + anLambdaD24BPtBoot[i] = histos.add(Form("BootStrap/anlambdad24Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisLambdaMass, axisMultiplicity}}); + } + } // end of bootstrap loop + } // end of bootstrap condition o2::framework::AxisSpec axis = axisPt; int nPtBins = axis.binEdges.size() - 1; double* ptBins = &(axis.binEdges)[0]; fPtAxis = new TAxis(nPtBins, ptBins); - fPhiMassAxis = new TAxis(cfgNPhiMassBins, 0.99, 1.06); - fK0MassAxis = new TAxis(cfgNK0MassBins, cfgMassK0Min, cfgMassK0Max); - fLambdaMassAxis = new TAxis(cfgNLambdaMassBins, cfgMassLambdaMin, cfgMassLambdaMax); + fPhiMassAxis = new TAxis(vMassBins[Phi - 2], 0.99, 1.06); + fK0MassAxis = new TAxis(vMassBins[K0 - 1], vMassMin[K0 - 1], vMassMax[K0 - 1]); + fLambdaMassAxis = new TAxis(vMassBins[Lambda - 1], vMassMin[Lambda - 1], vMassMax[Lambda - 1]); - int nPhisPtMassBins = nPtBins * cfgNPhiMassBins; - int nK0sPtMassBins = nPtBins * cfgNK0MassBins; - int nLambdasPtMassBins = nPtBins * cfgNLambdaMassBins; + int nPhisPtMassBins = nPtBins * vMassBins[Phi - 2]; + int nK0sPtMassBins = nPtBins * vMassBins[K0 - 1]; + int nLambdasPtMassBins = nPtBins * vMassBins[Lambda - 1]; //********** Defining the regions ********** // reference particles @@ -400,37 +429,33 @@ struct ResonancesGfwFlow { //--------- reference particles // Forward and Backward correlations are the same for reference particles - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "PhiF08Gap22", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "KsF08Gap22", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "LamF08Gap22", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "AnLamF08Gap22", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2 2} refP08 {-2 -2}", "PhiF08Gap24", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2 2} refP08 {-2 -2}", "KsF08Gap24", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2 2} refP08 {-2 -2}", "LamF08Gap24", kFALSE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2 2} refP08 {-2 -2}", "AnLamF08Gap24", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "Ref08Gap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2 2} refP08 {-2 -2}", "Ref08Gap24", kFALSE)); //--------- pt differential pois - // Forward - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2} refP08 {-2}", "PhiF08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2} refP08 {-2}", "KsF08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2} refP08 {-2}", "LamF08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2} refP08 {-2}", "AnLamF08Gap22", kTRUE)); - - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2 2} refP08 {-2 -2}", "PhiF08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2 2} refP08 {-2 -2}", "KsF08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2 2} refP08 {-2 -2}", "LamF08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2 2} refP08 {-2 -2}", "AnLamF08Gap24", kTRUE)); - - // Backward - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2} refN08 {-2}", "PhiB08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2} refN08 {-2}", "KsB08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2} refN08 {-2}", "LamB08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2} refN08 {-2}", "AnLamB08Gap22", kTRUE)); - - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2 2} refN08 {-2 -2}", "PhiB08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2 2} refN08 {-2 -2}", "KsB08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2 2} refN08 {-2 -2}", "LamB08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2 2} refN08 {-2 -2}", "AnLamB08Gap24", kTRUE)); + if (cfgUsePhi) { + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2} refP08 {-2}", "PhiF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2 2} refP08 {-2 -2}", "PhiF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2} refN08 {-2}", "PhiB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2 2} refN08 {-2 -2}", "PhiB08Gap24", kTRUE)); + } + if (cfgUseK0) { + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2} refP08 {-2}", "KsF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2 2} refP08 {-2 -2}", "KsF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2} refN08 {-2}", "KsB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2 2} refN08 {-2 -2}", "KsB08Gap24", kTRUE)); + } + if (cfgUseLambda) { + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2} refP08 {-2}", "LamF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2 2} refP08 {-2 -2}", "LamF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2} refN08 {-2}", "LamB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2 2} refN08 {-2 -2}", "LamB08Gap24", kTRUE)); + + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2} refP08 {-2}", "AnLamF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2 2} refP08 {-2 -2}", "AnLamF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2} refN08 {-2}", "AnLamB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2 2} refN08 {-2 -2}", "AnLamB08Gap24", kTRUE)); + } fGFW->CreateRegions(); @@ -522,7 +547,7 @@ struct ResonancesGfwFlow { p1 = track1.p(); p2 = track2.p(); angle = std::acos((pt1 * pt2 + pz1 * pz2) / (p1 * p2)); - if (cfgUseCosPA && angle < cfgPhiCosPA) { + if (cfgUseCosPA && angle < vCosPAs[Phi - 2]) { return false; } return true; @@ -565,8 +590,9 @@ struct ResonancesGfwFlow { if (track.pt() >= cfgTofPtCut && !track.hasTOF()) return -1; + const int numSpecies = 3; // Select particle with the lowest nsigma - for (int i = 0; i < 3; ++i) { + for (int i = 0; i < numSpecies; ++i) { if (std::abs(nSigmaToUse[i]) < nsigma) { pid = i; nsigma = std::abs(nSigmaToUse[i]); @@ -585,35 +611,35 @@ struct ResonancesGfwFlow { mAcceptance.clear(); mAcceptance.resize(kCount_OutputSpecies); - mAcceptance[hRef] = ccdb->getForTimeStamp(cfgAcceptance.value + "_ref", timestamp); - if (mAcceptance[hRef]) - LOGF(info, "Loaded acceptance weights from %s_ref (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hRef]); + mAcceptance[Ref] = ccdb->getForTimeStamp(cfgAcceptance.value + "_ref", timestamp); + if (mAcceptance[Ref]) + LOGF(info, "Loaded acceptance weights from %s_ref (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[Ref]); else - LOGF(fatal, "Could not load acceptance weights from %s_ref (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hRef]); + LOGF(fatal, "Could not load acceptance weights from %s_ref (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[Ref]); - mAcceptance[hK0] = ccdb->getForTimeStamp(cfgAcceptance.value + "_k0", timestamp); - if (mAcceptance[hK0]) - LOGF(info, "Loaded acceptance weights from %s_k0 (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hK0]); + mAcceptance[K0] = ccdb->getForTimeStamp(cfgAcceptance.value + "_k0", timestamp); + if (mAcceptance[K0]) + LOGF(info, "Loaded acceptance weights from %s_k0 (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[K0]); else - LOGF(fatal, "Could not load acceptance weights from %s_k0 (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hK0]); + LOGF(fatal, "Could not load acceptance weights from %s_k0 (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[K0]); - mAcceptance[hLambda] = ccdb->getForTimeStamp(cfgAcceptance.value + "_lambda", timestamp); - if (mAcceptance[hLambda]) - LOGF(info, "Loaded acceptance weights from %s_lambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hLambda]); + mAcceptance[Lambda] = ccdb->getForTimeStamp(cfgAcceptance.value + "_lambda", timestamp); + if (mAcceptance[Lambda]) + LOGF(info, "Loaded acceptance weights from %s_lambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[Lambda]); else - LOGF(fatal, "Could not load acceptance weights from %s_lambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hLambda]); + LOGF(fatal, "Could not load acceptance weights from %s_lambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[Lambda]); - mAcceptance[hAnLambda] = ccdb->getForTimeStamp(cfgAcceptance.value + "_hanlambda", timestamp); - if (mAcceptance[hAnLambda]) - LOGF(info, "Loaded acceptance weights from %s_anlambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hAnLambda]); + mAcceptance[AnLambda] = ccdb->getForTimeStamp(cfgAcceptance.value + "_AnLambda", timestamp); + if (mAcceptance[AnLambda]) + LOGF(info, "Loaded acceptance weights from %s_anlambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[AnLambda]); else - LOGF(fatal, "Could not load acceptance weights from %s_anlambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hAnLambda]); + LOGF(fatal, "Could not load acceptance weights from %s_anlambda (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[AnLambda]); - mAcceptance[hPhi] = ccdb->getForTimeStamp(cfgAcceptance.value + "_phi", timestamp); - if (mAcceptance[hPhi]) - LOGF(info, "Loaded acceptance weights from %s_phi (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hPhi]); + mAcceptance[Phi] = ccdb->getForTimeStamp(cfgAcceptance.value + "_phi", timestamp); + if (mAcceptance[Phi]) + LOGF(info, "Loaded acceptance weights from %s_phi (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[Phi]); else - LOGF(fatal, "Could not load acceptance weights from %s_phi (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[hPhi]); + LOGF(fatal, "Could not load acceptance weights from %s_phi (%p)", cfgAcceptance.value.c_str(), (void*)mAcceptance[Phi]); } correctionsLoaded = true; @@ -648,6 +674,35 @@ struct ResonancesGfwFlow { return wacc; } + template + double getAcceptancePhi(vector mom, const TCollision collision, int pid_index_reso) + { // 0 = ref, 1 = k0, 2 = lambda, 3 = anti-lambda, 4 = phi + if (pid_index_reso < 0 || pid_index_reso >= kCount_OutputSpecies) { + return 1; + } + + double wacc = 1; + double cent = collision.centFT0C(); + double vtxz = collision.posZ(); + + if ((cfgUseWeightPhiEtaVtxz && cfgUseWeightPhiPtCent) || (cfgUseWeightPhiEtaPt && cfgUseWeightPhiPtCent) || (cfgUseWeightPhiEtaVtxz && cfgUseWeightPhiEtaPt)) { + LOGF(fatal, "Only one of the three weight options can be used at a time"); + } + if (!mAcceptance.empty() && correctionsLoaded) { + if (!mAcceptance[pid_index_reso]) { + LOGF(fatal, "Acceptance weights not loaded for pidIndex %d", pid_index_reso); + return 1; + } + if (cfgUseWeightPhiEtaVtxz) + wacc = mAcceptance[pid_index_reso]->getNUA(mom.Phi(), mom.Eta(), vtxz); + if (cfgUseWeightPhiPtCent) + wacc = mAcceptance[pid_index_reso]->getNUA(mom.Phi(), mom.Pt(), cent); + if (cfgUseWeightPhiEtaPt) + wacc = mAcceptance[pid_index_reso]->getNUA(mom.Phi(), mom.Eta(), mom.Pt()); + } + return wacc; + } + template void fillWeights(const TTrack track, const TCollision collision, const int& pid_index_reso) { @@ -657,44 +712,42 @@ struct ResonancesGfwFlow { bool withinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range bool withinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); // within RF pT range - if (withinPtRef && !pid_index_reso) + if (withinPtRef && !pid_index_reso) { histos.fill(HIST("NUA/hPhiEtaVtxz_ref"), track.phi(), track.eta(), vtxz); // pt-subset of charged particles for ref flow - histos.fill(HIST("NUA/hPhiPtCent_ref"), track.phi(), track.pt(), cent); - histos.fill(HIST("NUA/hPhiEtaPt_ref"), track.phi(), track.eta(), track.pt()); + histos.fill(HIST("NUA/hPhiPtCent_ref"), track.phi(), track.pt(), cent); + histos.fill(HIST("NUA/hPhiEtaPt_ref"), track.phi(), track.eta(), track.pt()); + } if (withinPtPOI) { switch (pid_index_reso) { - case hK0: + case K0: histos.fill(HIST("NUA/hPhiEtaVtxz_k0"), track.phi(), track.eta(), vtxz); // K0 weights histos.fill(HIST("NUA/hPhiPtCent_k0"), track.phi(), track.pt(), cent); histos.fill(HIST("NUA/hPhiEtaPt_k0"), track.phi(), track.eta(), track.pt()); break; - case hLambda: + case Lambda: histos.fill(HIST("NUA/hPhiEtaVtxz_lambda"), track.phi(), track.eta(), vtxz); // Lambda weights histos.fill(HIST("NUA/hPhiPtCent_lambda"), track.phi(), track.pt(), cent); histos.fill(HIST("NUA/hPhiEtaPt_lambda"), track.phi(), track.eta(), track.pt()); break; - case hAnLambda: + case AnLambda: histos.fill(HIST("NUA/hPhiEtaVtxz_anlambda"), track.phi(), track.eta(), vtxz); // Anti-Lambda weights histos.fill(HIST("NUA/hPhiPtCent_anlambda"), track.phi(), track.pt(), cent); histos.fill(HIST("NUA/hPhiEtaPt_anlambda"), track.phi(), track.eta(), track.pt()); break; - case hPhi: - histos.fill(HIST("NUA/hPhiEtaVtxz_phi"), track.phi(), track.eta(), vtxz); // Phi weights - histos.fill(HIST("NUA/hPhiPtCent_phi"), track.phi(), track.pt(), cent); - histos.fill(HIST("NUA/hPhiEtaPt_phi"), track.phi(), track.eta(), track.pt()); - break; + // Phi weights are filled in the resurrectPhi function } } } - template - void resurrectPhi(TTrack trackplus, TTrack trackminus, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr& hist, const double cent) + template + void resurrectPhi(TTrack trackplus, TTrack trackminus, const TCollision collision, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr& hist) { + const int nKaon = 2; for (auto const& [partplus, partminus] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(trackplus, trackminus))) { - if (getNsigmaPID(partplus) != 2) + if (getNsigmaPID(partplus) != nKaon) continue; - if (getNsigmaPID(partminus) != 2) + if (getNsigmaPID(partminus) != nKaon) continue; if (isFakeKaon(partplus) || isFakeKaon(partminus)) continue; @@ -718,14 +771,24 @@ struct ResonancesGfwFlow { bool withinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); if (std::abs(mom.Rapidity()) < cfgRapidityCut) { - histos.fill(hist, invMass, pt, cent); + histos.fill(hist, invMass, pt, collision.centFT0C()); histos.fill(HIST("hPhiPhi"), mom.Phi()); histos.fill(HIST("hPhiEta"), mom.Eta()); + // Fill Phi weights + if (cfgOutputNUAWeights && withinPtPOI) { + histos.fill(HIST("NUA/hPhiEtaVtxz_phi"), mom.Phi(), mom.Eta(), collision.posZ()); + histos.fill(HIST("NUA/hPhiPtCent_phi"), mom.Phi(), pt, collision.centFT0C()); + histos.fill(HIST("NUA/hPhiEtaPt_phi"), mom.Phi(), mom.Eta(), pt); + } + + double weff = 1; + double waccPOI = getAcceptancePhi(mom, collision, Phi); + if (withinPtPOI) - fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), mom.Phi(), 1.0, 2); + fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), mom.Phi(), weff * waccPOI, 2); if (withinPtPOI && withinPtRef) - fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), mom.Phi(), 1.0, 32); + fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), mom.Phi(), weff * waccPOI, 32); } } return; @@ -760,13 +823,13 @@ struct ResonancesGfwFlow { auto negtrack = candidate.template negTrack_as(); histos.fill(HIST("hLambdaCount"), 0.5); - if (postrack.pt() < 0.15 || negtrack.pt() < 0.15) + if (postrack.pt() < vPosTrackPt[Lambda - 1] || negtrack.pt() < vNegTrackPt[Lambda - 1]) return false; histos.fill(HIST("hLambdaCount"), 1.5); - if (mlambda > cfgMassLambdaMin && mlambda < cfgMassLambdaMax) + if (mlambda > vMassMin[Lambda - 1] && mlambda < vMassMax[Lambda - 1]) isL = true; - if (mantilambda > cfgMassLambdaMin && mantilambda < cfgMassLambdaMax) + if (mantilambda > vMassMin[Lambda - 1] && mantilambda < vMassMax[Lambda - 1]) isAL = true; if (!isL && !isAL) { @@ -788,7 +851,7 @@ struct ResonancesGfwFlow { return false; } histos.fill(HIST("hLambdaCount"), 4.5); - if (std::abs(candidate.dcaV0daughters()) > cfgDCALambdaBetDaug) + if (std::abs(candidate.dcaV0daughters()) > vDCABetDaug[Lambda - 1]) return false; histos.fill(HIST("hLambdaCount"), 5.5); // v0 radius cuts @@ -796,7 +859,7 @@ struct ResonancesGfwFlow { return false; histos.fill(HIST("hLambdaCount"), 6.5); // cosine pointing angle cuts - if (candidate.v0cosPA() < cfgLambdaCosPA) + if (candidate.v0cosPA() < vCosPAs[Lambda - 1]) return false; histos.fill(HIST("hLambdaCount"), 7.5); // Proper lifetime @@ -813,7 +876,7 @@ struct ResonancesGfwFlow { } histos.fill(HIST("hLambdaCount"), 9.5); // Mass cross check - if (cfgUseMCCLambda && std::abs(massK0Short - 0.497614) < 0.01) + if (cfgUseMCCLambda && std::abs(massK0Short - 0.497614) < vMccCut[Lambda - 1]) return false; histos.fill(HIST("hLambdaCount"), 10.5); bool withinPtPOI = (cfgCutPtPOIMin < candidate.pt()) && (candidate.pt() < cfgCutPtPOIMax); // within POI pT range @@ -823,9 +886,9 @@ struct ResonancesGfwFlow { if (isL) { if (cfgOutputNUAWeights) - fillWeights(candidate, collision, hLambda); + fillWeights(candidate, collision, Lambda); - double waccPOI = getAcceptance(candidate, collision, hLambda); + double waccPOI = getAcceptance(candidate, collision, Lambda); if (withinPtPOI) fGFW->Fill(candidate.eta(), ((fPtAxis->FindBin(candidate.pt()) - 1) * fLambdaMassAxis->GetNbins()) + (fLambdaMassAxis->FindBin(mlambda) - 1), candidate.phi(), waccPOI * weff, 8); if (withinPtPOI && withinPtRef) @@ -841,9 +904,9 @@ struct ResonancesGfwFlow { } if (isAL) { if (cfgOutputNUAWeights) - fillWeights(candidate, collision, hAnLambda); + fillWeights(candidate, collision, AnLambda); - double waccPOI = getAcceptance(candidate, collision, hAnLambda); + double waccPOI = getAcceptance(candidate, collision, AnLambda); if (withinPtPOI) fGFW->Fill(candidate.eta(), ((fPtAxis->FindBin(candidate.pt()) - 1) * fLambdaMassAxis->GetNbins()) + (fLambdaMassAxis->FindBin(mantilambda) - 1), candidate.phi(), waccPOI * weff, 16); if (withinPtPOI && withinPtRef) @@ -870,10 +933,10 @@ struct ResonancesGfwFlow { auto negtrack = candidate.template negTrack_as(); histos.fill(HIST("hK0Count"), 0.5); - if (postrack.pt() < 0.15 || negtrack.pt() < 0.15) + if (postrack.pt() < vPosTrackPt[K0 - 1] || negtrack.pt() < vNegTrackPt[K0 - 1]) return false; histos.fill(HIST("hK0Count"), 1.5); - if (mk0 < cfgMassK0Min && mk0 > cfgMassK0Max) + if (mk0 < vMassMin[K0 - 1] && mk0 > vMassMax[K0 - 1]) return false; histos.fill(HIST("hK0Count"), 2.5); // Rapidity correction @@ -884,7 +947,7 @@ struct ResonancesGfwFlow { if (std::abs(candidate.dcapostopv()) < cfgDCAK0PosToPVMin || std::abs(candidate.dcanegtopv()) < cfgDCAK0NegToPVMin) return false; histos.fill(HIST("hK0Count"), 4.5); - if (std::abs(candidate.dcaV0daughters()) > cfgDCAK0BetDaug) + if (std::abs(candidate.dcaV0daughters()) > vDCABetDaug[K0 - 1]) return false; histos.fill(HIST("hK0Count"), 5.5); // v0 radius cuts @@ -892,7 +955,7 @@ struct ResonancesGfwFlow { return false; histos.fill(HIST("hK0Count"), 6.5); // cosine pointing angle cuts - if (candidate.v0cosPA() < cfgK0CosPA) + if (candidate.v0cosPA() < vCosPAs[K0 - 1]) return false; histos.fill(HIST("hK0Count"), 7.5); // Proper lifetime @@ -903,19 +966,19 @@ struct ResonancesGfwFlow { return false; histos.fill(HIST("hK0Count"), 9.5); // Mass cross check - if (cfgUseMCCK0 && std::abs(massLambda - 1.11568) < 0.005) + if (cfgUseMCCK0 && std::abs(massLambda - 1.11568) < vMccCut[K0 - 1]) return false; - if (cfgUseMCCK0 && std::abs(massLambda - 1.11568) < 0.005) + if (cfgUseMCCK0 && std::abs(massLambda - 1.11568) < vMccCut[K0 - 1]) return false; histos.fill(HIST("hK0Count"), 10.5); bool withinPtPOI = (cfgCutPtPOIMin < candidate.pt()) && (candidate.pt() < cfgCutPtPOIMax); // within POI pT range bool withinPtRef = (cfgCutPtMin < candidate.pt()) && (candidate.pt() < cfgCutPtMax); if (cfgOutputNUAWeights) - fillWeights(candidate, collision, hK0); + fillWeights(candidate, collision, K0); float weff = 1; - double waccPOI = getAcceptance(candidate, collision, hK0); + double waccPOI = getAcceptance(candidate, collision, K0); if (withinPtPOI) fGFW->Fill(candidate.eta(), ((fPtAxis->FindBin(candidate.pt()) - 1) * fK0MassAxis->GetNbins()) + (fK0MassAxis->FindBin(mk0) - 1), candidate.phi(), waccPOI * weff, 4); @@ -1026,7 +1089,7 @@ struct ResonancesGfwFlow { if (withinPtRef) if (cfgOutputNUAWeights) - fillWeights(track, collision, hRef); + fillWeights(track, collision, Ref); double waccRef = getAcceptance(track, collision, 0); @@ -1049,43 +1112,47 @@ struct ResonancesGfwFlow { auto posSlicedTracks = posTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); auto negSlicedTracks = negTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - resurrectPhi(posSlicedTracks, negSlicedTracks, kaonPlus, kaonMinus, phiMom, massKaPlus, HIST("hPhiMass_sparse"), cent); + if (cfgUsePhi) { + resurrectPhi(posSlicedTracks, negSlicedTracks, collision, kaonPlus, kaonMinus, phiMom, massKaPlus, HIST("hPhiMass_sparse")); + } for (auto const& v0s : V0s) { - if (selectionLambda(collision, v0s) == true) - histos.fill(HIST("hLambdas"), 1); - if (selectionK0(collision, v0s) == true) - histos.fill(HIST("hK0s"), 1); + if (cfgUseLambda) { + if (selectionLambda(collision, v0s) == true) + histos.fill(HIST("hLambdas"), 1); + } + if (cfgUseK0) { + if (selectionK0(collision, v0s) == true) + histos.fill(HIST("hK0s"), 1); + } } // End of v0 loop - fillResoProfile(corrconfigs.at(0), HIST("Phic22"), cent, fPhiMassAxis); - fillResoProfile(corrconfigs.at(1), HIST("K0c22"), cent, fK0MassAxis); - fillResoProfile(corrconfigs.at(2), HIST("Lambdac22"), cent, fLambdaMassAxis); - fillResoProfile(corrconfigs.at(3), HIST("AnLambdac22"), cent, fLambdaMassAxis); - fillResoProfile(corrconfigs.at(4), HIST("Phic24"), cent, fPhiMassAxis); - fillResoProfile(corrconfigs.at(5), HIST("K0c24"), cent, fK0MassAxis); - fillResoProfile(corrconfigs.at(6), HIST("Lambdac24"), cent, fLambdaMassAxis); - fillResoProfile(corrconfigs.at(7), HIST("AnLambdac24"), cent, fLambdaMassAxis); - - fillResoProfile(corrconfigs.at(8), HIST("Phiv22pt"), cent, fPhiMassAxis); - fillResoProfile(corrconfigs.at(9), HIST("K0v22pt"), cent, fK0MassAxis); - fillResoProfile(corrconfigs.at(10), HIST("Lambdav22pt"), cent, fLambdaMassAxis); - fillResoProfile(corrconfigs.at(11), HIST("AnLambdav22pt"), cent, fLambdaMassAxis); - - fillResoProfile(corrconfigs.at(12), HIST("Phiv24pt"), cent, fPhiMassAxis); - fillResoProfile(corrconfigs.at(13), HIST("K0v24pt"), cent, fK0MassAxis); - fillResoProfile(corrconfigs.at(14), HIST("Lambdav24pt"), cent, fLambdaMassAxis); - fillResoProfile(corrconfigs.at(15), HIST("AnLambdav24pt"), cent, fLambdaMassAxis); - - fillResoProfile(corrconfigs.at(16), HIST("Phiv22pt"), cent, fPhiMassAxis); - fillResoProfile(corrconfigs.at(17), HIST("K0v22pt"), cent, fK0MassAxis); - fillResoProfile(corrconfigs.at(18), HIST("Lambdav22pt"), cent, fLambdaMassAxis); - fillResoProfile(corrconfigs.at(19), HIST("AnLambdav22pt"), cent, fLambdaMassAxis); - - fillResoProfile(corrconfigs.at(20), HIST("Phiv24pt"), cent, fPhiMassAxis); - fillResoProfile(corrconfigs.at(21), HIST("K0v24pt"), cent, fK0MassAxis); - fillResoProfile(corrconfigs.at(22), HIST("Lambdav24pt"), cent, fLambdaMassAxis); - fillResoProfile(corrconfigs.at(23), HIST("AnLambdav24pt"), cent, fLambdaMassAxis); + fillResoProfile(corrconfigs.at(0), HIST("Refc22"), cent, fPhiMassAxis); + fillResoProfile(corrconfigs.at(1), HIST("Refc24"), cent, fPhiMassAxis); + + if (cfgUsePhi) { + fillResoProfile(corrconfigs.at(2), HIST("Phid22Fpt"), cent, fPhiMassAxis); + fillResoProfile(corrconfigs.at(3), HIST("Phid24Fpt"), cent, fPhiMassAxis); + fillResoProfile(corrconfigs.at(4), HIST("Phid22Bpt"), cent, fPhiMassAxis); + fillResoProfile(corrconfigs.at(5), HIST("Phid24Bpt"), cent, fPhiMassAxis); + } + if (cfgUseK0) { + fillResoProfile(corrconfigs.at(6), HIST("K0d22Fpt"), cent, fK0MassAxis); + fillResoProfile(corrconfigs.at(7), HIST("K0d24Fpt"), cent, fK0MassAxis); + fillResoProfile(corrconfigs.at(8), HIST("K0d22Bpt"), cent, fK0MassAxis); + fillResoProfile(corrconfigs.at(9), HIST("K0d24Bpt"), cent, fK0MassAxis); + } + if (cfgUseLambda) { + fillResoProfile(corrconfigs.at(10), HIST("Lambdad22Fpt"), cent, fLambdaMassAxis); + fillResoProfile(corrconfigs.at(11), HIST("Lambdad24Fpt"), cent, fLambdaMassAxis); + fillResoProfile(corrconfigs.at(12), HIST("Lambdad22Bpt"), cent, fLambdaMassAxis); + fillResoProfile(corrconfigs.at(13), HIST("Lambdad24Bpt"), cent, fLambdaMassAxis); + + fillResoProfile(corrconfigs.at(14), HIST("AnLambdad22Fpt"), cent, fLambdaMassAxis); + fillResoProfile(corrconfigs.at(15), HIST("AnLambdad24Fpt"), cent, fLambdaMassAxis); + fillResoProfile(corrconfigs.at(16), HIST("AnLambdad22Bpt"), cent, fLambdaMassAxis); + fillResoProfile(corrconfigs.at(17), HIST("AnLambdad24Bpt"), cent, fLambdaMassAxis); + } // bootstraping if (cfgUseBootStrap) { @@ -1093,35 +1160,34 @@ struct ResonancesGfwFlow { double r = rand->Rndm(); int bootId = static_cast(r * 10); - fillProfileBoot(corrconfigs.at(0), phiC22Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(1), k0C22Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(2), lambdaC22Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(3), anLambdaC22Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(4), phiC24Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(5), k0C24Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(6), lambdaC24Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(7), anLambdaC24Boot[bootId], cent); - - fillProfileBoot3D(corrconfigs.at(8), phiD22PtBoot[bootId], cent, fPhiMassAxis); - fillProfileBoot3D(corrconfigs.at(9), k0D22PtBoot[bootId], cent, fK0MassAxis); - fillProfileBoot3D(corrconfigs.at(10), lambdaD22PtBoot[bootId], cent, fLambdaMassAxis); - fillProfileBoot3D(corrconfigs.at(11), anLambdaD22PtBoot[bootId], cent, fLambdaMassAxis); - - fillProfileBoot3D(corrconfigs.at(12), phiD24PtBoot[bootId], cent, fPhiMassAxis); - fillProfileBoot3D(corrconfigs.at(13), k0D24PtBoot[bootId], cent, fK0MassAxis); - fillProfileBoot3D(corrconfigs.at(14), lambdaD24PtBoot[bootId], cent, fLambdaMassAxis); - fillProfileBoot3D(corrconfigs.at(15), anLambdaD24PtBoot[bootId], cent, fLambdaMassAxis); - - fillProfileBoot3D(corrconfigs.at(16), phiD22PtBoot[bootId], cent, fPhiMassAxis); - fillProfileBoot3D(corrconfigs.at(17), k0D22PtBoot[bootId], cent, fK0MassAxis); - fillProfileBoot3D(corrconfigs.at(18), lambdaD22PtBoot[bootId], cent, fLambdaMassAxis); - fillProfileBoot3D(corrconfigs.at(19), anLambdaD22PtBoot[bootId], cent, fLambdaMassAxis); - - fillProfileBoot3D(corrconfigs.at(20), phiD24PtBoot[bootId], cent, fPhiMassAxis); - fillProfileBoot3D(corrconfigs.at(21), k0D24PtBoot[bootId], cent, fK0MassAxis); - fillProfileBoot3D(corrconfigs.at(22), lambdaD24PtBoot[bootId], cent, fLambdaMassAxis); - fillProfileBoot3D(corrconfigs.at(23), anLambdaD24PtBoot[bootId], cent, fLambdaMassAxis); - } + fillProfileBoot(corrconfigs.at(0), RefC22Boot[bootId], cent); + fillProfileBoot(corrconfigs.at(1), RefC24Boot[bootId], cent); + + if (cfgUsePhi) { + fillProfileBoot3D(corrconfigs.at(2), phiD22FPtBoot[bootId], cent, fPhiMassAxis); + fillProfileBoot3D(corrconfigs.at(3), phiD24FPtBoot[bootId], cent, fPhiMassAxis); + fillProfileBoot3D(corrconfigs.at(4), phiD22BPtBoot[bootId], cent, fPhiMassAxis); + fillProfileBoot3D(corrconfigs.at(5), phiD24BPtBoot[bootId], cent, fPhiMassAxis); + } + if (cfgUseK0) { + fillProfileBoot3D(corrconfigs.at(6), k0D22FPtBoot[bootId], cent, fK0MassAxis); + fillProfileBoot3D(corrconfigs.at(7), k0D24FPtBoot[bootId], cent, fK0MassAxis); + fillProfileBoot3D(corrconfigs.at(8), k0D22BPtBoot[bootId], cent, fK0MassAxis); + fillProfileBoot3D(corrconfigs.at(9), k0D24BPtBoot[bootId], cent, fK0MassAxis); + } + if (cfgUseLambda) { + fillProfileBoot3D(corrconfigs.at(10), lambdaD22FPtBoot[bootId], cent, fLambdaMassAxis); + fillProfileBoot3D(corrconfigs.at(11), lambdaD24FPtBoot[bootId], cent, fLambdaMassAxis); + fillProfileBoot3D(corrconfigs.at(12), lambdaD22BPtBoot[bootId], cent, fLambdaMassAxis); + fillProfileBoot3D(corrconfigs.at(13), lambdaD24BPtBoot[bootId], cent, fLambdaMassAxis); + + fillProfileBoot3D(corrconfigs.at(14), anLambdaD22FPtBoot[bootId], cent, fLambdaMassAxis); + fillProfileBoot3D(corrconfigs.at(15), anLambdaD24FPtBoot[bootId], cent, fLambdaMassAxis); + fillProfileBoot3D(corrconfigs.at(16), anLambdaD22BPtBoot[bootId], cent, fLambdaMassAxis); + fillProfileBoot3D(corrconfigs.at(17), anLambdaD24BPtBoot[bootId], cent, fLambdaMassAxis); + } + + } // end of bootstrap condition } // end of process }; From 1e2ce1d7917e804a2f5464f526aeb906004347ad Mon Sep 17 00:00:00 2001 From: Preet Pati Date: Mon, 14 Apr 2025 20:48:14 +0200 Subject: [PATCH 3/5] Fixed the linter error --- PWGCF/Flow/Tasks/resonancesGfwFlow.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx index b86fc40fca6..06862e709ff 100644 --- a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx +++ b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx @@ -64,8 +64,8 @@ using namespace std; namespace { -std::shared_ptr RefC22Boot[10]; -std::shared_ptr RefC24Boot[10]; +std::shared_ptr refC22Boot[10]; +std::shared_ptr refC24Boot[10]; std::shared_ptr phiD22FPtBoot[10]; std::shared_ptr phiD22BPtBoot[10]; @@ -141,7 +141,7 @@ struct ResonancesGfwFlow { O2_DEFINE_CONFIGURABLE(cfgUsePhi, bool, true, "Analyze Phi") struct : ConfigurableGroup { - Configurable> cfgCosPAs{"cfgcosPAs", std::vector{0.97f, 0.995f, 0.04f}, "Minimum Pointing angle for resonances [K0, Lambda, Phi]"}; + Configurable> cfgCosPAs{"cfgCosPAs", std::vector{0.97f, 0.995f, 0.04f}, "Minimum Pointing angle for resonances [K0, Lambda, Phi]"}; Configurable> cfgDCABetDaug{"cfgDCABetDaug", std::vector{1, 1, 1}, "Maximum DCA between resonance daughters [K0, Lambda, Phi]"}; Configurable> cfgMassMin{"cfgMassMin", std::vector{0.44f, 1.1f, 0.99f}, "Minimum mass for resonances [K0, Lambda, Phi]"}; Configurable> cfgMassMax{"cfgMassMax", std::vector{0.56f, 1.16f, 1.06f}, "Maximum mass for resonances [K0, Lambda, Phi]"}; @@ -352,8 +352,8 @@ struct ResonancesGfwFlow { if (cfgUseBootStrap) { for (int i = 0; i < cfgNbootstrap; i++) { - RefC22Boot[i] = histos.add(Form("BootStrap/Refc22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); - RefC24Boot[i] = histos.add(Form("BootStrap/Refc24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); + refC22Boot[i] = histos.add(Form("BootStrap/Refc22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); + refC24Boot[i] = histos.add(Form("BootStrap/Refc24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); if (cfgUsePhi) { phiD22FPtBoot[i] = histos.add(Form("BootStrap/Phid22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); phiD24FPtBoot[i] = histos.add(Form("BootStrap/Phid24Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); @@ -838,7 +838,7 @@ struct ResonancesGfwFlow { histos.fill(HIST("hLambdaCount"), 2.5); // Rapidity correction - if (candidate.yLambda() > 0.5) + if (candidate.yLambda() > cfgRapidityCut) return false; histos.fill(HIST("hLambdaCount"), 3.5); // DCA cuts for lambda and antilambda @@ -940,7 +940,7 @@ struct ResonancesGfwFlow { return false; histos.fill(HIST("hK0Count"), 2.5); // Rapidity correction - if (candidate.yK0Short() > 0.5) + if (candidate.yK0Short() > cfgRapidityCut) return false; histos.fill(HIST("hK0Count"), 3.5); // DCA cuts for K0short @@ -1160,8 +1160,8 @@ struct ResonancesGfwFlow { double r = rand->Rndm(); int bootId = static_cast(r * 10); - fillProfileBoot(corrconfigs.at(0), RefC22Boot[bootId], cent); - fillProfileBoot(corrconfigs.at(1), RefC24Boot[bootId], cent); + fillProfileBoot(corrconfigs.at(0), refC22Boot[bootId], cent); + fillProfileBoot(corrconfigs.at(1), refC24Boot[bootId], cent); if (cfgUsePhi) { fillProfileBoot3D(corrconfigs.at(2), phiD22FPtBoot[bootId], cent, fPhiMassAxis); From 8c853e3b9c0c02ee51817b756bf5c62d61564a3c Mon Sep 17 00:00:00 2001 From: Preet Pati Date: Tue, 22 Apr 2025 16:23:04 +0200 Subject: [PATCH 4/5] Recommiting after precommit fixes --- PWGCF/Flow/Tasks/flowPbpbPikp.cxx | 92 +++++++++++- PWGCF/Flow/Tasks/resonancesGfwFlow.cxx | 188 +++++++++++++------------ 2 files changed, 191 insertions(+), 89 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowPbpbPikp.cxx b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx index 311cccc5b84..0f3848d0098 100644 --- a/PWGCF/Flow/Tasks/flowPbpbPikp.cxx +++ b/PWGCF/Flow/Tasks/flowPbpbPikp.cxx @@ -52,6 +52,7 @@ #include #include +#include using namespace o2; using namespace o2::framework; @@ -88,6 +89,10 @@ struct FlowPbpbPikp { O2_DEFINE_CONFIGURABLE(cfgCutOccupancy, int, 3000, "Occupancy cut") O2_DEFINE_CONFIGURABLE(cfgUseGlobalTrack, bool, true, "use Global track") O2_DEFINE_CONFIGURABLE(cfgITScluster, int, 0, "Number of ITS cluster") + O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, true, "Use track density efficiency correction") + + Configurable> cfgTrackDensityP0{"cfgTrackDensityP0", std::vector{0.7217476707, 0.7384792571, 0.7542625668, 0.7640680200, 0.7701951667, 0.7755299053, 0.7805901710, 0.7849446786, 0.7957356586, 0.8113039262, 0.8211968966, 0.8280558878, 0.8329342135}, "parameter 0 for track density efficiency correction"}; + Configurable> cfgTrackDensityP1{"cfgTrackDensityP1", std::vector{-2.169488e-05, -2.191913e-05, -2.295484e-05, -2.556538e-05, -2.754463e-05, -2.816832e-05, -2.846502e-05, -2.843857e-05, -2.705974e-05, -2.477018e-05, -2.321730e-05, -2.203315e-05, -2.109474e-05}, "parameter 1 for track density efficiency correction"}; ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for histograms"}; ConfigurableAxis axisPhi{"axisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"}; @@ -127,6 +132,13 @@ struct FlowPbpbPikp { std::vector mAcceptance; bool correctionsLoaded = false; + // local track density correction + std::vector funcEff; + TH1D* hFindPtBin; + TF1* funcV2; + TF1* funcV3; + TF1* funcV4; + void init(InitContext const&) { ccdb->setURL(ccdbUrl.value); @@ -199,6 +211,10 @@ struct FlowPbpbPikp { for (int i = 0; i < fPtAxis->GetNbins(); i++) oba->Add(new TNamed(Form("Pr08Gap24_pt_%i", i + 1), "Pr08Gap24_pTDiff")); + oba->Add(new TNamed("Pi08BGap22", "Pi08BGap22")); + for (int i = 0; i < fPtAxis->GetNbins(); i++) + oba->Add(new TNamed(Form("Pi08BGap22_pt_%i", i + 1), "Pi08BGap22_pTDiff")); + fFC->SetName("FlowContainer"); fFC->SetXAxis(fPtAxis); fFC->Initialize(oba, axisMultiplicity, cfgNbootstrap); @@ -219,6 +235,9 @@ struct FlowPbpbPikp { fGFW->AddRegion("poiNpi", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 2); fGFW->AddRegion("olNpi", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 16); + fGFW->AddRegion("poiPpi", 0.4, 0.8, 1 + fPtAxis->GetNbins(), 2); + fGFW->AddRegion("olPpi", 0.4, 0.8, 1 + fPtAxis->GetNbins(), 16); + // kaon fGFW->AddRegion("poiNk", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 4); fGFW->AddRegion("olNk", -0.8, -0.4, 1 + fPtAxis->GetNbins(), 32); @@ -251,7 +270,30 @@ struct FlowPbpbPikp { corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk refN08 | olNk {2 2} refP08 {-2 -2}", "Ka08Gap24", kTRUE)); corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNpr refN08 | olNpr {2 2} refP08 {-2 -2}", "Pr08Gap24", kTRUE)); + // Backward correlations + corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2} refP08 {-2}", "Pi08BGap22", kFALSE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPpi refP08 | olPpi {2} refN08 {-2}", "Pi08BGap22", kTRUE)); + fGFW->CreateRegions(); + + if (cfgTrackDensityCorrUse) { + std::vector pTEffBins = {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.4, 1.8, 2.2, 2.6, 3.0}; + hFindPtBin = new TH1D("hFindPtBin", "hFindPtBin", pTEffBins.size() - 1, &pTEffBins[0]); + funcEff.resize(pTEffBins.size() - 1); + // LHC24g3 Eff + std::vector f1p0 = cfgTrackDensityP0; + std::vector f1p1 = cfgTrackDensityP1; + for (uint ifunc = 0; ifunc < pTEffBins.size() - 1; ifunc++) { + funcEff[ifunc] = new TF1(Form("funcEff%i", ifunc), "[0]+[1]*x", 0, 3000); + funcEff[ifunc]->SetParameters(f1p0[ifunc], f1p1[ifunc]); + } + funcV2 = new TF1("funcV2", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + funcV2->SetParameters(0.0186111, 0.00351907, -4.38264e-05, 1.35383e-07, -3.96266e-10); + funcV3 = new TF1("funcV3", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + funcV3->SetParameters(0.0174056, 0.000703329, -1.45044e-05, 1.91991e-07, -1.62137e-09); + funcV4 = new TF1("funcV4", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + funcV4->SetParameters(0.008845, 0.000259668, -3.24435e-06, 4.54837e-08, -6.01825e-10); + } } enum Particles { @@ -523,6 +565,37 @@ struct FlowPbpbPikp { int pidIndex; loadCorrections(bc); // load corrections for the each event + // Track loop for calculating the Qn angles + double psi2Est = 0, psi3Est = 0, psi4Est = 0; + float wEPeff = 1; + double v2 = 0, v3 = 0, v4 = 0; + // be cautious, this only works for Pb-Pb + // esimate the Qn angles and vn for this event + if (cfgTrackDensityCorrUse) { + double q2x = 0, q2y = 0; + double q3x = 0, q3y = 0; + double q4x = 0, q4y = 0; + for (const auto& track : tracks) { + bool withinPtRef = (cfgCutPtMin < track.pt()) && (track.pt() < cfgCutPtMax); // within RF pT range + if (withinPtRef) { + q2x += std::cos(2 * track.phi()); + q2y += std::sin(2 * track.phi()); + q3x += std::cos(3 * track.phi()); + q3y += std::sin(3 * track.phi()); + q4x += std::cos(4 * track.phi()); + q4y += std::sin(4 * track.phi()); + } + } + psi2Est = std::atan2(q2y, q2x) / 2.; + psi3Est = std::atan2(q3y, q3x) / 3.; + psi4Est = std::atan2(q4y, q4x) / 4.; + + v2 = funcV2->Eval(cent); + v3 = funcV3->Eval(cent); + v4 = funcV4->Eval(cent); + } + + // Actual track loop for (auto const& track : tracks) { if (!selectionTrack(track)) continue; @@ -540,6 +613,9 @@ struct FlowPbpbPikp { // pidIndex = getBayesPIDIndex(track); pidIndex = getNsigmaPID(track); + + weff = 1; // Initializing weff for each track + // NUA weights if (cfgOutputNUAWeights) fillWeights(track, vtxz, pidIndex, runNumber); @@ -550,10 +626,24 @@ struct FlowPbpbPikp { if (withinPtRef && withinPtPOI && pidIndex) waccRef = waccPOI; // if particle is both (then it's overlap), override ref with POI + // Track density correction + if (cfgTrackDensityCorrUse && withinPtRef) { + double fphi = v2 * std::cos(2 * (track.phi() - psi2Est)) + v3 * std::cos(3 * (track.phi() - psi3Est)) + v4 * std::cos(4 * (track.phi() - psi4Est)); + fphi = (1 + 2 * fphi); + int pTBinForEff = hFindPtBin->FindBin(track.pt()); + if (pTBinForEff >= 1 && pTBinForEff <= hFindPtBin->GetNbinsX()) { + wEPeff = funcEff[pTBinForEff - 1]->Eval(fphi * tracks.size()); + if (wEPeff > 0.) { + wEPeff = 1. / wEPeff; + weff *= wEPeff; + } + } + } // end of track density correction loop + if (withinPtRef) { histos.fill(HIST("hPhiWeighted"), track.phi(), waccRef); fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), waccRef * weff, 1); - fGFW->Fill(track.eta(), 1, track.phi(), waccRef * weff, 512); + fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), waccRef * weff, 512); } if (withinPtPOI) { fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, track.phi(), waccPOI * weff, 128); diff --git a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx index 06862e709ff..44471c2093d 100644 --- a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx +++ b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx @@ -38,6 +38,7 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" +#include "Common/Core/RecoDecay.h" #include "CommonConstants/PhysicsConstants.h" #include "PWGLF/DataModel/EPCalibrationTables.h" @@ -135,10 +136,19 @@ struct ResonancesGfwFlow { O2_DEFINE_CONFIGURABLE(cfgUseWeightPhiEtaPt, bool, false, "Use Phi, Eta, Pt dependent NUA weights") O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgUseBootStrap, bool, true, "Use bootstrap for error estimation") - O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, false, "Use track density efficiency correction") + O2_DEFINE_CONFIGURABLE(cfgTrackDensityCorrUse, bool, true, "Use track density efficiency correction") + O2_DEFINE_CONFIGURABLE(cfgUsePhi, bool, true, "Analyze Phi") O2_DEFINE_CONFIGURABLE(cfgUseK0, bool, true, "Analyze K0") O2_DEFINE_CONFIGURABLE(cfgUseLambda, bool, true, "Analyze Lambda") - O2_DEFINE_CONFIGURABLE(cfgUsePhi, bool, true, "Analyze Phi") + + enum OutputSpecies { + Ref = 0, + K0 = 1, + Lambda = 2, + AnLambda = 3, + Phi = 4, + kCount_OutputSpecies + }; struct : ConfigurableGroup { Configurable> cfgCosPAs{"cfgCosPAs", std::vector{0.97f, 0.995f, 0.04f}, "Minimum Pointing angle for resonances [K0, Lambda, Phi]"}; @@ -146,7 +156,7 @@ struct ResonancesGfwFlow { Configurable> cfgMassMin{"cfgMassMin", std::vector{0.44f, 1.1f, 0.99f}, "Minimum mass for resonances [K0, Lambda, Phi]"}; Configurable> cfgMassMax{"cfgMassMax", std::vector{0.56f, 1.16f, 1.06f}, "Maximum mass for resonances [K0, Lambda, Phi]"}; Configurable> cfgNMassBins{"cfgNMassBins", std::vector{70, 70, 70}, "Invariant mass bins for resonances [K0, Lambda, Phi]"}; - Configurable> cfgMccCut{"cfgMccCut", std::vector{0.005f, 0.01f}, "MCC cut for resonances [K0, Lambda]"}; + Configurable> cfgMccCut{"cfgMccCut", std::vector{0.005f, 0.01f, 0.0f}, "MCC cut for resonances [K0, Lambda, Phi]"}; Configurable> cfgPosTrackPt{"cfgPosTrackPt", std::vector{0.15f, 0.15f, 0.15f}, "Pt cut for positive track of resonances [K0, Lambda, Phi]"}; Configurable> cfgNegTrackPt{"cfgNegTrackPt", std::vector{0.15f, 0.15f, 0.15f}, "Pt cut for negative track of resonances [K0, Lambda, Phi]"}; } resoCuts; @@ -200,15 +210,6 @@ struct ResonancesGfwFlow { TAxis* fLambdaMassAxis; TRandom3* fRndm = new TRandom3(0); - enum OutputSpecies { - Ref = 0, - K0 = 1, - Lambda = 2, - AnLambda = 3, - Phi = 4, - kCount_OutputSpecies - }; - std::vector mAcceptance; bool correctionsLoaded = false; @@ -243,13 +244,41 @@ struct ResonancesGfwFlow { histos.add("hPhiPhi", "", {HistType::kTH1D, {axisPhi}}); histos.add("hPhiEta", "", {HistType::kTH1D, {axisEta}}); histos.add("hPhiMass_sparse", "", {HistType::kTHnSparseD, {{axisPhiMass, axisPt, axisMultiplicity}}}); + histos.add("hPhimassSparse_RD", "", {HistType::kTHnSparseD, {{axisPhiMass, axisPt, axisMultiplicity}}}); histos.add("Phid22Fpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); histos.add("Phid24Fpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); histos.add("Phid22Bpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); histos.add("Phid24Bpt", "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); } + if (cfgUseK0) { + histos.add("PlusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("MinusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); + histos.add("PlusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("MinusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); + histos.add("hK0Phi", "", {HistType::kTH1D, {axisPhi}}); + histos.add("hK0Eta", "", {HistType::kTH1D, {axisEta}}); + histos.add("hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, axisPt, axisMultiplicity}}}); + histos.add("hK0s", "", {HistType::kTH1D, {singleCount}}); + histos.add("K0d22Fpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + histos.add("K0d24Fpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + histos.add("K0d22Bpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + histos.add("K0d24Bpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); + + histos.add("hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{11, 0, 11}}}); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(1, "K0 candidates"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(2, "Daughter pt"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(3, "Mass cut"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(4, "Rapidity cut"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(5, "DCA to PV"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(6, "DCA between daughters"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(7, "V0radius"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(8, "CosPA"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(9, "Proper lifetime"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(10, "Daughter track selection"); + histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(11, "Mass cross check"); + } if (cfgUseLambda) { histos.add("PlusTPC_L", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); histos.add("MinusTPC_L", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); @@ -291,35 +320,6 @@ struct ResonancesGfwFlow { histos.get(HIST("hLambdaCount"))->GetXaxis()->SetBinLabel(11, "Mass cross check"); } - if (cfgUseK0) { - histos.add("PlusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("MinusTPC_K0", "", {HistType::kTH2D, {{axisPt, axisTPCsignal}}}); - histos.add("PlusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("MinusTOF_K0", "", {HistType::kTH2D, {{axisPt, axisTOFsignal}}}); - histos.add("hK0Phi", "", {HistType::kTH1D, {axisPhi}}); - histos.add("hK0Eta", "", {HistType::kTH1D, {axisEta}}); - histos.add("hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, axisPt, axisMultiplicity}}}); - histos.add("hK0s", "", {HistType::kTH1D, {singleCount}}); - - histos.add("K0d22Fpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - histos.add("K0d24Fpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - histos.add("K0d22Bpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - histos.add("K0d24Bpt", "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); - - histos.add("hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{11, 0, 11}}}); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(1, "K0 candidates"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(2, "Daughter pt"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(3, "Mass cut"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(4, "Rapidity cut"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(5, "DCA to PV"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(6, "DCA between daughters"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(7, "V0radius"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(8, "CosPA"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(9, "Proper lifetime"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(10, "Daughter track selection"); - histos.get(HIST("hK0Count"))->GetXaxis()->SetBinLabel(11, "Mass cross check"); - } - histos.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{8, 0, 8}}}); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "After sel8"); @@ -355,10 +355,10 @@ struct ResonancesGfwFlow { refC22Boot[i] = histos.add(Form("BootStrap/Refc22_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); refC24Boot[i] = histos.add(Form("BootStrap/Refc24_bootstrap_%d", i), "", {HistType::kTProfile, {axisMultiplicity}}); if (cfgUsePhi) { - phiD22FPtBoot[i] = histos.add(Form("BootStrap/Phid22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); - phiD24FPtBoot[i] = histos.add(Form("BootStrap/Phid24Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); - phiD22BPtBoot[i] = histos.add(Form("BootStrap/Phid22Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); - phiD24BPtBoot[i] = histos.add(Form("BootStrap/Phid24Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + phiD22FPtBoot[i] = histos.add(Form("BootStrap/phid22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + phiD24FPtBoot[i] = histos.add(Form("BootStrap/phid24Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + phiD22BPtBoot[i] = histos.add(Form("BootStrap/phid22Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); + phiD24BPtBoot[i] = histos.add(Form("BootStrap/phid24Bpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisPhiMass, axisMultiplicity}}); } if (cfgUseK0) { k0D22FPtBoot[i] = histos.add(Form("BootStrap/k0d22Fpt_bootstrap_%d", i), "", {HistType::kTProfile3D, {axisPt, axisK0Mass, axisMultiplicity}}); @@ -385,7 +385,7 @@ struct ResonancesGfwFlow { double* ptBins = &(axis.binEdges)[0]; fPtAxis = new TAxis(nPtBins, ptBins); - fPhiMassAxis = new TAxis(vMassBins[Phi - 2], 0.99, 1.06); + fPhiMassAxis = new TAxis(vMassBins[Phi - 2], vMassMin[Phi - 2], vMassMax[Phi - 2]); fK0MassAxis = new TAxis(vMassBins[K0 - 1], vMassMin[K0 - 1], vMassMax[K0 - 1]); fLambdaMassAxis = new TAxis(vMassBins[Lambda - 1], vMassMin[Lambda - 1], vMassMax[Lambda - 1]); @@ -433,29 +433,29 @@ struct ResonancesGfwFlow { corrconfigs.push_back(fGFW->GetCorrelatorConfig("refN08 {2 2} refP08 {-2 -2}", "Ref08Gap24", kFALSE)); //--------- pt differential pois - if (cfgUsePhi) { - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2} refP08 {-2}", "PhiF08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2 2} refP08 {-2 -2}", "PhiF08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2} refN08 {-2}", "PhiB08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2 2} refN08 {-2 -2}", "PhiB08Gap24", kTRUE)); - } - if (cfgUseK0) { - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2} refP08 {-2}", "KsF08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2 2} refP08 {-2 -2}", "KsF08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2} refN08 {-2}", "KsB08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2 2} refN08 {-2 -2}", "KsB08Gap24", kTRUE)); - } - if (cfgUseLambda) { - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2} refP08 {-2}", "LamF08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2 2} refP08 {-2 -2}", "LamF08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2} refN08 {-2}", "LamB08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2 2} refN08 {-2 -2}", "LamB08Gap24", kTRUE)); - - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2} refP08 {-2}", "AnLamF08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2 2} refP08 {-2 -2}", "AnLamF08Gap24", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2} refN08 {-2}", "AnLamB08Gap22", kTRUE)); - corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2 2} refN08 {-2 -2}", "AnLamB08Gap24", kTRUE)); - } + // Phi + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2} refP08 {-2}", "PhiF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNphi refN08 | olNphi {2 2} refP08 {-2 -2}", "PhiF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2} refN08 {-2}", "PhiB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPphi refP08 | olPphi {2 2} refN08 {-2 -2}", "PhiB08Gap24", kTRUE)); + + // K0 + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2} refP08 {-2}", "KsF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNk0 refN08 | olNk0 {2 2} refP08 {-2 -2}", "KsF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2} refN08 {-2}", "KsB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPk0 refP08 | olPk0 {2 2} refN08 {-2 -2}", "KsB08Gap24", kTRUE)); + + // Lambda + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2} refP08 {-2}", "LamF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNlam refN08 | olNlam {2 2} refP08 {-2 -2}", "LamF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2} refN08 {-2}", "LamB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPlam refP08 | olPlam {2 2} refN08 {-2 -2}", "LamB08Gap24", kTRUE)); + + // Antilambda + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2} refP08 {-2}", "AnLamF08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiNantilam refN08 | olNantilam {2 2} refP08 {-2 -2}", "AnLamF08Gap24", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2} refN08 {-2}", "AnLamB08Gap22", kTRUE)); + corrconfigs.push_back(fGFW->GetCorrelatorConfig("poiPantilam refP08 | olPantilam {2 2} refN08 {-2 -2}", "AnLamB08Gap24", kTRUE)); fGFW->CreateRegions(); @@ -480,7 +480,7 @@ struct ResonancesGfwFlow { } template - void fillResoProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent, TAxis* partaxis) + void fillResoProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double cent, TAxis* partaxis) { double dnx, val; if (!corrconf.pTDif) { @@ -684,6 +684,9 @@ struct ResonancesGfwFlow { double wacc = 1; double cent = collision.centFT0C(); double vtxz = collision.posZ(); + double phi = mom.Phi(); + + phi = RecoDecay::constrainAngle(phi, 0.0, 1); // constrain azimuthal angle to [0,2pi] if ((cfgUseWeightPhiEtaVtxz && cfgUseWeightPhiPtCent) || (cfgUseWeightPhiEtaPt && cfgUseWeightPhiPtCent) || (cfgUseWeightPhiEtaVtxz && cfgUseWeightPhiEtaPt)) { LOGF(fatal, "Only one of the three weight options can be used at a time"); @@ -694,11 +697,11 @@ struct ResonancesGfwFlow { return 1; } if (cfgUseWeightPhiEtaVtxz) - wacc = mAcceptance[pid_index_reso]->getNUA(mom.Phi(), mom.Eta(), vtxz); + wacc = mAcceptance[pid_index_reso]->getNUA(phi, mom.Eta(), vtxz); if (cfgUseWeightPhiPtCent) - wacc = mAcceptance[pid_index_reso]->getNUA(mom.Phi(), mom.Pt(), cent); + wacc = mAcceptance[pid_index_reso]->getNUA(phi, mom.Pt(), cent); if (cfgUseWeightPhiEtaPt) - wacc = mAcceptance[pid_index_reso]->getNUA(mom.Phi(), mom.Eta(), mom.Pt()); + wacc = mAcceptance[pid_index_reso]->getNUA(phi, mom.Eta(), mom.Pt()); } return wacc; } @@ -761,34 +764,46 @@ struct ResonancesGfwFlow { histos.fill(HIST("KaminusTPC"), partminus.pt(), partminus.tpcNSigmaKa()); histos.fill(HIST("KaminusTOF"), partminus.pt(), partminus.tofNSigmaKa()); + std::array, 2> ptarr = {{{partplus.px(), partplus.py(), partplus.pz()}, {partminus.px(), partminus.py(), partminus.pz()}}}; + std::array massarr = {plusmass, plusmass}; + + // Calculation using RecoDecay + double invMassRD = RecoDecay::m2(ptarr, massarr); + double ptRD = std::sqrt(RecoDecay::sumOfSquares(partplus.pt(), partminus.pt())); + + // Calculation using ROOT vectors plusdaug = ROOT::Math::PxPyPzMVector(partplus.px(), partplus.py(), partplus.pz(), plusmass); minusdaug = ROOT::Math::PxPyPzMVector(partminus.px(), partminus.py(), partminus.pz(), plusmass); mom = plusdaug + minusdaug; double pt = mom.Pt(); double invMass = mom.M(); + double phi = mom.Phi(); bool withinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range bool withinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); + phi = RecoDecay::constrainAngle(phi, 0.0, 1); // constrain azimuthal angle to [0,2pi] + if (std::abs(mom.Rapidity()) < cfgRapidityCut) { histos.fill(hist, invMass, pt, collision.centFT0C()); - histos.fill(HIST("hPhiPhi"), mom.Phi()); + histos.fill(HIST("hPhiPhi"), phi); histos.fill(HIST("hPhiEta"), mom.Eta()); + histos.fill(HIST("hPhimassSparse_RD"), invMassRD, ptRD, collision.centFT0C()); // fill RecoDecay mass and pt // Fill Phi weights if (cfgOutputNUAWeights && withinPtPOI) { - histos.fill(HIST("NUA/hPhiEtaVtxz_phi"), mom.Phi(), mom.Eta(), collision.posZ()); - histos.fill(HIST("NUA/hPhiPtCent_phi"), mom.Phi(), pt, collision.centFT0C()); - histos.fill(HIST("NUA/hPhiEtaPt_phi"), mom.Phi(), mom.Eta(), pt); + histos.fill(HIST("NUA/hPhiEtaVtxz_phi"), phi, mom.Eta(), collision.posZ()); + histos.fill(HIST("NUA/hPhiPtCent_phi"), phi, pt, collision.centFT0C()); + histos.fill(HIST("NUA/hPhiEtaPt_phi"), phi, mom.Eta(), pt); } double weff = 1; double waccPOI = getAcceptancePhi(mom, collision, Phi); if (withinPtPOI) - fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), mom.Phi(), weff * waccPOI, 2); + fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), phi, weff * waccPOI, 2); if (withinPtPOI && withinPtRef) - fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), mom.Phi(), weff * waccPOI, 32); + fGFW->Fill(mom.Eta(), ((fPtAxis->FindBin(pt) - 1) * fPhiMassAxis->GetNbins()) + (fPhiMassAxis->FindBin(invMass) - 1), phi, weff * waccPOI, 32); } } return; @@ -1087,6 +1102,8 @@ struct ResonancesGfwFlow { double pt = track.pt(); bool withinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); + weff = 1; // Initializing weff for each track + if (withinPtRef) if (cfgOutputNUAWeights) fillWeights(track, collision, Ref); @@ -1117,19 +1134,17 @@ struct ResonancesGfwFlow { } for (auto const& v0s : V0s) { - if (cfgUseLambda) { - if (selectionLambda(collision, v0s) == true) - histos.fill(HIST("hLambdas"), 1); - } if (cfgUseK0) { if (selectionK0(collision, v0s) == true) histos.fill(HIST("hK0s"), 1); } + if (cfgUseLambda) { + if (selectionLambda(collision, v0s) == true) + histos.fill(HIST("hLambdas"), 1); + } } // End of v0 loop - fillResoProfile(corrconfigs.at(0), HIST("Refc22"), cent, fPhiMassAxis); fillResoProfile(corrconfigs.at(1), HIST("Refc24"), cent, fPhiMassAxis); - if (cfgUsePhi) { fillResoProfile(corrconfigs.at(2), HIST("Phid22Fpt"), cent, fPhiMassAxis); fillResoProfile(corrconfigs.at(3), HIST("Phid24Fpt"), cent, fPhiMassAxis); @@ -1159,10 +1174,8 @@ struct ResonancesGfwFlow { TRandom3* rand = new TRandom3(0); double r = rand->Rndm(); int bootId = static_cast(r * 10); - fillProfileBoot(corrconfigs.at(0), refC22Boot[bootId], cent); fillProfileBoot(corrconfigs.at(1), refC24Boot[bootId], cent); - if (cfgUsePhi) { fillProfileBoot3D(corrconfigs.at(2), phiD22FPtBoot[bootId], cent, fPhiMassAxis); fillProfileBoot3D(corrconfigs.at(3), phiD24FPtBoot[bootId], cent, fPhiMassAxis); @@ -1186,7 +1199,6 @@ struct ResonancesGfwFlow { fillProfileBoot3D(corrconfigs.at(16), anLambdaD22BPtBoot[bootId], cent, fLambdaMassAxis); fillProfileBoot3D(corrconfigs.at(17), anLambdaD24BPtBoot[bootId], cent, fLambdaMassAxis); } - } // end of bootstrap condition } // end of process }; From ee48578bd09d60c86962f70911af2b94e44bdeff Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 22 Apr 2025 14:34:52 +0000 Subject: [PATCH 5/5] Please consider the following formatting changes --- PWGCF/Flow/Tasks/resonancesGfwFlow.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx index b8997d30873..145c2f82e3a 100644 --- a/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx +++ b/PWGCF/Flow/Tasks/resonancesGfwFlow.cxx @@ -1152,7 +1152,7 @@ struct ResonancesGfwFlow { histos.fill(HIST("hLambdas"), 1); } } // End of v0 loop - + fillResoProfile(corrconfigs.at(0), HIST("Refc22"), cent, fPhiMassAxis); fillResoProfile(corrconfigs.at(1), HIST("Refc24"), cent, fPhiMassAxis); if (cfgUsePhi) { @@ -1183,7 +1183,7 @@ struct ResonancesGfwFlow { if (cfgUseBootStrap) { double r = fRndm->Rndm(); int bootId = static_cast(r * 10); - + fillProfileBoot(corrconfigs.at(0), refC22Boot[bootId], cent); fillProfileBoot(corrconfigs.at(1), refC24Boot[bootId], cent);